/frameworks/base/cmds/statsd/src/anomaly/ |
H A D | AlarmMonitor.cpp | 52 void AlarmMonitor::add(sp<const InternalAlarm> alarm) { argument 54 if (alarm == nullptr) { 55 ALOGW("Asked to add a null alarm."); 58 if (alarm->timestampSec < 1) { 59 // forbidden since a timestamp 0 is used to indicate no alarm registered 60 ALOGW("Asked to add a 0-time alarm."); 64 VLOG("Adding alarm with time %u", alarm->timestampSec); 65 mPq.push(alarm); 67 alarm 72 remove(sp<const InternalAlarm> alarm) argument [all...] |
H A D | DurationAnomalyTracker.cpp | 43 VLOG("Not setting anomaly alarm since it would fall in the refractory period."); 52 sp<const InternalAlarm> alarm = new InternalAlarm{timestampSec}; local 53 mAlarms[dimensionKey] = alarm; 55 mAlarmMonitor->add(alarm); 66 // If the alarm is set in the past but hasn't fired yet (due to lag), catch it now.
|
H A D | AlarmMonitor.h | 39 * Represents an alarm, associated with some aggregate metric, holding a 64 * @param minDiffToUpdateRegisteredAlarmTimeSec If the soonest alarm differs 65 * from the registered alarm by more than this amount, update the registered 66 * alarm. 75 * applicable, immediately registers an existing alarm with it. 82 * Adds the given alarm (reference) to the queue. 84 void add(sp<const InternalAlarm> alarm); 87 * Removes the given alarm (reference) from the queue. 88 * Note that alarm comparison is reference-based; if another alarm exist [all...] |
H A D | AlarmTracker.cpp | 35 const Alarm& alarm, const ConfigKey& configKey, 37 : mAlarmConfig(alarm), 42 // startMillis is the time statsd is created. We need to find the 1st alarm timestamp after 46 VLOG("AlarmTracker sets the periodic alarm at: %lld", (long long)mAlarmSec); 87 VLOG("AlarmTracker sets the periodic alarm at: %lld", (long long)mAlarmSec); 33 AlarmTracker(const int64_t startMillis, const int64_t currentMillis, const Alarm& alarm, const ConfigKey& configKey, const sp<AlarmMonitor>& alarmMonitor) argument
|
H A D | AlarmTracker.h | 39 const Alarm& alarm, const ConfigKey& configKey, 52 // For test only. Returns the alarm timestamp in seconds. Otherwise returns 0. 65 // The subscriptions that depend on this alarm. 71 // The current expected alarm time in seconds. 74 // The current alarm.
|
/frameworks/base/cmds/statsd/tests/e2e/ |
H A D | Alarm_e2e_test.cpp | 35 auto alarm = config.add_alarm(); local 36 alarm->set_id(123456); 37 alarm->set_offset_millis(TimeUnitToBucketSizeInMillis(TEN_MINUTES)); 38 alarm->set_period_millis(TimeUnitToBucketSizeInMillis(ONE_HOUR)); 40 alarm = config.add_alarm(); 41 alarm->set_id(654321); 42 alarm->set_offset_millis(TimeUnitToBucketSizeInMillis(FIVE_MINUTES)); 43 alarm->set_period_millis(TimeUnitToBucketSizeInMillis(THIRTY_MINUTES));
|
/frameworks/base/tests/utils/testutils/java/android/app/test/ |
H A D | TestAlarmManager.java | 36 * Creates an AlarmManager whose alarm dispatch can be controlled 37 * Currently only supports alarm listeners 64 * Dispatch a pending alarm with the given tag 65 * @return if any alarm was dispatched 69 PendingAlarm alarm = mPendingAlarms.get(i); 70 if (Objects.equals(tag, alarm.getTag())) { 72 alarm.dispatch(); 80 * @return if an alarm with the given tag is pending 84 PendingAlarm alarm = mPendingAlarms.get(i); 85 if (Objects.equals(tag, alarm [all...] |
/frameworks/base/cmds/statsd/tests/anomaly/ |
H A D | AlarmTracker_test.cpp | 39 Alarm alarm; local 40 alarm.set_offset_millis(15 * MS_PER_SEC); 41 alarm.set_period_millis(60 * 60 * MS_PER_SEC); // 1hr 43 AlarmTracker tracker(startMillis, startMillis, alarm, kConfigKey, subscriberAlarmMonitor);
|
/frameworks/base/services/core/java/com/android/server/ |
H A D | AlarmManagerService.java | 127 // Mask for testing whether a given alarm type is wakeup vs non-wakeup 221 * For each uid, this is the last time we dispatched an "allow while idle" alarm, 222 * used to determine the earliest we can dispatch the next such alarm. Times are in the 228 * For each uid, we store whether the last allow-while-idle alarm was dispatched while 314 // Minimum futurity of a new alarm 317 // Minimum alarm recurrence interval 320 // Maximum alarm recurrence interval 333 // Direct alarm listener callback timeout 376 Slog.e(TAG, "Bad alarm manager settings", e); 528 boolean add(Alarm alarm) { argument 557 remove(Alarm alarm) argument 777 insertAndBatchAlarmLocked(Alarm alarm) argument 1562 adjustDeliveryTimeBasedOnStandbyBucketLocked(Alarm alarm) argument 3025 isBackgroundRestricted(Alarm alarm) argument 4173 deliverLocked(Alarm alarm, long nowELAPSED, boolean allowWhileIdle) argument [all...] |
/frameworks/base/core/java/android/service/notification/ |
H A D | ScheduleCalendar.java | 44 * @return true if schedule will exit on alarm, else false 60 * Sets next alarm of the schedule if the saved next alarm has passed or is further 63 * @param nextAlarm time of next alarm in milliseconds 67 // alarm canceled 73 // store earliest alarm 138 * @param alarm milliseconds since Epoch 140 * @return true if alarm and now is within the schedule, else false 142 public boolean isAlarmInSchedule(long alarm, long now) { argument 144 final long start = getTime(alarm, mSchedul [all...] |
H A D | ZenModeConfig.java | 881 * Converts countdown to alarm parameters into a condition with user facing summary 883 public static Condition toNextAlarmCondition(Context context, long alarm, argument 885 boolean isSameDay = isToday(alarm); 886 final CharSequence formattedTime = getFormattedTime(context, alarm, isSameDay, userHandle); 889 final Uri id = toCountdownConditionId(alarm, true); 928 public static final String IS_ALARM_PATH = "alarm"; 933 public static Uri toCountdownConditionId(long time, boolean alarm) { argument 939 .appendPath(Boolean.toString(alarm)) 963 * Returns whether this condition is a countdown to an alarm. 974 Slog.w(TAG, "Error parsing countdown alarm conditio [all...] |
/frameworks/base/services/core/java/com/android/server/locksettings/ |
H A D | LockSettingsStrongAuth.java | 132 // cancel current alarm listener for the user (if there was one) 133 StrongAuthTimeoutAlarmListener alarm = mStrongAuthTimeoutAlarmListenerForUser.get(userId); 134 if (alarm != null) { 135 mAlarmManager.cancel(alarm); 137 alarm = new StrongAuthTimeoutAlarmListener(userId); 138 mStrongAuthTimeoutAlarmListenerForUser.put(userId, alarm); 140 // schedule a new alarm listener for the user 142 alarm, mHandler);
|
/frameworks/base/services/tests/uiservicestests/src/com/android/server/notification/ |
H A D | ScheduleCalendarTest.java | 225 mScheduleInfo.nextAlarm = 1000; // very old alarm 230 // don't exit for an alarm if it's an old alarm 259 mScheduleInfo.nextAlarm = calAlarm.getTimeInMillis(); // old alarm (5am day 2) 265 // don't exit for an alarm if it's an old alarm 408 Calendar alarm = new GregorianCalendar(); 409 alarm.set(Calendar.HOUR_OF_DAY, 23); 410 alarm.set(Calendar.MINUTE, 15); 411 alarm [all...] |
/frameworks/base/cmds/statsd/tests/metrics/ |
H A D | MaxDurationTracker_test.cpp | 281 sp<const InternalAlarm> alarm = anomalyTracker->mAlarms.begin()->second; local 282 EXPECT_EQ((long long)(53ULL * NS_PER_SEC), (long long)(alarm->timestampSec * NS_PER_SEC)); 284 // Remove the anomaly alarm when the duration is no longer fully met. 291 alarm = anomalyTracker->mAlarms.begin()->second; 292 EXPECT_EQ((long long)(63ULL * NS_PER_SEC), (long long)(alarm->timestampSec * NS_PER_SEC)); 346 auto alarm = anomalyTracker->mAlarms.begin()->second; local 347 int64_t anomalyFireTimeSec = alarm->timestampSec; 354 std::unordered_set<sp<const InternalAlarm>, SpHash<InternalAlarm>> firedAlarms({alarm}); 368 alarm = anomalyTracker->mAlarms.begin()->second; 369 EXPECT_EQ(refractoryPeriodEndsSec, (long long)(alarm 427 auto alarm = anomalyTracker->mAlarms.begin()->second; local [all...] |
H A D | OringDurationTracker_test.cpp | 457 // Test the alarm prediction works well when seeing another wakelock start event. 510 // The alarm is set to fire at 52s, and when it does, an anomaly would be declared. However, 511 // because this is a unit test, the alarm won't actually fire at all. Since the alarm fails 550 sp<const InternalAlarm> alarm = anomalyTracker->mAlarms.begin()->second; local 551 EXPECT_EQ((long long)(55ULL * NS_PER_SEC), (long long)(alarm->timestampSec * NS_PER_SEC)); 560 alarm = anomalyTracker->mAlarms.begin()->second; 561 EXPECT_EQ((long long)(60ULL * NS_PER_SEC), (long long)(alarm->timestampSec * NS_PER_SEC)); 566 alarm = anomalyTracker->mAlarms.begin()->second; 567 EXPECT_EQ((long long)(60ULL * NS_PER_SEC), (long long)(alarm [all...] |
/frameworks/base/services/core/java/com/android/server/notification/ |
H A D | CountdownConditionProvider.java | 131 // in the future, set an alarm 151 final boolean alarm = ZenModeConfig.isValidCountdownToAlarmConditionId(conditionId); 155 notifyCondition(newCondition(time, alarm, Condition.STATE_FALSE)); 161 private static final Condition newCondition(long time, boolean alarm, int state) { argument 162 return new Condition(ZenModeConfig.toCountdownConditionId(time, alarm),
|
/frameworks/base/cmds/statsd/src/metrics/ |
H A D | metrics_manager_util.cpp | 610 const Alarm& alarm = config.alarm(i); local 611 if (alarm.offset_millis() <= 0) { 615 if (alarm.period_millis() <= 0) { 619 alarmTrackerMap.insert(std::make_pair(alarm.id(), allAlarmTrackers.size())); 622 alarm, key, periodicAlarmMonitor));
|
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/ |
H A D | DemoStatusIcons.java | 129 String alarm = args.getString("alarm"); 130 if (alarm != null) { 131 int iconId = alarm.equals("show") ? R.drawable.stat_sys_alarm
|
H A D | PhoneStatusBarPolicy.java | 314 final AlarmClockInfo alarm = mAlarmManager.getNextAlarmClock(UserHandle.USER_CURRENT); 315 final boolean hasAlarm = alarm != null && alarm.getTriggerTime() > 0;
|
/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/notification/ |
H A D | EnableZenModeDialogTest.java | 96 Uri alarm = Condition.newId(mContext).appendPath("alarm").build(); 97 mAlarmCondition = new Condition(alarm, "alarm", "", "", 0, 0, 0); 163 // setup alarm 173 // alarm warning should be null 179 // setup alarm 191 // alarm warning should NOT be null
|
/frameworks/base/services/tests/servicestests/src/com/android/server/ |
H A D | AlarmManagerServiceTest.java | 85 alarmsToDeliver, alarm -> alarm.type == RTC_WAKEUP);
|
/frameworks/base/core/proto/android/providers/settings/ |
H A D | system.proto | 41 optional Alarm alarm = 3; 222 optional SettingProto alarm = 5 [ (android.privacy).dest = DEST_AUTOMATIC ];
|
/frameworks/base/cmds/statsd/src/ |
H A D | statsd_config.proto | 351 repeated Alarm alarm = 10;
|
/frameworks/base/core/proto/android/os/ |
H A D | incident.proto | 263 optional com.android.server.AlarmManagerServiceDumpProto alarm = 3016 [ 265 (section).args = "alarm --proto"
|
/frameworks/native/libs/binder/tests/ |
H A D | binderLibTest.cpp | 1165 alarm(10);
|