OSDN Git Service

Fix some config issues with sysui
authorJason Monk <jmonk@google.com>
Wed, 5 Jul 2017 16:20:10 +0000 (12:20 -0400)
committerJason Monk <jmonk@google.com>
Wed, 5 Jul 2017 16:38:50 +0000 (12:38 -0400)
It wasn't creating a delta so as soon as a change happened, it would
return true for any config changes.

Also StatusBar wasn't receiving config changes because the callback
was named wrong and SystemBars no longer passes it through.

Test: manual
Fixes: 62968485
Fixes: 62893293
Change-Id: I56750047168007edd0ca9ea35cb36c23dc790661

packages/SettingsLib/src/com/android/settingslib/applications/InterestingConfigChanges.java
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java

index e4e0f7f..c4cbc2b 100644 (file)
@@ -36,7 +36,8 @@ public class InterestingConfigChanges {
     }
 
     public boolean applyNewConfig(Resources res) {
-        int configChanges = mLastConfiguration.updateFrom(res.getConfiguration());
+        int configChanges = mLastConfiguration.updateFrom(
+                Configuration.generateDelta(mLastConfiguration, res.getConfiguration()));
         boolean densityChanged = mLastDensity != res.getDisplayMetrics().densityDpi;
         if (densityChanged || (configChanges & (mFlags)) != 0) {
             mLastDensity = res.getDisplayMetrics().densityDpi;
index bcba789..3c770eb 100644 (file)
@@ -3757,7 +3757,7 @@ public class StatusBar extends SystemUI implements DemoMode,
 
     // SystemUIService notifies SystemBars of configuration changes, which then calls down here
     @Override
-    protected void onConfigurationChanged(Configuration newConfig) {
+    public void onConfigChanged(Configuration newConfig) {
         updateResources();
         updateDisplaySize(); // populates mDisplayMetrics