diff options
author | Daniel Sandler <dsandler@android.com> | 2012-12-03 12:33:41 -0500 |
---|---|---|
committer | Daniel Sandler <dsandler@android.com> | 2012-12-03 12:59:26 -0500 |
commit | 0f92a8083d6f6a0d5827c6688599456edb27dcd0 (patch) | |
tree | 267c2c52d00e5ac79d0cf924eca77cc7df55e507 /packages | |
parent | bf0e106a7d755355d7ff53a2b319e2e91c154641 (diff) | |
download | frameworks_base-0f92a8083d6f6a0d5827c6688599456edb27dcd0.zip frameworks_base-0f92a8083d6f6a0d5827c6688599456edb27dcd0.tar.gz frameworks_base-0f92a8083d6f6a0d5827c6688599456edb27dcd0.tar.bz2 |
Show alarm tile for the current user.
We were already refreshing the tile on user switch, but we
were only pulling the information (and observing changes)
for the owner.
Bug: 7596329
Change-Id: I33959af405bc79037b5b1321631d993bea65772f
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java index ec42883..00991c1 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java @@ -121,7 +121,8 @@ class QuickSettingsModel implements BluetoothStateChangeCallback, public void startObserving() { final ContentResolver cr = mContext.getContentResolver(); cr.registerContentObserver( - Settings.System.getUriFor(Settings.System.NEXT_ALARM_FORMATTED), false, this); + Settings.System.getUriFor(Settings.System.NEXT_ALARM_FORMATTED), false, this, + UserHandle.USER_ALL); } } @@ -311,8 +312,15 @@ class QuickSettingsModel implements BluetoothStateChangeCallback, mAlarmCallback.refreshView(mAlarmTile, mAlarmState); } void onNextAlarmChanged() { - mAlarmState.label = Settings.System.getString(mContext.getContentResolver(), - Settings.System.NEXT_ALARM_FORMATTED); + final String alarmText = Settings.System.getStringForUser(mContext.getContentResolver(), + Settings.System.NEXT_ALARM_FORMATTED, + UserHandle.USER_CURRENT); + mAlarmState.label = alarmText; + + // When switching users, this is the only clue we're going to get about whether the + // alarm is actually set, since we won't get the ACTION_ALARM_CHANGED broadcast + mAlarmState.enabled = ! TextUtils.isEmpty(alarmText); + mAlarmCallback.refreshView(mAlarmTile, mAlarmState); } |