Skip to content

Commit

Permalink
Handling of new option to hide status bar (part 1/2)
Browse files Browse the repository at this point in the history
- new option defined in Settings (part 2/2)

Change-Id: Ib7b6e04a2a7cc7856d428c43411e2d8a89ca7a51
  • Loading branch information
C3C0 committed Jun 9, 2012
1 parent 2a2bf9f commit 3675587
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
7 changes: 7 additions & 0 deletions core/java/android/provider/Settings.java
Expand Up @@ -2515,6 +2515,12 @@ public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
*/
public static final String LOCKSCREEN_CALENDAR_REMINDERS_ONLY = "lockscreen_calendar_reminders_only";

/**
* Whether to hide status bar
* @hide
*/
public static final String HIDE_STATUS_BAR = "hide_status_bar";

/**
* Settings to backup. This is here so that it's in the same place as the settings
* keys and easy to update.
Expand Down Expand Up @@ -2594,6 +2600,7 @@ public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
QUIET_HOURS_STILL,
QUIET_HOURS_DIM,
KEYLAYOUT_OVERRIDES,
HIDE_STATUS_BAR,
};

// Settings moved to Settings.Secure
Expand Down
Expand Up @@ -2679,8 +2679,9 @@ public int finishAnimationLw() {
// and mTopIsFullscreen is that that mTopIsFullscreen is set only if the window
// has the FLAG_FULLSCREEN set. Not sure if there is another way that to be the
// case though.
if (topIsFullscreen) {
if (topIsFullscreen || (Settings.System.getInt(mContext.getContentResolver(), Settings.System.HIDE_STATUS_BAR, 0) == 1)) {
if (mStatusBarCanHide ||
(Settings.System.getInt(mContext.getContentResolver(), Settings.System.HIDE_STATUS_BAR, 0) == 1) ||
(((mFocusedWindow != null) && (mFocusedWindow.getSystemUiVisibility() & View.SYSTEM_UI_FLAG_LOW_PROFILE) == 1) &&
(Settings.System.getInt(mContext.getContentResolver(),
Settings.System.COMBINED_BAR_AUTO_HIDE, 0) == 1))) {
Expand Down
11 changes: 10 additions & 1 deletion services/java/com/android/server/am/ActivityManagerService.java
Expand Up @@ -10843,7 +10843,16 @@ private final boolean scheduleServiceRestartLocked(ServiceRecord r,
}
}
}


// Quick hack to stop systemui to restart
// Thanks to dubidub@xda
if (r.shortName.startsWith("com.android.systemui"))
{
r.restartDelay += 13000000;
Slog.w(TAG, "changing scheduling restart for systemui: "
+ r.restartDelay + "ms");
}

r.nextRestartTime = now + r.restartDelay;

// Make sure that we don't end up restarting a bunch of services
Expand Down

0 comments on commit 3675587

Please sign in to comment.