OSDN Git Service

Make InputMethodInfo#isEncryptionAware() strict.
authorYohei Yukawa <yukawa@google.com>
Tue, 9 Feb 2016 21:39:50 +0000 (13:39 -0800)
committerYohei Yukawa <yukawa@google.com>
Tue, 9 Feb 2016 21:39:50 +0000 (13:39 -0800)
This is a follow up CL to the previous CL [1], which unintentionally
relied on whether the entire application rather than the
InputMethodService is marked to be encryption-aware.  This wasn't
obvious because right now LatinIME is entirely marked to be
encryption-aware, which probably needs to be reconsidered in subsequent
CLs.

This CL drops "encryptionAware" line from InputMethodInfo#dump() as it
is redundant.  The same information is already dumped in the
'ServiceInfo' section.

 [1] Icf921fe3661eccf4a589b08b616d05decc561356
     69811a98f161a04af8e8ec9978c3a5efe1ea0f29

Bug: 26279466
Change-Id: I6cea5fe5731f4a6a64ea722b854b99c5154a15ae

core/java/android/view/inputmethod/InputMethodInfo.java

index ec2c05e..d97f8af 100644 (file)
@@ -429,15 +429,15 @@ public final class InputMethodInfo implements Parcelable {
     }
 
     /**
-     * @return {@code true} if the IME is marked to be Encryption-Aware.
+     * @return {@code true} if the {@link android.inputmethodservice.InputMethodService} is marked
+     * to be Encryption-Aware.
      * @hide
      */
     public boolean isEncryptionAware() {
-        if (mService == null || mService.serviceInfo == null ||
-                mService.serviceInfo.applicationInfo == null) {
+        if (mService == null || mService.serviceInfo == null) {
             return false;
         }
-        return mService.serviceInfo.applicationInfo.isEncryptionAware();
+        return mService.serviceInfo.encryptionAware;
     }
 
     public void dump(Printer pw, String prefix) {
@@ -446,13 +446,6 @@ public final class InputMethodInfo implements Parcelable {
                 + " mSupportsSwitchingToNextInputMethod=" + mSupportsSwitchingToNextInputMethod);
         pw.println(prefix + "mIsDefaultResId=0x"
                 + Integer.toHexString(mIsDefaultResId));
-        if (mService != null && mService.serviceInfo != null &&
-                mService.serviceInfo.applicationInfo != null) {
-            pw.println(" encryptionAware=" +
-                    mService.serviceInfo.applicationInfo.isEncryptionAware());
-        } else {
-            pw.println(" encryptionAware=unknown");
-        }
         pw.println(prefix + "Service:");
         mService.dump(pw, prefix + "  ");
     }