summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Zoey Chen <zoeychen@google.com> 2024-01-18 14:16:52 +0000
committer Zoey Chen <zoeychen@google.com> 2024-01-19 12:27:29 +0000
commit12b77a166d218b659191215fc545449a01f34097 (patch)
tree68195e3b0d8ab685b3c6f7c56f9e96d1ac2b50e6
parent07e48d4a6a162c65963c1cb78a2496bc75c1f82b (diff)
[ToA] ShellCommand: Implement grammatical gender in GrammaticalInflectionService
Bug: 314887263 Test: manual Change-Id: I9d600d66a986b9c90fe8911ea85e344b47598383
-rw-r--r--services/core/java/com/android/server/grammaticalinflection/GrammaticalInflectionShellCommand.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/grammaticalinflection/GrammaticalInflectionShellCommand.java b/services/core/java/com/android/server/grammaticalinflection/GrammaticalInflectionShellCommand.java
index d22372860ead..cdda69278b2c 100644
--- a/services/core/java/com/android/server/grammaticalinflection/GrammaticalInflectionShellCommand.java
+++ b/services/core/java/com/android/server/grammaticalinflection/GrammaticalInflectionShellCommand.java
@@ -21,6 +21,7 @@ import static android.content.res.Configuration.GRAMMATICAL_GENDER_NOT_SPECIFIED
import android.app.ActivityManager;
import android.app.GrammaticalInflectionManager;
import android.app.IGrammaticalInflectionManager;
+import android.content.AttributionSource;
import android.content.res.Configuration;
import android.os.RemoteException;
import android.os.ShellCommand;
@@ -44,9 +45,12 @@ class GrammaticalInflectionShellCommand extends ShellCommand {
}
private final IGrammaticalInflectionManager mBinderService;
+ private AttributionSource mAttributionSource;
- GrammaticalInflectionShellCommand(IGrammaticalInflectionManager grammaticalInflectionManager) {
+ GrammaticalInflectionShellCommand(IGrammaticalInflectionManager grammaticalInflectionManager,
+ AttributionSource attributionSource) {
mBinderService = grammaticalInflectionManager;
+ mAttributionSource = attributionSource;
}
@Override
@@ -115,7 +119,7 @@ class GrammaticalInflectionShellCommand extends ShellCommand {
} while (true);
try {
- mBinderService.setSystemWideGrammaticalGender(userId, grammaticalGender);
+ mBinderService.setSystemWideGrammaticalGender(grammaticalGender, userId);
} catch (RemoteException e) {
getOutPrintWriter().println("Remote Exception: " + e);
}
@@ -141,7 +145,8 @@ class GrammaticalInflectionShellCommand extends ShellCommand {
} while (true);
try {
- int grammaticalGender = mBinderService.getSystemGrammaticalGender(userId);
+ int grammaticalGender = mBinderService.getSystemGrammaticalGender(mAttributionSource,
+ userId);
getOutPrintWriter().println(GRAMMATICAL_GENDER_MAP.get(grammaticalGender));
} catch (RemoteException e) {
getOutPrintWriter().println("Remote Exception: " + e);