OSDN Git Service

Remove incorrectly specified @UserIdInt
authorYohei Yukawa <yukawa@google.com>
Mon, 26 Feb 2018 02:31:47 +0000 (11:31 +0900)
committerYohei Yukawa <yukawa@google.com>
Mon, 26 Feb 2018 02:31:47 +0000 (11:31 +0900)
This is a follow up CL to my previous CL [1], which introduced
TextServicesManagerServicve.SessionRequest for internal state
management.

It turns out that SessionRequest#mUserId was incorrectly marked with
@UserIdInt, even though it actually stores uid, not user ID int.

This CL addresses the confusion by removing @UserIdInt as well as
renaming it to SessionRequest#mUid.

There should be no behavior change actually.

 [1]: I92e7aa40dc9ea14f67d355f0bfa15325b775d27b

Bug: 7254002
Test: compile
Change-Id: I94f19d028be3b24fe0f3d848236ea9ca68e537b4

services/core/java/com/android/server/TextServicesManagerService.java

index 39fc019..965714d 100644 (file)
@@ -236,7 +236,7 @@ public class TextServicesManagerService extends ITextServicesManager.Stub {
                     pw.println("        " + "mTsListener=" + req.mTsListener);
                     pw.println("        " + "mScListener=" + req.mScListener);
                     pw.println(
-                            "        " + "mScLocale=" + req.mLocale + " mUid=" + req.mUserId);
+                            "        " + "mScLocale=" + req.mLocale + " mUid=" + req.mUid);
                 }
                 final int numOnGoingSessionRequests = grp.mOnGoingSessionRequests.size();
                 for (int j = 0; j < numOnGoingSessionRequests; j++) {
@@ -246,7 +246,7 @@ public class TextServicesManagerService extends ITextServicesManager.Stub {
                     pw.println("        " + "mTsListener=" + req.mTsListener);
                     pw.println("        " + "mScListener=" + req.mScListener);
                     pw.println(
-                            "        " + "mScLocale=" + req.mLocale + " mUid=" + req.mUserId);
+                            "        " + "mScLocale=" + req.mLocale + " mUid=" + req.mUid);
                 }
                 final int N = grp.mListeners.getRegisteredCallbackCount();
                 for (int j = 0; j < N; j++) {
@@ -738,8 +738,7 @@ public class TextServicesManagerService extends ITextServicesManager.Stub {
     }
 
     private static final class SessionRequest {
-        @UserIdInt
-        public final int mUserId;
+        public final int mUid;
         @Nullable
         public final String mLocale;
         @NonNull
@@ -749,10 +748,10 @@ public class TextServicesManagerService extends ITextServicesManager.Stub {
         @Nullable
         public final Bundle mBundle;
 
-        SessionRequest(@UserIdInt final int userId, @Nullable String locale,
+        SessionRequest(int uid, @Nullable String locale,
                 @NonNull ITextServicesSessionListener tsListener,
                 @NonNull ISpellCheckerSessionListener scListener, @Nullable Bundle bundle) {
-            mUserId = userId;
+            mUid = uid;
             mLocale = locale;
             mTsListener = tsListener;
             mScListener = scListener;