summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2023-10-04Fix EmergencyInfo for use_resource_processor: trueColin Cross
Use a separate package name in the AndroidManifest.xml for each android_library. Reference resources using the package name of the library that includes them. Bug: 294256649 Test: m javac-check Change-Id: Ic1e4030a54dfc6e9fadf77317ab237852abe5e9b
2023-04-11Avoid saving emergency contacts in direct boot modeJames Smith
Bug: 264369451 Test: Manually tested in direct boot mode and when unlocked Change-Id: Ib35972259642b58e0f0a59661ee17b50ba1ba85c
2022-09-07Prevent exfiltration of system files via avatar picker. am: 5981e18eb5 am: ↵Oli Lan
9fa90eb683 am: 97b62f44cd am: 23af1786bb am: 5f0164c875 am: c45b0c45be Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/EmergencyInfo/+/19755176 Change-Id: I582e663fa995862f59915872c6d7b05222080aef Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-07Prevent exfiltration of system files via avatar picker. am: 5981e18eb5 am: ↵Oli Lan
9fa90eb683 am: 97b62f44cd am: 23af1786bb Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/EmergencyInfo/+/19755176 Change-Id: I8cf99e2b0f300153031ef414ecfd9a0d6e77e4e6 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-07Prevent exfiltration of system files via avatar picker. am: 5981e18eb5 am: ↵Oli Lan
9fa90eb683 Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/EmergencyInfo/+/19755176 Change-Id: Ib6f05e09bfda4cb97ed427d8a7f8452ac44f19a6 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-26Prevent exfiltration of system files via avatar picker.Oli Lan
This adds mitigations to prevent system files being exfiltrated via the settings content provider when a content URI is provided as a chosen user image. The mitigations are: 1) Copy the image to a new URI rather than the existing takePictureUri prior to cropping. 2) Only allow a system handler to respond to the CROP intent. This is a fixed version of ag/17004678, to address b/239513606. Bug: 187702830 Test: build and check functionality Change-Id: I07bb987b930b851a28871a13032b8fcfcd96d6d1
2022-08-22Revert "Prevent exfiltration of system files via user image settings." am: ↵Oli Lan
889b93dd4e am: ea0ef7264e am: a1c89aaf4a am: f39937e5a3 am: eb5da3a75f am: 191e8239fa Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/EmergencyInfo/+/19430798 Change-Id: I497037e172099f0dc66f757ab73e2b8aa4d3486f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-22Revert "Prevent exfiltration of system files via user image settings." am: ↵Oli Lan
889b93dd4e am: ea0ef7264e am: a1c89aaf4a am: f39937e5a3 Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/EmergencyInfo/+/19430798 Change-Id: I07f6c1b577d9e3928f56ed8e30809b179ab76936 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-22Revert "Prevent exfiltration of system files via user image settings." am: ↵Oli Lan
889b93dd4e am: ea0ef7264e Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/EmergencyInfo/+/19430798 Change-Id: I0074f1d76f5e07744d6523d6277aefd8c5fd21a4 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-28Revert "Prevent exfiltration of system files via user image settings."Oli Lan
This reverts commit fac28abbe64a1c3e430414f35139988ef96edb7c. Reason for revert: regression if multiple crop system crop handlers are present Bug: 239914925 Change-Id: I1784eec7ffa2af0b48fa0d0d075e015ebfb7fa47
2022-04-01Prevent exfiltration of system files via user image settings. am: fac28abbe6 ↵Oli Lan
am: 6626aa7fbd am: 29c3d9ba59 am: 88e8b4f974 am: 92c9813e9a am: 8768663408 Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/EmergencyInfo/+/17004678 Change-Id: I22cb3a9ebc5b686b0a61b87fabc9362cb7981055 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-01Prevent exfiltration of system files via user image settings. am: fac28abbe6 ↵Oli Lan
am: 6626aa7fbd am: 29c3d9ba59 am: 88e8b4f974 Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/EmergencyInfo/+/17004678 Change-Id: I0c472d9bcbb6738999f11054d77ef33e7cf48d41 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-01Prevent exfiltration of system files via user image settings. am: fac28abbe6 ↵Oli Lan
am: 6626aa7fbd Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/EmergencyInfo/+/17004678 Change-Id: Idfbc14c26f8f97344e091a4462c588cc8b61746c Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-05Fix a bug where add EC result is ignoredFan Zhang
The ACTION_PICK intent should not start from a new task. Doing so forces android to drop the activity result (startActivityForResult cannot propagate activity result between different task stacks) Fix: 213439402 Test: manual Change-Id: I32bdf080a421d2856e6c2b16459bb2a4be32509e
2022-02-25Prevent exfiltration of system files via user image settings.Oli Lan
This adds mitigations to prevent system files being exfiltrated via the settings content provider when a content URI is provided as a chosen user image. The mitigations are: 1) Copy the image to a new URI rather than the existing takePictureUri prior to cropping. 2) Only allow a system handler to respond to the CROP intent. A similar change is made in ag/17003629 which uses the same mechanism. Bug: 187702830 Test: builds Change-Id: Iba9e08b3cf9e31c162354f09aaf6b4f9afb6bd27
2021-09-10Launch view/add EC activities in a new taskFan Zhang
This has no effect to regular phones but shows the view in a full screen for foldables, required by settings foldable design. Bug: 197702382 Bug: 197702383 Test: manual Change-Id: Id681bff0bfdb28c328856e74788fa75dd21e59bf
2021-06-23Don't show edit icon when device is not set upFan Zhang
Fix: 191135814 Test: manual Change-Id: I460099f35037c2d71d09ab51e7fd8ad372ee8f3e
2021-04-01Prevent using invalid result uri during multi user image changeFan Zhang
This is the same fix as seen in ag/13815798 Test: manual Bug: 173721846 Change-Id: I120f9560d5d22c4ec273e21abec738f233f08302
2021-03-11No-op: Move all emergency action related code in a libraryFan Zhang
And EmergencyInfo app depends on the library. We need a library so OEM packages can include the emergency action implemetnation without re-implementing or copy-paste code. Bug: 180959553 Test: rebuild Change-Id: I1ed6e2241c6fb984779274d4840f4c2d46c62d25
2021-02-19Update emergency number authority name to be more genericFan Zhang
Bug: 180236600 Test: rebuild Change-Id: Ic05d4c3281f0fb8e915076e26a032f237f795a95
2021-01-27Use FLAG_IMMUTABLE for pending intentsFan Zhang
And add android.permission.START_ACTIVITIES_FROM_BACKGROUND to use foreground services during countdown. Bug: 178227866 Test: manual Change-Id: Icf8e56d078da648be679b3d2f4469e5a17d96ae5
2021-01-20Merge "Add a safeguard in emergency action activity to exit early"Fan Zhang
2021-01-20Add a safeguard in emergency action activity to exit earlyFan Zhang
When emergency gesture is not enabled, we should not execute emergency action. This check exits the UI flow to prevent accidental launching. Bug: 178009196 Test: manual Change-Id: I687df3f82b77789c5656020a80e545bdd9732450
2021-01-07Add a contentprovider to store emergency number overridesFan Zhang
This change moves the emergency number override storage from Settings.secure to an in-app ContentProvider. The in-app ContentProvider allows more flexible permission control, and keeps the data more private. Bug: 177006940 Test: manual Change-Id: I42d6de82257d0d5926fb56ea7b2e1c66273e066d
2020-12-16Move warning sound play/stop logic to a helper classFan Zhang
And use the helper class in both EmergencyActionFragment and EmergencyActionService. Fix: 172075832 Test: manual Change-Id: I08ced0677c7a20aab7bf4ec1c55c87884691b7c8
2020-12-16Merge "Add service to keep countdown when ui is backgrounded"TreeHugger Robot
2020-12-15Add service to keep countdown when ui is backgroundedFan Zhang
This change introduced a few new components to make countdown work in the background. - EmergencyActionForegroundService: posts a notification with remaining seconds. * It also starts/stops sound associated with the notification - EmergencyActionBroadcastReceiver: handles 2 action * calling emergency number and * cancelling the count down notification When UI is closed, it start a foreground service to take over the count down. Then the service sends an notification immediately, and schedules a broadcast when countdown reaches 0. This broadcast will trigger emergency calling. The notification has a cancel button, which also is a broadcast to cancel ongoing foreground service. When foreground service stops, the vibration, sound and notification all stops with it. Bug: 172075832 Test: manual Change-Id: I04f33848b9532534f1551f20320683331207aa7e
2020-12-15Update panic UI to meet a11y requirementslindatseng
Update panic UI in landscape, and also ignore large font/display size to keep the UI consistent and avoid scrolling. Screenshot: https://screenshot.googleplex.com/6bgLC5ajmh76TSq.png Fix: 175537704 Fix: 175536730 Test: Flash the build on device Change-Id: I5d30756ae02b35b1277418140c0208a4b97facc0
2020-12-14Block EmergencyAction from dismissing as much as possibleFan Zhang
Block the onBackPress event on EmergencyActionActivity reduces chances for false dismiss. The ui can still be dismissed with home button or recents button. Apps cannot override these behaviors. So next step we will build a foreground service to keep the vibration and sound going. Bug: 172075832 Test: manual Change-Id: I2f1c2c6d684c85fe9912da663f99365ceefd3dd6
2020-12-14Add flags to support background counting downFan Zhang
A few flags are added in preparation to support counting down in background. - STATE_MILLIS_LEFT can also be set in activity intent. When we have a fg service for countdown, the fg service's notification can launch this UI, so we need to know remaining time from that intent. - mCountdownCancelled and mCountdownFinished flags: they are needed to start a foreground service right before UI is dismissed. Bug: 172075832 Test: manually inspected logs Change-Id: I97de40b5df790f2f366d5273e792c2327fd4c557
2020-12-10Update panic alarm and override volumelindatseng
Update the new alarm audio file, then adjust the volume to max when panic UI shown, then recover back to the original volume when panic UI ended. Fix: 173517048 Test: Tested on pixel 4 Change-Id: Icecbb9ba4090ad410352c451ed3545ebbb7d0c42
2020-11-18Load user provided emergency number from settings.Fan Zhang
EmergencyNumberUtils loads emergency number from settings, or fallback to telephony if it's empty. It internally sorts the number to ensure the number used in settings and in emergency info are always consistent. Bug: 172609395 Test: manual Change-Id: I2f5f23a8b69fe92fcd23234245a6321bf5b76f59
2020-11-02Merge "Use a slider button for cancel action in emergency action"Fan Zhang
2020-10-30Use a slider button for cancel action in emergency actionFan Zhang
https://screenshot.googleplex.com/4zFjrcgMGwmohdT.png Bug: 169946402 Test: manual Change-Id: I26e23671efa2ab1d91caa174c2eafe75febdedc6
2020-10-29Add null check to prevent crash before callinglindatseng
mediaPlayer.isPlaying Fix: 172012417 Test: Tested on device Change-Id: Ie89ff3a0504bcee57cb88776ae0e53a3d0dc7cc6
2020-10-27Play warning sound when launching emergency SOSlindatseng
action. Also add a temporary cancle button to allow users to stop the countdown and close the view before starting an emergency call. Bug: 169946301 Test: Tested on device (pixel4) Change-Id: I68031cc53d3f4108b60d27b9aa5b88f3007f0e51
2020-10-20Start the emergnecy call when the countdown finishlindatseng
Also add noHistory & turnScreenOn flag to EmergencyActionActivity to make sure the countdown will be restarted and the screen will be turned on when a new action is sent. Fix: 169946688 Test: Tested on device Change-Id: I8d87438a963259c9661c35ea2f2a9fd19c99c890
2020-10-14Add subtitle and countdown animation view tolindatseng
emergnecy action view CountDownAnimationView is mostly copied from jcgaa/safetyhub/common/widget/checkanimationview with small refactor to simplify the code for the usage in this screen only Screenshot: https://screenshot.googleplex.com/4GrjcRhRwGzhWFp.png Bug: 169946301 Fix: 170431224 Test: Tested on device Change-Id: Id8ee0149e30b7e3ebef801c78dd8fc536e7f0b01
2020-10-05Add skeleton activity for handling emergencylindatseng
action (Will be launched by panic gesture) Screenshot: https://screenshot.googleplex.com/9w5pNam5ETJwvGf.png Bug: 169946301 Test: atest EmergencyActionActivityTest Change-Id: I8656538d5583454430326fdee8f07a33b31e712d
2019-12-16Add no-op activity to open platform emergencydialer.Fan Zhang
Needed to treat this app as a ROLE_EMERGENCY app for AOSP builds. Change-Id: Ib54a454b9d569229865963211109878a69ba7b96 Fix: 145743374 Test: manual
2019-05-03Fix EmergencyInformation ListPreference TB issueWesley.CW Wang
- Fix TB doesn't read "in list, 2 items" in Emergency information ListPreference Test: Manually, build EmergencyInformation and enable TB, check TB will speak "in list, x items" in ListPreference" Bug: 115462257 Change-Id: I47101822dd32ce466c4ad81c38ce25b4e91b2fc6
2019-04-30Clean Safetyhub feature flag from EmergencyInfo.yuanjiahsu
Clean all related code, need submit together. Test: Manually Bug: 118848485 Change-Id: I8969c27afc3e2abc7b8b5e67fbfb7cc3b5960a3c
2019-03-21Fix Talkback speak n+1 items on medical info viewChihhang Chuang
The design was an 8dp padding between ActionBar and PreferenceList. The original implementation was adding an empty Preference with 8dp hight to have the padding effect, but Talkback would take the item into account. So the Talkback would always speak n+1 items. Solution: add a top padding (8dp) to the Preference View, and remove the empty preference. Bug: 118583643 Test: Manually Change-Id: I159309e8a5c5e87f4fe0d8ec48e54c88f79848e9
2019-02-26Enable searchable by config and feature flagyuanjiahsu
For searchable index feature in Settings, add config to enable or disable it. Feature flag also applied for droidfood. Test: Manually Bug: 124429637 Change-Id: I1c8bbefb87f0bdfd5a65eb1c1f87cfa2cd75e5bb
2019-02-05Add android_library target.Andrew Sapperstein
Put most of the app logic in a library so it is more easily reusable. Bug: 120115754 Test: build, verify that EmergencyInfo works Change-Id: I7b2ad172f9487df50a24f0b6c8076db37a865221
2019-01-31Migrate away from temporary androidx.design_design target.Aurimas Liutikas
androidx.design_design was a target created temporarily while the com.google.android.material_material was being added. This migrated to the final material design class packages. Exempt-From-Owner-Approval: Large scale refactor Test: make -j EmergencyInfo Change-Id: I16c2bf11c0ada34f49bd57421f183c151d7efb81
2018-11-13Migrated EmergencyInfo to androidxWesley.CW Wang
Test: make RunEmergencyInfoRoboTests Bug: 119329752 Change-Id: I02b5d961bf3c4e8a0e1ef3476ecd5dd5de94e78a
2018-10-04Remove unused file and test caseWesley.CW Wang
- Remove AutoCompleteEditTextPreference & NameAutoCompletePreference. - Remove unused test case. Test: make RunEmergencyInfoRoboTests Bug: 111967295 Change-Id: I675c6bd283856f084df90c6f4213fbf20382d6aa
2018-10-04Emergency Info user name preference design changeWesley.CW Wang
- User name preference now will launch dialog same as change user name & icon in Multiple users. - Add permission for edit user name. - Change robolectric properties sdk to 23 for fixing robolectric initialize objects bug. Test: make RunEmergencyInfoRoboTests Bug: 111967295 Bug: 116770817 Change-Id: I938983eaa0d21442ade59dde0f3f74eec3a62d22
2018-10-04Fix EditUserPhotoController to fit EmergencyInfoWesley.CW Wang
- Fix EditUserPhotoController.java package name and import file. Test: Manually Bug: 111967295 Change-Id: Iaf01748f5b5bb53517e6ecb92d3a0faa4f2ff3b4