OSDN Git Service

Handle subtext display problem in WifiWakeupPreferenceController
authorSunny Shao <sunnyshao@google.com>
Mon, 9 Sep 2019 03:00:41 +0000 (11:00 +0800)
committerSunny Shao <sunnyshao@google.com>
Mon, 9 Sep 2019 03:00:41 +0000 (11:00 +0800)
WifiWakeupPreferenceController subtext can't display location info subtext
when the "Use location" turn off. Now override the updateState and add the
refreshSummary in this api to fix the problem.

Bug: 132391311
Test: manual view
Change-Id: I5e85c1ae9b9393ee06f16a61d4be4a149adfdede

src/com/android/settings/wifi/WifiWakeupPreferenceController.java

index 98c6bae..75b714a 100644 (file)
@@ -116,6 +116,12 @@ public class WifiWakeupPreferenceController extends TogglePreferenceController i
     }
 
     @Override
+    public void updateState(Preference preference) {
+        super.updateState(preference);
+        refreshSummary(mPreference);
+    }
+
+    @Override
     public CharSequence getSummary() {
         if (!mLocationManager.isLocationEnabled()) {
             return getNoLocationSummary();