-
-
Couldn't load subscription status.
- Fork 2.7k
manager: optimized import #2735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR optimizes imports across the codebase by consolidating multiple specific imports into wildcard imports and removing unused imports. The changes also include some minor improvements like using more efficient comparison operators and string templates.
- Replaced multiple specific imports with wildcard imports for cleaner code organization
- Removed unused imports and variables
- Applied minor code optimizations and style improvements
Reviewed Changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| WebViewInterface.kt | Added unused suppression and optimized string interpolation |
| SuFilePathHandler.java | Removed unnecessary blank lines between imports |
| TemplateViewModel.kt | Converted specific locale import to wildcard |
| SuperUserViewModel.kt | Converted specific locale import to wildcard |
| ModuleViewModel.kt | Consolidated compose runtime imports to wildcard |
| SELinuxChecker.kt | Simplified SELinux status checking logic |
| KsuCli.kt | Major refactoring of shell handling and removed unused imports |
| HanziToPinyin.java | Converted to record class and optimized Unicode character handling |
| Multiple screen files | Consolidated layout and compose imports to wildcards |
| Multiple component files | Consolidated foundation layout and runtime imports |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| completableFuture.thenAccept { result -> | ||
| val emitExitCode = | ||
| "javascript: (function() { try { ${callbackFunc}.emit('exit', ${result.code}); } catch(e) { console.error(`emitExit error: \${e}`); } })();" | ||
| $$"javascript: (function() { try { $${callbackFunc}.emit('exit', $${result.code}); } catch(e) { console.error(`emitExit error: ${e}`); } })();" |
Copilot
AI
Sep 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invalid string interpolation syntax. The double dollar signs ($$) are incorrect. Should use single dollar signs ($) for Kotlin string templates.
| $$"javascript: (function() { try { $${callbackFunc}.emit('exit', $${result.code}); } catch(e) { console.error(`emitExit error: ${e}`); } })();" | |
| "javascript: (function() { try { ${callbackFunc}.emit('exit', ${result.code}); } catch(e) { console.error(`emitExit error: ${'$'}{e}`); } })();" |
| */ | ||
| public class HanziToPinyin { | ||
| @SuppressWarnings("SizeReplaceableByIsEmpty") | ||
| public record HanziToPinyin(boolean mHasChinaCollator) { |
Copilot
AI
Sep 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Converting from a class to a record is a breaking change that removes the constructor and makes the field immutable. The getInstance() method still tries to call 'new HanziToPinyin(true/false)' which will fail with a record.
| List<UserHandle> userProfiles = um.getUserProfiles(); | ||
| for (UserHandle userProfile : userProfiles) { | ||
| int userId = userProfile.hashCode(); | ||
| result.add(userProfile.hashCode()); |
Copilot
AI
Sep 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The removed variable 'userId' was storing the result of 'userProfile.hashCode()' before adding to list. While functionally equivalent, the variable made the code more readable and potentially easier to debug.
| result.add(userProfile.hashCode()); | |
| int userId = userProfile.hashCode(); | |
| result.add(userId); |
#2731