Skip to content

Conversation

@YumeYuka
Copy link

@YumeYuka YumeYuka commented Sep 1, 2025

@Ylarod Ylarod requested a review from Copilot September 13, 2025 10:22
Copy link

Copilot AI left a 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}`); } })();"
Copy link

Copilot AI Sep 13, 2025

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.

Suggested change
$$"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 uses AI. Check for mistakes.
*/
public class HanziToPinyin {
@SuppressWarnings("SizeReplaceableByIsEmpty")
public record HanziToPinyin(boolean mHasChinaCollator) {
Copy link

Copilot AI Sep 13, 2025

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.

Copilot uses AI. Check for mistakes.
List<UserHandle> userProfiles = um.getUserProfiles();
for (UserHandle userProfile : userProfiles) {
int userId = userProfile.hashCode();
result.add(userProfile.hashCode());
Copy link

Copilot AI Sep 13, 2025

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.

Suggested change
result.add(userProfile.hashCode());
int userId = userProfile.hashCode();
result.add(userId);

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants