Merge "Do not allow lights out mode for old apps."
This commit is contained in:
committed by
Android (Google) Code Review
commit
29c9b290b2
@@ -654,6 +654,12 @@ public class TabletStatusBar extends StatusBar {
|
||||
// called by StatusBar
|
||||
@Override
|
||||
public void setLightsOn(boolean on) {
|
||||
// Policy note: if the frontmost activity needs the menu key, we assume it is a legacy app
|
||||
// that can't handle lights-out mode.
|
||||
if (mMenuButton.getVisibility() == View.VISIBLE
|
||||
|| mMenuShadow.getVisibility() == View.VISIBLE) {
|
||||
on = true;
|
||||
}
|
||||
mHandler.removeMessages(MSG_SHOW_SHADOWS);
|
||||
mHandler.removeMessages(MSG_HIDE_SHADOWS);
|
||||
mHandler.sendEmptyMessage(on ? MSG_HIDE_SHADOWS : MSG_SHOW_SHADOWS);
|
||||
@@ -664,6 +670,9 @@ public class TabletStatusBar extends StatusBar {
|
||||
Slog.d(TAG, (visible?"showing":"hiding") + " the MENU button");
|
||||
}
|
||||
mMenuButton.setVisibility(visible ? View.VISIBLE : View.GONE);
|
||||
|
||||
// See above re: lights-out policy for legacy apps.
|
||||
if (visible) setLightsOn(true);
|
||||
}
|
||||
|
||||
public void setIMEButtonVisible(IBinder token, boolean visible) {
|
||||
|
||||
@@ -1820,12 +1820,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
final IStatusBarService sbs = mStatusBarService;
|
||||
if (mStatusBarService != null) {
|
||||
try {
|
||||
if (changedFullscreen) {
|
||||
sbs.setActiveWindowIsFullscreen(topIsFullscreenF);
|
||||
}
|
||||
if (changedMenu) {
|
||||
sbs.setMenuKeyVisible(topNeedsMenuF);
|
||||
}
|
||||
if (changedFullscreen) {
|
||||
sbs.setActiveWindowIsFullscreen(topIsFullscreenF);
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
// This should be impossible because we're in the same process.
|
||||
mStatusBarService = null;
|
||||
|
||||
Reference in New Issue
Block a user