From 14f397e93f73b18048e544fd9a18eeeb6a8a8c7a Mon Sep 17 00:00:00 2001 From: Colin Marsch Date: Mon, 11 May 2020 21:23:31 +0000 Subject: AOSP/DeskClock - Added SET_ALARM permission check Added SET_ALARM permission check for the HandleApiCalls activity. BUG: 150612638 Test: manual - tested the DeskClock UI manually, as well as testing the alarm, stopwatch and timer Forrest run: go/forrest-run/L31100000555861022 to test CtsMediaTestCases module Change-Id: I9e42e0bc3eb1375d170091ec79315967be1efd32 Merged-In: I9e42e0bc3eb1375d170091ec79315967be1efd32 --- AndroidManifest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 487361e38..e6fc18ddc 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -104,6 +104,7 @@ Date: Mon, 13 Jul 2020 12:13:32 -0700 Subject: DeskClock: Fix alarm clock screen show black when screen locked; Root cause: API ActivityTaskManagerService.notifyKeyguardFlagsChanged is called multiple times, which causes the activity status abnormal. Solution: Add 'android:showWhenLocked = true' to ensure activity show on the top even when screen locked. BUG: 156311117 Test: manual - Tested the DeskClock UI manually and tested the alarm. $ make -j 40 $ ls -l out/target/product/bonito/product/app/DeskClock/DeskClock.apk -rw-r----- 1 rtenneti primarygroup 6117353 Jul 13 11:35 out/target/product/bonito/product/app/DeskClock/DeskClock.apk $ adb install -r out/target/product/bonito/product/app/DeskClock/DeskClock.apk + Verified by setting up the alaram, lock the screen and waiting for the alarm to go off. Forrest build for pi-dev - https://android-build.googleplex.com/builds/forrest/run/L77900000637089767 Change-Id: I69c44571cd86c21203311c89081c8935d5ed1450 Merged-In: I69c44571cd86c21203311c89081c8935d5ed1450 --- AndroidManifest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 601edde9a..e38999c95 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -142,6 +142,7 @@ android:excludeFromRecents="true" android:resizeableActivity="false" android:showOnLockScreen="true" + android:showWhenLocked="true" android:taskAffinity="" android:windowSoftInputMode="stateAlwaysHidden" /> -- cgit v1.2.3 From 504dfe5e4b7f6a3ca42e2e0e4eb84dc3942e0be3 Mon Sep 17 00:00:00 2001 From: Raman Tenneti Date: Mon, 13 Jul 2020 12:13:32 -0700 Subject: DeskClock: Fix alarm clock screen show black when screen locked; Root cause: API ActivityTaskManagerService.notifyKeyguardFlagsChanged is called multiple times, which causes the activity status abnormal. Solution: Add 'android:showWhenLocked = true' to ensure activity show on the top even when screen locked. BUG: 156311117 BUG: 165404800 Test: manual - Tested the DeskClock UI manually and tested the alarm. $ make -j 40 $ ls -l out/target/product/bonito/product/app/DeskClock/DeskClock.apk -rw-r----- 1 rtenneti primarygroup 6117353 Jul 13 11:35 out/target/product/bonito/product/app/DeskClock/DeskClock.apk $ adb install -r out/target/product/bonito/product/app/DeskClock/DeskClock.apk + Verified by setting up the alaram, lock the screen and waiting for the alarm to go off. Forrest build for pi-dev - https://android-build.googleplex.com/builds/forrest/run/L77900000637089767 Change-Id: I69c44571cd86c21203311c89081c8935d5ed1450 (cherry picked from commit 4ba26ea8d82298e42324dc723899465cc16082f5) --- AndroidManifest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index cf4271338..b0f814bf2 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -142,6 +142,7 @@ android:excludeFromRecents="true" android:resizeableActivity="false" android:showOnLockScreen="true" + android:showWhenLocked="true" android:taskAffinity="" android:windowSoftInputMode="stateAlwaysHidden" /> -- cgit v1.2.3 From e88d40eecee133ae9e05f3e60d228c33dfb7284b Mon Sep 17 00:00:00 2001 From: Raman Tenneti Date: Thu, 20 Jun 2019 16:06:57 -0700 Subject: DeskClock - Moved the android:targetSdkVersion to 25 to fix "Clock has stopped" message displayed when Alarm trigger. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit + Added android.permission.FOREGROUND_SERVICE permission to fix the following exception. 06-20 22:07:00.155 4690 4690 E AndroidRuntime: java.lang.RuntimeException: Unable to start service com.android.deskclock.alarms.AlarmService@bd4eda3 with Intent { act=change_state cat=[ALARM_MANAGER] dat=content://com.android.deskclock/instances/1 flg=0x10000004 cmp=com.android.deskclock/.alarms.AlarmService (has extras) }: java.lang.SecurityException: Permission Denial: startForeground from pid=4690, uid=10061 requires android.permission.FOREGROUND_SERVICE Bug: 135587258 Bug: 168883433 Bug: 140846467 Test: manual - Ran the following tests on Pixel phone. Tested the clock for Alarm. $ make -j 40 -rw-r--r-- 1 rtenneti primarygroup 4842448 Jun 20 15:17 ./target/product/marlin/system/product/app/DeskClock/DeskClock.apk $ adb install -d -r out/target/product/marlin/system/product/app/DeskClock/DeskClock.apk Performing Streamed Install Success $ adb logcat -c $ adb logcat >> ~/temp/logcat/0620/logcat.out.0620.1603 + Set up the alarm and wait for the alarm to go off. The following is from the logcat output. "Clock has stopped" wasn't displayed. Noted there were no exceptions in the logs. 06-19 11:37:03.706 929 929 D ConditionProviders.SCP: evaluateSubscriptionLocked cal=ScheduleCalendar[mDays={1, 2, 3, 4, 5, 6, 7}, mSchedule=ScheduleInfo{days=[1, 2, 3, 4, 5, 6, 7], startHour=22, startMinute=0, endHour=7, endMinute=0, exitAtAlarm=true, nextAlarm=Thu Jan 01 00:00:00 GMT 1970 (0)}], now=Wed Jun 19 11:37:03 GMT 2019 (1560944223706), nextUserAlarmTime=Thu Jun 20 11:37:00 GMT 2019 (1561030620000) 06-19 11:37:03.706 929 929 D ConditionProviders.SCP: notifyCondition condition://android/schedule?days=1.2.3.4.5.6.7&start=22.0&end=7.0&exitAtAlarm=true STATE_FALSE reason=!meetsSchedule 06-19 11:37:03.708 929 929 D ConditionProviders.SCP: Scheduling evaluate for Wed Jun 19 22:00:00 GMT 2019 (1560981600000), in +10h22m56s294ms, now=Wed Jun 19 11:37:03 GMT 2019 (1560944223706) 06-19 11:37:03.711 2915 2915 D KeyguardClockSwitch: Updating clock: 1137 06-19 11:37:03.719 4385 4385 I AlarmClock: Setting upcoming AlarmClockInfo for alarm: 4 06-19 11:37:03.721 4385 4385 D Events : [Alarm] [Dismiss] [DeskClock] 06-19 11:37:03.722 929 929 D ConditionProviders.SCP: onReceive android.app.action.NEXT_ALARM_CLOCK_CHANGED 06-19 11:37:03.723 929 929 D ConditionProviders.SCP: evaluateSubscriptionLocked cal=ScheduleCalendar[mDays={1, 2, 3, 4, 5, 6, 7}, mSchedule=ScheduleInfo{days=[1, 2, 3, 4, 5, 6, 7], startHour=22, startMinute=0, endHour=7, endMinute=0, exitAtAlarm=true, nextAlarm=Thu Jun 20 11:37:00 GMT 2019 (1561030620000)}], now=Wed Jun 19 11:37:03 GMT 2019 (1560944223722), nextUserAlarmTime=Thu Jun 20 11:37:00 GMT 2019 (1561030620000) 06-19 11:37:03.723 929 929 D ConditionProviders.SCP: notifyCondition condition://android/schedule?days=1.2.3.4.5.6.7&start=22.0&end=7.0&exitAtAlarm=true STATE_FALSE reason=!meetsSchedule 06-19 11:37:03.723 929 929 D ConditionProviders.SCP: Scheduling evaluate for Wed Jun 19 22:00:00 GMT 2019 (1560981600000), in +10h22m56s278ms, now=Wed Jun 19 11:37:03 GMT 2019 (1560944223722) 06-19 11:37:03.729 929 988 I DropBoxManagerService: add tag=system_app_strictmode isTagEnabled=true flags=0x2 06-19 11:37:03.747 2915 2915 D KeyguardClockSwitch: Updating clock: 1137 06-19 11:37:03.765 4385 4385 V AlarmClock: AlarmService.onStartCommand() with Intent { act=STOP_ALARM dat=content://com.android.deskclock/instances/3 cmp=com.android.deskclock/.alarms.AlarmService } 06-19 11:37:03.765 4385 4385 V AlarmClock: AlarmService.stop with instance: 3 06-19 11:37:03.765 4385 4385 V AlarmClock: AlarmKlaxon.stop() 06-19 11:37:03.765 4385 4385 D AsyncRingtonePlayer: Posting stop. 06-19 11:37:03.765 4385 5050 I AsyncRingtonePlayer: Stop ringtone via android.media.Ringtone. 06-19 11:37:03.767 4385 5050 D AsyncRingtonePlayer: Ringtone.stop() invoked. 06-19 11:37:03.767 806 3934 D NuPlayerDriver: reset(0xed43b600) at state 5 Change-Id: I75a96e1ed4acebd118c212b51b7d0e57482a66bb Merged-In: I75a96e1ed4acebd118c212b51b7d0e57482a66bb --- AndroidManifest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 5bb11b5e2..fbb0ae2aa 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -29,6 +29,7 @@ +