/packages/apps/DeskClock/src/com/android/deskclock/data/ |
D | TimerModel.kt | 42 import com.android.deskclock.timer.TimerKlaxon 43 import com.android.deskclock.timer.TimerService 155 for (timer in mutableTimers) { in getTimer() method 156 if (timer.id == timerId) { in getTimer() 157 return timer in getTimer() 182 var timer = in addTimer() variable 187 timer = TimerDAO.addTimer(mPrefs, timer) in addTimer() 190 mutableTimers.add(0, timer) in addTimer() 198 timerListener.timerAdded(timer) in addTimer() 201 return timer in addTimer() [all …]
|
D | TimerModel.java | 42 import com.android.deskclock.timer.TimerKlaxon; 43 import com.android.deskclock.timer.TimerService; 191 for (Timer timer : getMutableTimers()) { in getTimer() 192 if (timer.getId() == timerId) { in getTimer() 193 return timer; in getTimer() 217 Timer timer = new Timer(-1, RESET, length, length, Timer.UNUSED, Timer.UNUSED, length, in addTimer() local 221 timer = TimerDAO.addTimer(mPrefs, timer); in addTimer() 224 getMutableTimers().add(0, timer); in addTimer() 232 timerListener.timerAdded(timer); in addTimer() 235 return timer; in addTimer() [all …]
|
D | TimerDAO.kt | 93 fun addTimer(prefs: SharedPreferences, timer: Timer): Timer { in addTimer() 106 editor.putInt(STATE + id, timer.state.value) in addTimer() 107 editor.putLong(LENGTH + id, timer.length) in addTimer() 108 editor.putLong(TOTAL_LENGTH + id, timer.totalLength) in addTimer() 109 editor.putLong(LAST_START_TIME + id, timer.lastStartTime) in addTimer() 110 editor.putLong(LAST_WALL_CLOCK_TIME + id, timer.lastWallClockTime) in addTimer() 111 editor.putLong(REMAINING_TIME + id, timer.remainingTime) in addTimer() 112 editor.putString(LABEL + id, timer.label) in addTimer() 113 editor.putBoolean(DELETE_AFTER_USE + id, timer.deleteAfterUse) in addTimer() 118 return Timer(id, timer.state, timer.length, timer.totalLength, in addTimer() [all …]
|
D | TimerDAO.java | 105 static Timer addTimer(SharedPreferences prefs, Timer timer) { in addTimer() argument 118 editor.putInt(STATE + id, timer.getState().getValue()); in addTimer() 119 editor.putLong(LENGTH + id, timer.getLength()); in addTimer() 120 editor.putLong(TOTAL_LENGTH + id, timer.getTotalLength()); in addTimer() 121 editor.putLong(LAST_START_TIME + id, timer.getLastStartTime()); in addTimer() 122 editor.putLong(LAST_WALL_CLOCK_TIME + id, timer.getLastWallClockTime()); in addTimer() 123 editor.putLong(REMAINING_TIME + id, timer.getRemainingTime()); in addTimer() 124 editor.putString(LABEL + id, timer.getLabel()); in addTimer() 125 editor.putBoolean(DELETE_AFTER_USE + id, timer.getDeleteAfterUse()); in addTimer() 130 return new Timer(id, timer.getState(), timer.getLength(), timer.getTotalLength(), in addTimer() [all …]
|
D | TimerNotificationBuilder.kt | 45 import com.android.deskclock.timer.ExpiredTimersActivity 46 import com.android.deskclock.timer.TimerService 64 val timer = unexpired[0] in build() constant 68 val running = timer.isRunning in build() 71 val base = getChronometerBase(timer) in build() 80 stateText = if (timer.label.isNullOrEmpty()) { in build() 83 timer.label in build() 89 .putExtra(TimerService.EXTRA_TIMER_ID, timer.id) in build() 99 .putExtra(TimerService.EXTRA_TIMER_ID, timer.id) in build() 112 .putExtra(TimerService.EXTRA_TIMER_ID, timer.id) in build() [all …]
|
D | TimerNotificationBuilder.java | 44 import com.android.deskclock.timer.ExpiredTimersActivity; 45 import com.android.deskclock.timer.TimerService; 64 final Timer timer = unexpired.get(0); in build() local 68 final boolean running = timer.isRunning(); in build() 71 final long base = getChronometerBase(timer); in build() 80 if (TextUtils.isEmpty(timer.getLabel())) { in build() 83 stateText = timer.getLabel(); in build() 89 .putExtra(TimerService.EXTRA_TIMER_ID, timer.getId()); in build() 99 .putExtra(TimerService.EXTRA_TIMER_ID, timer.getId()); in build() 113 .putExtra(TimerService.EXTRA_TIMER_ID, timer.getId()); in build() [all …]
|
D | DataModel.java | 35 import com.android.deskclock.timer.TimerService; 477 public void removeTimer(Timer timer) { in removeTimer() argument 479 mTimerModel.removeTimer(timer); in removeTimer() 485 public void startTimer(Timer timer) { in startTimer() argument 486 startTimer(null, timer); in startTimer() 493 public void startTimer(Service service, Timer timer) { in startTimer() argument 495 final Timer started = timer.start(); in startTimer() 497 if (timer.getRemainingTime() <= 0) { in startTimer() 509 public void pauseTimer(Timer timer) { in pauseTimer() argument 511 mTimerModel.updateTimer(timer.pause()); in pauseTimer() [all …]
|
D | DataModel.kt | 40 import com.android.deskclock.timer.TimerService 465 fun removeTimer(timer: Timer) { in removeTimer() 467 mTimerModel?.removeTimer(timer) in removeTimer() 473 fun startTimer(timer: Timer) { in startTimer() 474 startTimer(null, timer) in startTimer() 481 fun startTimer(service: Service?, timer: Timer) { in startTimer() 483 val started = timer.start() in startTimer() 485 if (timer.remainingTime <= 0) { in startTimer() 497 fun pauseTimer(timer: Timer) { in pauseTimer() 499 mTimerModel?.updateTimer(timer.pause()) in pauseTimer() [all …]
|
/packages/apps/DeskClock/src/com/android/deskclock/timer/ |
D | TimerItemFragment.kt | 17 package com.android.deskclock.timer 49 val timer = timer ?: return null in onCreateView() constant 55 view.update(timer) in onCreateView() 66 val timer = timer!! in updateTime() constant 67 view.update(timer) in updateTime() 68 return !timer.isReset in updateTime() 74 val timer: Timer? constant in com.android.deskclock.timer.TimerItemFragment 79 val timer = timer!! in onClick() constant 80 if (timer.isPaused) { in onClick() 81 DataModel.dataModel.resetOrDeleteTimer(timer, R.string.label_deskclock) in onClick() [all …]
|
D | ExpiredTimersActivity.kt | 15 package com.android.deskclock.timer 94 for (timer in expiredTimers) { in onCreate() constant 95 addTimer(timer) in onCreate() 152 private fun addTimer(timer: Timer) { in addTimer() 155 val timerId: Int = timer.id in addTimer() 165 labelView.visibility = if (TextUtils.isEmpty(timer.label)) View.GONE else View.VISIBLE in addTimer() 170 val timer: Timer = DataModel.dataModel.getTimer(timerId)!! in addTimer() constant 171 DataModel.dataModel.addTimerMinute(timer) in addTimer() 186 private fun removeTimer(timer: Timer) { in removeTimer() 189 val timerId: Int = timer.id in removeTimer() [all …]
|
D | TimerItemFragment.java | 17 package com.android.deskclock.timer; 41 public static TimerItemFragment newInstance(Timer timer) { in newInstance() argument 44 args.putInt(KEY_TIMER_ID, timer.getId()); in newInstance() 59 final Timer timer = getTimer(); in onCreateView() local 60 if (timer == null) { in onCreateView() 68 view.update(timer); in onCreateView() 79 final Timer timer = getTimer(); in updateTime() local 80 view.update(timer); in updateTime() 81 return !timer.isReset(); in updateTime() 98 final Timer timer = getTimer(); in onClick() local [all …]
|
D | ExpiredTimersActivity.java | 15 package com.android.deskclock.timer; 99 for (Timer timer : expiredTimers) { in onCreate() 100 addTimer(timer); in onCreate() 161 private void addTimer(Timer timer) { in addTimer() argument 164 final int timerId = timer.getId(); in addTimer() 174 labelView.setVisibility(TextUtils.isEmpty(timer.getLabel()) ? View.GONE : View.VISIBLE); in addTimer() 181 final Timer timer = DataModel.getDataModel().getTimer(timerId); in addTimer() 182 DataModel.getDataModel().addTimerMinute(timer); in addTimer() 198 private void removeTimer(Timer timer) { in removeTimer() argument 201 final int timerId = timer.getId(); in removeTimer() [all …]
|
D | TimerFragment.kt | 17 package com.android.deskclock.timer 154 val timer: Timer? = DataModel.dataModel.mostRecentExpiredTimer in onStart() constant 155 showTimerId = timer?.id ?: -1 in onStart() 160 val timer: Timer? = DataModel.dataModel.getTimer(showTimerId) in onStart() constant 161 timer?.let { in onStart() 178 val timer: Timer? = DataModel.dataModel.getTimer(showTimerId) in onResume() constant 179 timer?.let { in onResume() 215 val timer = timer in updateFab() constant 216 if (timer == null) { in updateFab() 222 when (timer.state) { in updateFab() [all …]
|
D | TimerFragment.java | 17 package com.android.deskclock.timer; 176 final Timer timer = DataModel.getDataModel().getMostRecentExpiredTimer(); in onStart() local 177 showTimerId = timer == null ? -1 : timer.getId(); in onStart() 182 final Timer timer = DataModel.getDataModel().getTimer(showTimerId); in onStart() local 183 if (timer != null) { in onStart() 184 final int index = DataModel.getDataModel().getTimers().indexOf(timer); in onStart() 201 final Timer timer = DataModel.getDataModel().getTimer(showTimerId); in onResume() local 202 if (timer != null) { in onResume() 204 final int index = DataModel.getDataModel().getTimers().indexOf(timer); in onResume() 241 final Timer timer = getTimer(); in updateFab() local [all …]
|
D | TimerService.java | 17 package com.android.deskclock.timer; 73 public static Intent createTimerExpiredIntent(Context context, Timer timer) { in createTimerExpiredIntent() argument 74 final int timerId = timer == null ? -1 : timer.getId(); in createTimerExpiredIntent() 141 final Timer timer = DataModel.getDataModel().getTimer(timerId); in onStartCommand() local 144 if (timer == null) { in onStartCommand() 166 DataModel.getDataModel().startTimer(this, timer); in onStartCommand() 170 DataModel.getDataModel().pauseTimer(timer); in onStartCommand() 174 DataModel.getDataModel().addTimerMinute(timer); in onStartCommand() 177 DataModel.getDataModel().resetOrDeleteTimer(timer, label); in onStartCommand() 181 DataModel.getDataModel().expireTimer(this, timer); in onStartCommand()
|
D | TimerPagerAdapter.kt | 17 package com.android.deskclock.timer 58 val timer = fragment.timer in getItemPosition() constant 60 val position = timers.indexOf(timer) in getItemPosition() 70 val timer = timers[position] in instantiateItem() constant 73 val tag = javaClass.simpleName + timer.id in instantiateItem() 81 fragment = TimerItemFragment.newInstance(timer) in instantiateItem() 89 mFragments[timer.id] = fragment in instantiateItem() 132 override fun timerAdded(timer: Timer) { in timerAdded() 136 override fun timerRemoved(timer: Timer) { in timerRemoved()
|
D | TimerItem.java | 17 package com.android.deskclock.timer; 89 void update(Timer timer) { in update() argument 91 mTimerTextController.setTimeString(timer.getRemainingTime()); in update() 94 final String label = timer.getLabel(); in update() 102 final boolean hideCircle = (timer.isExpired() || timer.isMissed()) && blinkOff; in update() 107 mCircleView.update(timer); in update() 110 if (!timer.isPaused() || !blinkOff || mTimerText.isPressed()) { in update() 117 if (timer.getState() != mLastState) { in update() 118 mLastState = timer.getState(); in update()
|
D | TimerItem.kt | 17 package com.android.deskclock.timer 82 fun update(timer: Timer) { in update() 84 mTimerTextController.setTimeString(timer.remainingTime) in update() 87 val label: String? = timer.label in update() 95 val hideCircle = (timer.isExpired || timer.isMissed) && blinkOff in update() 100 mCircleView!!.update(timer) in update() 103 if (!timer.isPaused || !blinkOff || mTimerText.isPressed) { in update() 110 if (timer.state != mLastState) { in update() 111 mLastState = timer.state in update()
|
D | TimerService.kt | 17 package com.android.deskclock.timer 74 val timer: Timer = DataModel.dataModel.getTimer(timerId) ?: return START_NOT_STICKY in onStartCommand() constant 92 DataModel.dataModel.startTimer(this, timer) in onStartCommand() 96 DataModel.dataModel.pauseTimer(timer) in onStartCommand() 100 DataModel.dataModel.addTimerMinute(timer) in onStartCommand() 103 DataModel.dataModel.resetOrDeleteTimer(timer, label) in onStartCommand() 107 DataModel.dataModel.expireTimer(this, timer) in onStartCommand() 143 fun createTimerExpiredIntent(context: Context, timer: Timer?): Intent { in createTimerExpiredIntent() 144 val timerId = timer?.id ?: -1 in createTimerExpiredIntent()
|
D | TimerPagerAdapter.java | 17 package com.android.deskclock.timer; 69 final Timer timer = fragment.getTimer(); in getItemPosition() local 71 final int position = getTimers().indexOf(timer); in getItemPosition() 82 final Timer timer = getTimers().get(position); in instantiateItem() local 85 final String tag = getClass().getSimpleName() + timer.getId(); in instantiateItem() 93 fragment = TimerItemFragment.newInstance(timer); in instantiateItem() 101 mFragments.put(timer.getId(), fragment); in instantiateItem() 148 public void timerAdded(Timer timer) { in timerAdded() argument 153 public void timerRemoved(Timer timer) { in timerRemoved() argument
|
/packages/apps/DeskClock/tests/src/com/android/deskclock/timer/ |
D | ExpiredTimersActivityTest.java | 17 package com.android.deskclock.timer; 54 Timer timer = dm.addTimer(60000L, "", false); in configurationChanges_DoNotResetFiringTimer() 55 dm.startTimer(timer); in configurationChanges_DoNotResetFiringTimer() 56 dm.expireTimer(null, dm.getTimer(timer.getId())); in configurationChanges_DoNotResetFiringTimer() 57 timer = dm.getTimer(timer.getId()); in configurationChanges_DoNotResetFiringTimer() 66 assertSame(timer, dm.getTimer(timer.getId())); in configurationChanges_DoNotResetFiringTimer()
|
D | TimerServiceTest.java | 17 package com.android.deskclock.timer; 64 for (Timer timer : timers) { in clearTimers() 65 DataModel.getDataModel().removeTimer(timer); in clearTimers() 111 Timer timer = dataModel.addTimer(60000L, null, false); in verifyIntentsHonored_ifNoTimersAreExpired() 112 dataModel.startTimer(timer); in verifyIntentsHonored_ifNoTimersAreExpired() 113 timer = dataModel.getTimer(timer.getId()); in verifyIntentsHonored_ifNoTimersAreExpired() 116 dataModel.expireTimer(null, timer); in verifyIntentsHonored_ifNoTimersAreExpired() 121 dataModel.resetTimer(dataModel.getTimer(timer.getId())); in verifyIntentsHonored_ifNoTimersAreExpired()
|
D | TimerSetupViewTest.java | 17 package com.android.deskclock.timer; 117 Timer timer = DataModel.getDataModel().addTimer(5000L, "", false); in validateDefaultState_TimersExist() 119 DataModel.getDataModel().removeTimer(timer); in validateDefaultState_TimersExist() 140 Timer timer = DataModel.getDataModel().addTimer(5000L, "", false); in type0InDefaultState_TimersExist() 142 DataModel.getDataModel().removeTimer(timer); in type0InDefaultState_TimersExist() 195 Timer timer = DataModel.getDataModel().addTimer(5000L, "", false); in fillDisplayThenDeleteAll_TimersExist() 197 DataModel.getDataModel().removeTimer(timer); in fillDisplayThenDeleteAll_TimersExist() 223 Timer timer = DataModel.getDataModel().addTimer(5000L, "", false); in fillDisplayWith9s_TimersExist() 225 DataModel.getDataModel().removeTimer(timer); in fillDisplayWith9s_TimersExist()
|
/packages/apps/Messaging/src/com/android/messaging/datamodel/action/ |
D | ActionServiceImpl.java | 284 final LoggingTimer timer = createLoggingTimer(action, "#executeAction"); in executeAction() local 285 timer.start(); in executeAction() 289 timer.stopAndLog(); in executeAction() 298 final LoggingTimer timer = createLoggingTimer(action, "#processBackgroundResponse"); in processBackgroundResponse() local 299 timer.start(); in processBackgroundResponse() 303 timer.stopAndLog(); in processBackgroundResponse() 310 final LoggingTimer timer = createLoggingTimer(action, "#processBackgroundFailure"); in processBackgroundFailure() local 311 timer.start(); in processBackgroundFailure() 315 timer.stopAndLog(); in processBackgroundFailure()
|
/packages/services/Telecomm/src/com/android/server/telecom/ |
D | Ringer.java | 532 LogUtils.EventTimer timer = new EventTimer(); in getRingerAttributes() local 535 timer.record("isVolumeOverZero"); in getRingerAttributes() 537 timer.record("shouldRingForContact"); in getRingerAttributes() 539 timer.record("getRingtone"); in getRingerAttributes() 541 timer.record("isSelfManaged"); in getRingerAttributes() 543 timer.record("isSilentRingRequested"); in getRingerAttributes() 546 timer.record("isRingerAudible"); in getRingerAttributes() 555 timer.record("hasExternalRinger"); in getRingerAttributes() 558 timer.record("isTheaterModeOn"); in getRingerAttributes() 560 timer.record("letDialerHandleRinging"); in getRingerAttributes() [all …]
|