Skip to content

Commit 9a7e4ce

Browse files
Jim MillerAndroid (Google) Code Review
authored andcommitted
Merge "Fix 5466678: use new setSystemUiVisibility() API to enable clock in statusbar" into ics-mr0
2 parents 7788c51 + 305c78c commit 9a7e4ce

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

core/java/android/app/StatusBarManager.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
17+
1818
package android.app;
1919

2020
import android.content.Context;
@@ -71,7 +71,9 @@ public class StatusBarManager {
7171
*/
7272
public void disable(int what) {
7373
try {
74-
mService.disable(what, mToken, mContext.getPackageName());
74+
if (mService != null) {
75+
mService.disable(what, mToken, mContext.getPackageName());
76+
}
7577
} catch (RemoteException ex) {
7678
// system process is dead anyway.
7779
throw new RuntimeException(ex);

policy/src/com/android/internal/policy/impl/KeyguardUpdateMonitor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ public void registerInfoCallback(InfoCallback callback) {
524524
callback.onRingerModeChanged(mRingMode);
525525
callback.onPhoneStateChanged(mPhoneState);
526526
callback.onRefreshCarrierInfo(mTelephonyPlmn, mTelephonySpn);
527+
callback.onClockVisibilityChanged();
527528
} else {
528529
if (DEBUG) Log.e(TAG, "Object tried to add another INFO callback",
529530
new Exception("Whoops"));

policy/src/com/android/internal/policy/impl/KeyguardViewManager.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ public synchronized void show() {
178178
int visFlags =
179179
( View.STATUS_BAR_DISABLE_BACK
180180
| View.STATUS_BAR_DISABLE_HOME
181-
| View.STATUS_BAR_DISABLE_CLOCK
182181
);
183182
mKeyguardHost.setSystemUiVisibility(visFlags);
184183

policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,8 +709,14 @@ public void onTimeChanged() {}
709709
public void onRefreshCarrierInfo(CharSequence plmn, CharSequence spn) {}
710710
@Override
711711
public void onRingerModeChanged(int state) {}
712+
712713
@Override
713-
public void onClockVisibilityChanged() {}
714+
public void onClockVisibilityChanged() {
715+
int visFlags = getSystemUiVisibility() & ~View.STATUS_BAR_DISABLE_CLOCK;
716+
setSystemUiVisibility(visFlags
717+
| (mUpdateMonitor.isClockVisible() ? View.STATUS_BAR_DISABLE_CLOCK : 0));
718+
}
719+
714720
@Override
715721
public void onDeviceProvisioned() {}
716722

0 commit comments

Comments
 (0)