Merge "Only dispatch systemUiVisibility when it actually changes" into mnc-dev
This commit is contained in:
@@ -312,6 +312,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
// tracking calls to View.setSystemUiVisibility()
|
||||
int mSystemUiVisibility = View.SYSTEM_UI_FLAG_VISIBLE;
|
||||
|
||||
// last value sent to window manager
|
||||
private int mLastDispatchedSystemUiVisibility = ~View.SYSTEM_UI_FLAG_VISIBLE;
|
||||
|
||||
DisplayMetrics mDisplayMetrics = new DisplayMetrics();
|
||||
|
||||
// XXX: gesture research
|
||||
@@ -2481,7 +2484,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
|
||||
private void notifyUiVisibilityChanged(int vis) {
|
||||
try {
|
||||
mWindowManagerService.statusBarVisibilityChanged(vis);
|
||||
if (mLastDispatchedSystemUiVisibility != vis) {
|
||||
mWindowManagerService.statusBarVisibilityChanged(vis);
|
||||
mLastDispatchedSystemUiVisibility = vis;
|
||||
}
|
||||
} catch (RemoteException ex) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -512,7 +512,10 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
|
||||
int mLayoutSeq = 0;
|
||||
|
||||
// Last systemUiVisibility we received from status bar.
|
||||
int mLastStatusBarVisibility = 0;
|
||||
// Last systemUiVisibility we dispatched to windows.
|
||||
int mLastDispatchedSystemUiVisibility = 0;
|
||||
|
||||
// State while inside of layoutAndPlaceSurfacesLocked().
|
||||
boolean mFocusMayChange;
|
||||
@@ -10955,6 +10958,10 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
|
||||
// TOOD(multidisplay): StatusBar on multiple screens?
|
||||
void updateStatusBarVisibilityLocked(int visibility) {
|
||||
if (mLastDispatchedSystemUiVisibility == visibility) {
|
||||
return;
|
||||
}
|
||||
mLastDispatchedSystemUiVisibility = visibility;
|
||||
mInputManager.setSystemUiVisibility(visibility);
|
||||
final WindowList windows = getDefaultWindowListLocked();
|
||||
final int N = windows.size();
|
||||
|
||||
Reference in New Issue
Block a user