OSDN Git Service

ContextWrapper should check before calling wrapped instance for autofill compat
authorSvet Ganov <svetoslavganov@google.com>
Thu, 15 Feb 2018 21:16:20 +0000 (13:16 -0800)
committerSvet Ganov <svetoslavganov@google.com>
Fri, 16 Feb 2018 04:36:34 +0000 (20:36 -0800)
Test: manual

bug:73339515

Change-Id: I22cb219d6efb581d63c86de961772d948a7546da

core/java/android/content/ContextWrapper.java

index a788989..b072ee6 100644 (file)
@@ -1000,7 +1000,7 @@ public class ContextWrapper extends Context {
      */
     @Override
     public boolean isAutofillCompatibilityEnabled() {
-        return mBase.isAutofillCompatibilityEnabled();
+        return mBase != null && mBase.isAutofillCompatibilityEnabled();
     }
 
     /**
@@ -1008,6 +1008,8 @@ public class ContextWrapper extends Context {
      */
     @Override
     public void setAutofillCompatibilityEnabled(boolean  autofillCompatEnabled) {
-        mBase.setAutofillCompatibilityEnabled(autofillCompatEnabled);
+        if (mBase != null) {
+            mBase.setAutofillCompatibilityEnabled(autofillCompatEnabled);
+        }
     }
 }