* commit '587ae8679d425bc18771a07622279c566e590db3': Next alarm clock updates.
This commit is contained in:
@@ -349,6 +349,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
|||||||
if (!mUserSetup && mStatusBarView != null)
|
if (!mUserSetup && mStatusBarView != null)
|
||||||
animateCollapseQuickSettings();
|
animateCollapseQuickSettings();
|
||||||
}
|
}
|
||||||
|
if (mIconPolicy != null) {
|
||||||
|
mIconPolicy.setCurrentUserSetup(mUserSetup);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -554,6 +557,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
|||||||
|
|
||||||
// Lastly, call to the icon policy to install/update all the icons.
|
// Lastly, call to the icon policy to install/update all the icons.
|
||||||
mIconPolicy = new PhoneStatusBarPolicy(mContext, mCastController, mHotspotController);
|
mIconPolicy = new PhoneStatusBarPolicy(mContext, mCastController, mHotspotController);
|
||||||
|
mIconPolicy.setCurrentUserSetup(mUserSetup);
|
||||||
mSettingsObserver.onChange(false); // set up
|
mSettingsObserver.onChange(false); // set up
|
||||||
|
|
||||||
mHeadsUpObserver.onChange(true); // set up
|
mHeadsUpObserver.onChange(true); // set up
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ package com.android.systemui.statusbar.phone;
|
|||||||
|
|
||||||
import android.app.ActivityManagerNative;
|
import android.app.ActivityManagerNative;
|
||||||
import android.app.AlarmManager;
|
import android.app.AlarmManager;
|
||||||
|
import android.app.AlarmManager.AlarmClockInfo;
|
||||||
import android.app.IUserSwitchObserver;
|
import android.app.IUserSwitchObserver;
|
||||||
import android.app.StatusBarManager;
|
import android.app.StatusBarManager;
|
||||||
import android.bluetooth.BluetoothAdapter;
|
import android.bluetooth.BluetoothAdapter;
|
||||||
@@ -75,6 +76,7 @@ public class PhoneStatusBarPolicy {
|
|||||||
|
|
||||||
private boolean mZenVisible;
|
private boolean mZenVisible;
|
||||||
private boolean mVolumeVisible;
|
private boolean mVolumeVisible;
|
||||||
|
private boolean mCurrentUserSetup;
|
||||||
|
|
||||||
private int mZen;
|
private int mZen;
|
||||||
|
|
||||||
@@ -175,11 +177,12 @@ public class PhoneStatusBarPolicy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateAlarm() {
|
private void updateAlarm() {
|
||||||
final boolean hasAlarm = mAlarmManager.getNextAlarmClock(UserHandle.USER_CURRENT) != null;
|
final AlarmClockInfo alarm = mAlarmManager.getNextAlarmClock(UserHandle.USER_CURRENT);
|
||||||
|
final boolean hasAlarm = alarm != null && alarm.getTriggerTime() > 0;
|
||||||
final boolean zenNone = mZen == Global.ZEN_MODE_NO_INTERRUPTIONS;
|
final boolean zenNone = mZen == Global.ZEN_MODE_NO_INTERRUPTIONS;
|
||||||
mService.setIconVisibility(SLOT_ALARM_CLOCK, hasAlarm);
|
|
||||||
mService.setIcon(SLOT_ALARM_CLOCK, zenNone ? R.drawable.stat_sys_alarm_dim
|
mService.setIcon(SLOT_ALARM_CLOCK, zenNone ? R.drawable.stat_sys_alarm_dim
|
||||||
: R.drawable.stat_sys_alarm, 0, null);
|
: R.drawable.stat_sys_alarm, 0, null);
|
||||||
|
mService.setIconVisibility(SLOT_ALARM_CLOCK, mCurrentUserSetup && hasAlarm);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final void updateSimState(Intent intent) {
|
private final void updateSimState(Intent intent) {
|
||||||
@@ -391,4 +394,10 @@ public class PhoneStatusBarPolicy {
|
|||||||
mKeyguardVisible = visible;
|
mKeyguardVisible = visible;
|
||||||
updateManagedProfile();
|
updateManagedProfile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setCurrentUserSetup(boolean userSetup) {
|
||||||
|
if (mCurrentUserSetup == userSetup) return;
|
||||||
|
mCurrentUserSetup = userSetup;
|
||||||
|
updateAlarm();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ import java.util.LinkedList;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
import java.util.TreeSet;
|
||||||
|
|
||||||
import static android.app.AlarmManager.RTC_WAKEUP;
|
import static android.app.AlarmManager.RTC_WAKEUP;
|
||||||
import static android.app.AlarmManager.RTC;
|
import static android.app.AlarmManager.RTC;
|
||||||
@@ -1055,6 +1056,28 @@ class AlarmManagerService extends SystemService {
|
|||||||
pw.print(" = "); pw.println(sdf.format(new Date(nextWakeupRTC)));
|
pw.print(" = "); pw.println(sdf.format(new Date(nextWakeupRTC)));
|
||||||
pw.print("Num time change events: "); pw.println(mNumTimeChanged);
|
pw.print("Num time change events: "); pw.println(mNumTimeChanged);
|
||||||
|
|
||||||
|
pw.println();
|
||||||
|
pw.println("Next alarm clock information: ");
|
||||||
|
final TreeSet<Integer> users = new TreeSet<>();
|
||||||
|
for (int i = 0; i < mNextAlarmClockForUser.size(); i++) {
|
||||||
|
users.add(mNextAlarmClockForUser.keyAt(i));
|
||||||
|
}
|
||||||
|
for (int i = 0; i < mPendingSendNextAlarmClockChangedForUser.size(); i++) {
|
||||||
|
users.add(mPendingSendNextAlarmClockChangedForUser.keyAt(i));
|
||||||
|
}
|
||||||
|
for (int user : users) {
|
||||||
|
final AlarmManager.AlarmClockInfo next = mNextAlarmClockForUser.get(user);
|
||||||
|
final long time = next != null ? next.getTriggerTime() : 0;
|
||||||
|
final boolean pendingSend = mPendingSendNextAlarmClockChangedForUser.get(user);
|
||||||
|
pw.print(" user:"); pw.print(user);
|
||||||
|
pw.print(" pendingSend:"); pw.print(pendingSend);
|
||||||
|
pw.print(" time:"); pw.print(time);
|
||||||
|
if (time > 0) {
|
||||||
|
pw.print(" = "); pw.print(sdf.format(new Date(time)));
|
||||||
|
pw.print(" = "); TimeUtils.formatDuration(time, nowRTC, pw);
|
||||||
|
}
|
||||||
|
pw.println();
|
||||||
|
}
|
||||||
if (mAlarmBatches.size() > 0) {
|
if (mAlarmBatches.size() > 0) {
|
||||||
pw.println();
|
pw.println();
|
||||||
pw.print("Pending alarm batches: ");
|
pw.print("Pending alarm batches: ");
|
||||||
|
|||||||
Reference in New Issue
Block a user