Home
last modified time | relevance | path

Searched refs:alarm (Results 1 – 25 of 105) sorted by relevance

12345

/packages/modules/Bluetooth/system/osi/src/
Dalarm.cc131 static void alarm_set_internal(alarm_t* alarm, uint64_t period_ms,
134 static void alarm_cancel_internal(alarm_t* alarm);
135 static void remove_pending_alarm(alarm_t* alarm);
136 static void schedule_next_instance(alarm_t* alarm);
185 void alarm_free(alarm_t* alarm) { in alarm_free() argument
186 if (!alarm) return; in alarm_free()
188 alarm_cancel(alarm); in alarm_free()
190 osi_free((void*)alarm->stats.name); in alarm_free()
191 alarm->closure.~CancelableClosureInStruct(); in alarm_free()
192 alarm->callback_mutex.reset(); in alarm_free()
[all …]
/packages/modules/Bluetooth/system/osi/test/
Dalarm_test.cc97 alarm_t* alarm = alarm_new("alarm_test.test_new_free_simple"); in TEST_F() local
98 ASSERT_TRUE(alarm != NULL); in TEST_F()
99 alarm_free(alarm); in TEST_F()
105 alarm_t* alarm = alarm_new("alarm_test.test_simple_cancel"); in TEST_F() local
106 alarm_cancel(alarm); in TEST_F()
107 alarm_free(alarm); in TEST_F()
111 alarm_t* alarm = alarm_new("alarm_test.test_cancel"); in TEST_F() local
112 alarm_set(alarm, 10, cb, NULL); in TEST_F()
113 alarm_cancel(alarm); in TEST_F()
119 alarm_free(alarm); in TEST_F()
[all …]
Dalarm_mock.h11 MOCK_METHOD4(AlarmSet, void(alarm_t* alarm, uint64_t interval_ms,
13 MOCK_METHOD4(AlarmSetOnMloop, void(alarm_t* alarm, uint64_t interval_ms,
25 void AlarmFreeImpl(alarm_t* alarm) { in AlarmFreeImpl() argument
26 uint8_t* ptr = (uint8_t*)alarm; in AlarmFreeImpl()
28 return AlarmFree(alarm); in AlarmFreeImpl()
50 void alarm_free(alarm_t* alarm) { AlarmMock::Get()->AlarmFreeImpl(alarm); } in alarm_free() argument
52 void alarm_set_on_mloop(alarm_t* alarm, uint64_t interval_ms, in alarm_set_on_mloop() argument
54 AlarmMock::Get()->AlarmSetOnMloop(alarm, interval_ms, cb, data); in alarm_set_on_mloop()
57 void alarm_set(alarm_t* alarm, uint64_t interval_ms, alarm_callback_t cb, in alarm_set() argument
59 AlarmMock::Get()->AlarmSet(alarm, interval_ms, cb, data); in alarm_set()
[all …]
/packages/apps/DeskClock/src/com/android/deskclock/alarms/
DAlarmTimeClickHandler.kt71 fun setAlarmEnabled(alarm: Alarm, newState: Boolean) { in setAlarmEnabled()
72 if (newState != alarm.enabled) { in setAlarmEnabled()
73 alarm.enabled = newState in setAlarmEnabled()
76 mAlarmUpdateHandler.asyncUpdateAlarm(alarm, alarm.enabled, minorUpdate = false) in setAlarmEnabled()
81 fun setAlarmVibrationEnabled(alarm: Alarm, newState: Boolean) { in setAlarmVibrationEnabled()
82 if (newState != alarm.vibrate) { in setAlarmVibrationEnabled()
83 alarm.vibrate = newState in setAlarmVibrationEnabled()
85 mAlarmUpdateHandler.asyncUpdateAlarm(alarm, popToast = false, minorUpdate = true) in setAlarmVibrationEnabled()
98 fun setAlarmRepeatEnabled(alarm: Alarm, isEnabled: Boolean) { in setAlarmRepeatEnabled()
100 val oldNextAlarmTime = alarm.getNextAlarmTime(now) in setAlarmRepeatEnabled()
[all …]
DAlarmUpdateHandler.kt56 fun asyncAddAlarm(alarm: Alarm?) { in <lambda>()
60 if (alarm != null) { in <lambda>()
65 val newAlarm = Alarm.addAlarm(cr, alarm) in <lambda>()
96 alarm: Alarm, in <lambda>()
106 Alarm.updateAlarm(cr, alarm) in <lambda>()
109 val instanceList = AlarmInstance.getInstancesByAlarmId(cr, alarm.id) in <lambda>()
115 newInstance.mVibrate = alarm.vibrate in <lambda>()
116 newInstance.mRingtone = alarm.alert in <lambda>()
117 newInstance.mLabel = alarm.label in <lambda>()
128 AlarmStateManager.deleteAllInstances(mAppContext, alarm.id) in <lambda>()
[all …]
DAlarmStateManager.kt307 val alarm = Alarm.getAlarm(cr, instance.mAlarmId!!) in <lambda>() constant
308 if (alarm == null) { in <lambda>()
313 if (!alarm.daysOfWeek.isRepeating) { in <lambda>()
314 if (alarm.deleteAfterUse) { in <lambda>()
315 LogUtils.i("Deleting parent alarm: " + alarm.id) in <lambda>()
316 Alarm.deleteAlarm(cr, alarm.id) in <lambda>()
318 LogUtils.i("Disabling parent alarm: " + alarm.id) in <lambda>()
319 alarm.enabled = false in <lambda>()
320 Alarm.updateAlarm(cr, alarm) in <lambda>()
326 var nextRepeatedInstance = alarm.createInstanceAfter(currentTime) in <lambda>()
[all …]
/packages/modules/Bluetooth/system/test/mock/
Dmock_osi_alarm.h43 std::function<void(alarm_t* alarm)> body{[](alarm_t* /* alarm */) {}};
44 void operator()(alarm_t* alarm) { body(alarm); }; in operator()
70 std::function<void(alarm_t* alarm)> body{[](alarm_t* /* alarm */) {}};
71 void operator()(alarm_t* alarm) { body(alarm); }; in operator()
80 std::function<uint64_t(const alarm_t* alarm)> body{
82 uint64_t operator()(const alarm_t* alarm) { return body(alarm); }; in operator()
91 std::function<bool(const alarm_t* alarm)> body{
93 bool operator()(const alarm_t* alarm) { return body(alarm); }; in operator()
123 std::function<void(alarm_t* alarm, uint64_t interval_ms, alarm_callback_t cb,
127 void operator()(alarm_t* alarm, uint64_t interval_ms, alarm_callback_t cb, in operator()
[all …]
Dmock_osi_alarm.cc53 void alarm_cancel(alarm_t* alarm) { in alarm_cancel() argument
55 test::mock::osi_alarm::alarm_cancel(alarm); in alarm_cancel()
65 void alarm_free(alarm_t* alarm) { in alarm_free() argument
67 test::mock::osi_alarm::alarm_free(alarm); in alarm_free()
69 uint64_t alarm_get_remaining_ms(const alarm_t* alarm) { in alarm_get_remaining_ms() argument
71 return test::mock::osi_alarm::alarm_get_remaining_ms(alarm); in alarm_get_remaining_ms()
73 bool alarm_is_scheduled(const alarm_t* alarm) { in alarm_is_scheduled() argument
75 return test::mock::osi_alarm::alarm_is_scheduled(alarm); in alarm_is_scheduled()
85 void alarm_set(alarm_t* alarm, uint64_t interval_ms, alarm_callback_t cb, in alarm_set() argument
88 test::mock::osi_alarm::alarm_set(alarm, interval_ms, cb, data); in alarm_set()
[all …]
/packages/modules/Bluetooth/system/osi/test/fuzzers/alarm/
Dfuzz_alarm.cc91 bool fuzz_set_alarm(alarm_t* alarm, uint64_t interval, alarm_callback_t cb, in fuzz_set_alarm() argument
107 if (alarm) { in fuzz_set_alarm()
110 alarm_set_on_mloop(alarm, interval, cb, data_buffer); in fuzz_set_alarm()
112 alarm_set(alarm, interval, cb, data_buffer); in fuzz_set_alarm()
126 alarm_t* alarm = nullptr; in LLVMFuzzerTestOneInput() local
130 alarm = fuzz_init_alarm(&dataProvider); in LLVMFuzzerTestOneInput()
135 if (alarm) { in LLVMFuzzerTestOneInput()
136 if (!fuzz_set_alarm(alarm, MAX_ALARM_DURATION, cb, &dataProvider)) { in LLVMFuzzerTestOneInput()
137 alarm_free(alarm); in LLVMFuzzerTestOneInput()
140 alarm_cancel(alarm); in LLVMFuzzerTestOneInput()
[all …]
/packages/apps/DeskClock/src/com/android/deskclock/alarms/dataadapter/
DAlarmItemViewHolder.kt58 val alarm = itemHolder.item in <lambda>() constant
59 bindOnOffSwitch(alarm) in <lambda>()
60 bindClock(alarm) in <lambda>()
63 alarm.getLabelOrDefault(context)) in <lambda>()
66 protected fun bindOnOffSwitch(alarm: Alarm) { in <lambda>()
67 if (onOff.isChecked() != alarm.enabled) { in <lambda>()
68 onOff.isChecked = alarm.enabled in <lambda>()
72 protected fun bindClock(alarm: Alarm) { in <lambda>()
73 clock.setTime(alarm.hour, alarm.minutes) in <lambda>()
74 clock.alpha = if (alarm.enabled) CLOCK_ENABLED_ALPHA else CLOCK_DISABLED_ALPHA in <lambda>()
[all …]
DCollapsedAlarmViewHolder.kt76 val alarm = itemHolder.item in <lambda>() constant
79 bindRepeatText(context, alarm) in <lambda>()
80 bindReadOnlyLabel(context, alarm) in <lambda>()
81 bindUpcomingInstance(context, alarm) in <lambda>()
82 bindPreemptiveDismissButton(context, alarm, alarmInstance) in <lambda>()
85 private fun bindReadOnlyLabel(context: Context, alarm: Alarm) { in <lambda>()
86 if (!alarm.label.isNullOrEmpty()) { in <lambda>()
87 alarmLabel.text = alarm.label in <lambda>()
90 .toString() + " " + alarm.label) in <lambda>()
96 private fun bindRepeatText(context: Context, alarm: Alarm) { in <lambda>()
[all …]
DExpandedAlarmViewHolder.kt145 val alarm = itemHolder.item in <lambda>() constant
148 bindEditLabel(context, alarm) in <lambda>()
149 bindDaysOfWeekButtons(alarm, context) in <lambda>()
150 bindVibrator(alarm) in <lambda>()
151 bindRingtone(context, alarm) in <lambda>()
152 bindPreemptiveDismissButton(context, alarm, alarmInstance) in <lambda>()
155 private fun bindRingtone(context: Context, alarm: Alarm) { in <lambda>()
156 val title = DataModel.dataModel.getRingtoneTitle(alarm.alert!!) in <lambda>()
162 val silent: Boolean = Utils.RINGTONE_SILENT == alarm.alert in <lambda>()
168 private fun bindDaysOfWeekButtons(alarm: Alarm, context: Context) { in <lambda>()
[all …]
/packages/modules/StatsD/statsd/src/anomaly/
DAlarmMonitor.cpp54 void AlarmMonitor::add(const sp<const InternalAlarm>& alarm) { in add() argument
56 if (alarm == nullptr) { in add()
60 if (alarm->timestampSec < 1) { in add()
66 VLOG("Adding alarm with time %u", alarm->timestampSec); in add()
67 mPq.push(alarm); in add()
69 alarm->timestampSec + mMinUpdateTimeSec < mRegisteredAlarmTimeSec) { in add()
70 updateRegisteredAlarmTime_l(alarm->timestampSec); in add()
74 void AlarmMonitor::remove(const sp<const InternalAlarm>& alarm) { in remove() argument
76 if (alarm == nullptr) { in remove()
80 VLOG("Removing alarm with time %u", alarm->timestampSec); in remove()
[all …]
/packages/apps/DeskClock/src/com/android/deskclock/provider/
DAlarm.kt320 fun createContentValues(alarm: Alarm): ContentValues { in createContentValues()
322 if (alarm.id != INVALID_ID) { in createContentValues()
323 values.put(BaseColumns._ID, alarm.id) in createContentValues()
326 values.put(AlarmsColumns.ENABLED, if (alarm.enabled) 1 else 0) in createContentValues()
327 values.put(AlarmsColumns.HOUR, alarm.hour) in createContentValues()
328 values.put(AlarmsColumns.MINUTES, alarm.minutes) in createContentValues()
329 values.put(AlarmsColumns.DAYS_OF_WEEK, alarm.daysOfWeek.bits) in createContentValues()
330 values.put(AlarmSettingColumns.VIBRATE, if (alarm.vibrate) 1 else 0) in createContentValues()
331 values.put(AlarmSettingColumns.LABEL, alarm.label) in createContentValues()
332 values.put(AlarmsColumns.DELETE_AFTER_USE, alarm.deleteAfterUse) in createContentValues()
[all …]
DClockDatabaseHelper.kt96 val alarm = Alarm() in onUpgrade() constant
97 alarm.id = cursor.getLong(0) in onUpgrade()
98 alarm.hour = cursor.getInt(1) in onUpgrade()
99 alarm.minutes = cursor.getInt(2) in onUpgrade()
100 alarm.daysOfWeek = Weekdays.fromBits(cursor.getInt(3)) in onUpgrade()
101 alarm.enabled = cursor.getInt(4) == 1 in onUpgrade()
102 alarm.vibrate = cursor.getInt(5) == 1 in onUpgrade()
103 alarm.label = cursor.getString(6) in onUpgrade()
107 alarm.alert = AlarmSettingColumns.NO_RINGTONE_URI in onUpgrade()
109 alarm.alert = if (TextUtils.isEmpty(alertString)) { in onUpgrade()
[all …]
/packages/apps/DeskClock/src/com/android/deskclock/
DHandleApiCalls.kt158 for (alarm in matchingAlarms) { in doInBackground() constant
159 dismissAlarm(alarm, mActivity) in doInBackground()
160 LOGGER.i("Alarm dismissed: $alarm") in doInBackground()
259 val alarm: Alarm in handleSetAlarm() constant
262 alarm = alarms[0] in handleSetAlarm()
263 alarm.enabled = true in handleSetAlarm()
264 Alarm.updateAlarm(cr, alarm) in handleSetAlarm()
267 AlarmStateManager.deleteAllInstances(this, alarm.id) in handleSetAlarm()
270 LOGGER.i("Updated alarm: $alarm") in handleSetAlarm()
273 alarm = Alarm() in handleSetAlarm()
[all …]
DFetchMatchingAlarmsAction.kt82 for (alarm in mAlarms) { in run() constant
83 if (alarm.hour == hour24 && alarm.minutes == minutes) { in run()
84 mMatchingAlarms.add(alarm) in run()
95 for (alarm in mAlarms) { in run() constant
96 val alarmInstance = AlarmInstance.getNextUpcomingInstanceByAlarmId(cr, alarm.id) in run()
99 mMatchingAlarms.add(alarm) in run()
131 for (alarm in mAlarms) { in run() constant
132 if (alarm.label!!.contains(label)) { in run()
133 mMatchingAlarms.add(alarm) in run()
DAlarmSelectionActivity.kt58 val alarm = parcelable as Alarm in onCreate() constant
61 val label = String.format(Locale.US, "%d %02d", alarm.hour, alarm.minutes) in onCreate()
62 mSelections.add(AlarmSelection(label, alarm)) in onCreate()
72 val alarm: Alarm? = selection.alarm in onListItemClick() constant
73 alarm?.let { in onListItemClick()
/packages/modules/StatsD/statsd/tests/e2e/
DAlarm_e2e_test.cpp34 auto alarm = config.add_alarm(); in CreateStatsdConfig() local
35 alarm->set_id(123456); in CreateStatsdConfig()
36 alarm->set_offset_millis(TimeUnitToBucketSizeInMillis(TEN_MINUTES)); in CreateStatsdConfig()
37 alarm->set_period_millis(TimeUnitToBucketSizeInMillis(ONE_HOUR)); in CreateStatsdConfig()
39 alarm = config.add_alarm(); in CreateStatsdConfig()
40 alarm->set_id(654321); in CreateStatsdConfig()
41 alarm->set_offset_millis(TimeUnitToBucketSizeInMillis(FIVE_MINUTES)); in CreateStatsdConfig()
42 alarm->set_period_millis(TimeUnitToBucketSizeInMillis(THIRTY_MINUTES)); in CreateStatsdConfig()
/packages/apps/DeskClock/src/com/android/deskclock/widget/selector/
DAlarmSelectionAdapter.kt47 val alarm = selection?.alarm in getView() constant
50 alarmTime.setTime(alarm!!.hour, alarm.minutes) in getView()
53 alarmLabel.text = alarm.label in getView()
57 daysOfWeek = if (!alarm.daysOfWeek.isRepeating) { in getView()
58 if (Alarm.isTomorrow(alarm, Calendar.getInstance())) { in getView()
65 alarm.daysOfWeek.toString(context, weekdayOrder) in getView()
/packages/modules/Bluetooth/system/gd/rust/linux/mgmt/src/
Dtime.rs63 let alarm = Alarm::new(); in alarm_cancel_after_expired() localVariable
64 alarm.reset(Duration::from_millis(10)); in alarm_cancel_after_expired()
66 alarm.reset(Duration::from_millis(0)); in alarm_cancel_after_expired()
74 _ = alarm.expired() => (), in alarm_cancel_after_expired()
87 let alarm = Alarm::new(); in alarm_clear_ready_after_expired() localVariable
88 alarm.reset(Duration::from_millis(10)); in alarm_clear_ready_after_expired()
89 alarm.expired().await; in alarm_clear_ready_after_expired()
94 _ = alarm.expired() => (), in alarm_clear_ready_after_expired()
/packages/modules/Bluetooth/system/osi/include/
Dalarm.h53 void alarm_free(alarm_t* alarm);
73 void alarm_set(alarm_t* alarm, uint64_t interval_ms, alarm_callback_t cb,
79 void alarm_set_on_mloop(alarm_t* alarm, uint64_t interval_ms,
87 void alarm_cancel(alarm_t* alarm);
91 bool alarm_is_scheduled(const alarm_t* alarm);
96 uint64_t alarm_get_remaining_ms(const alarm_t* alarm);
/packages/modules/Bluetooth/system/gd/rust/common/src/
Dtime.rs121 let alarm = Alarm::new(); in alarm_cancel_after_expired() localVariable
122 alarm.reset(Duration::from_millis(10)); in alarm_cancel_after_expired()
124 alarm.cancel(); in alarm_cancel_after_expired()
132 _ = alarm.expired() => (), in alarm_cancel_after_expired()
146 let alarm = Alarm::new(); in alarm_clear_ready_after_expired() localVariable
147 alarm.reset(Duration::from_millis(10)); in alarm_clear_ready_after_expired()
148 alarm.expired().await; in alarm_clear_ready_after_expired()
153 _ = alarm.expired() => (), in alarm_clear_ready_after_expired()
/packages/modules/IPsec/tests/iketests/src/java/com/android/internal/net/ipsec/ike/utils/
DIkeAlarmTest.java66 IkeAlarm alarm = IkeAlarm.newExactAlarm(mAlarmConfig, mMockDeps); in testNewExactAlarm() local
67 assertTrue(alarm instanceof IkeAlarmWithListener); in testNewExactAlarm()
74 IkeAlarm alarm = IkeAlarm.newExactAndAllowWhileIdleAlarm(mAlarmConfig, mMockDeps); in testNewExactAndAllowWhileIdleAlarmWithSystemUid() local
75 assertTrue(alarm instanceof IkeAlarmWithListener); in testNewExactAndAllowWhileIdleAlarmWithSystemUid()
82 IkeAlarm alarm = IkeAlarm.newExactAndAllowWhileIdleAlarm(mAlarmConfig, mMockDeps); in testNewExactAndAllowWhileIdleAlarmWithNonSystemUid() local
83 assertTrue(alarm instanceof IkeAlarmWithPendingIntent); in testNewExactAndAllowWhileIdleAlarmWithNonSystemUid()
/packages/modules/Connectivity/nearby/tests/unit/src/com/android/server/nearby/common/
DCancelableAlarmTest.java56 CancelableAlarm alarm = in canceledAlarmDoesNotRun_singleExecution() local
62 assertThat(alarm.cancel()).isTrue(); in canceledAlarmDoesNotRun_singleExecution()
69 CancelableAlarm alarm = in canceledAlarmDoesNotRun_periodicExecution() local
76 assertThat(alarm.cancel()).isTrue(); in canceledAlarmDoesNotRun_periodicExecution()
84 CancelableAlarm alarm = in cancelOfRunAlarmReturnsFalse() local
92 assertThat(alarm.cancel()).isFalse(); in cancelOfRunAlarmReturnsFalse()

12345