Commit Graph

105659 Commits

Author SHA1 Message Date
Chris Tate
ced44641d9 Merge "DO NOT MERGE - Disallow deletion of channels with FGS notifications" into rvc-qpr-dev 2021-04-06 16:22:21 +00:00
Jayant Chowdhary
02622abbe2 getCameraIdListNoLazy : remove system cameras from mTorchStatus as well.
Bug: 182530469

Test: Make Emulator back camera system camera; atest FlashlightTest.java

Merged-In: I0a149ba3d93a740cfbfdc2d04c1235e648061156
Change-Id: I0a149ba3d93a740cfbfdc2d04c1235e648061156
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
(cherry picked from commit bedb9950c8)
2021-04-02 18:55:48 +00:00
Jimmy Chen
e851fc58d6 Merge "wifidisplay: restrict broadcast by the proper permission" into rvc-qpr-dev 2021-04-01 01:42:28 +00:00
Seigo Nonaka
39c49f8daa Merge "Override isRestricted for preventing unexpected resource loading" into rvc-qpr-dev 2021-03-31 21:53:43 +00:00
Louis Chang
b6d433cdbd Merge "Dump warning logs to prevent app crash while no top-resumed changes" into rvc-qpr-dev 2021-03-31 06:15:30 +00:00
Shuzhen Wang
640011569f Camera: Fix a removal-while-iterate bug
The onStatusChangedLocked removes entries from the ArrayMap. Needs to
iterate in the reverse order.

Test: Vendor testing
Bug: 182876702
Change-Id: I5891f24a25c83f096d23ca5675126889a7d2a61c
2021-03-30 14:42:33 -07:00
Hui Yu
4221ca489c Merge "Allow FGS started from MediaButtonReceiver to have while-in-use permissions." into rvc-qpr-dev 2021-03-24 17:41:39 +00:00
Hui Yu
ebfad50cc1 Allow FGS started from MediaButtonReceiver to have while-in-use
permissions.

1. Create FgsWhileInUseTempAllowList, the uid on this list is allowed to
have while-in-use permission when the FGS is started from background for
a duration of time.
2. When media button is pressed, the targetUid is added to
FgsWhileInUseTempAllowList for the duration of 10 seconds, this way the
targetUid can start FGS from background and have while-in-use permission.
3. When checking for ProcessRecord.
mAllowBackgroundActivityStartsTokens, it is the caller app's
ProcessRecord should be checked instead of the service's ProcessRecord.

Bug: 182481312
Test: use b/167998084 reproduce steps, use Line app to make a voip call, the
 receiver side screen is unlocked, the receiver side uses bluetooth
headset button to pick up the call, "dumpsys activity -a" shows the FGS
"com.linecorp.voip.core.common.notification.VoipNotificationCommand" has
"allowWhileInUsePermissionInFgs=true" and "isForeground=true".

Change-Id: Ic80aefe4202fe2210881bb8eea24b6e34cb1e7d0
Merged-In: I32a14d675550cd262976bb8e16a48a070387d318
2021-03-23 23:19:19 -07:00
Louis Chang
ed9f50dd58 Dump warning logs to prevent app crash while no top-resumed changes
Applications crashed due to duplicated top resumed activity change
events. Currently, the only possible scenario we know if that the
application invokes Looper#loop() and reverse the messages order.

Write warning logs vs. throwing exceptions to prevent application
crashes.

Bug: 140571893
Test: build and boot pass
Change-Id: If6f6c502b96ccc11b230ba075c61118f03e13d5c
2021-03-19 02:37:37 +00:00
Christopher Tate
2a33098b6c DO NOT MERGE - Disallow deletion of channels with FGS notifications
Bug: 156090809
Test: atest CtsAppTestCases:NotificationManagerTest
Test: atest CtsAppTestCases:android.app.cts.ServiceTest
Change-Id: I1c2bb78d86f194585d273661cecf3419f51965df
Merged-In: I1c2bb78d86f194585d273661cecf3419f51965df
(cherry picked from commit 39b3890268913bc2dc8b90671d042c0e9b4090d2)
2021-03-17 17:29:36 -07:00
Tobias Thierer
3a9dd32f61 Merge changes from topic "bug158482162_rvc-qpr-dev" into rvc-qpr-dev
* changes:
  Fix DevicePolicyManager.isBackupServiceEnabled() breakage.
  BackupManagerService: Make new behavior conditional on ChangeId.
  Enforce BACKUP permission on Service end.
2021-03-17 12:09:13 +00:00
Seigo Nonaka
ba987ca94f Override isRestricted for preventing unexpected resource loading
Bug: 179461812
Test: atest FontResourceTest
Change-Id: Ifb731310d31b80522bc82052625716083cac9e6f
(cherry picked from commit 0de34e9d87)
2021-03-12 19:32:27 +00:00
Jimmy Chen
fd8b6dabf9 wifidisplay: restrict broadcast by the proper permission
WIFI_DISPLAY_STATUS_CHANGED event contains the MAC address of peers.
As the MAC address is PII data, this should be restricted by proper
permission.

Bug: 176541017
Test: install PoC in b/176541017 and check PII data is not leaked.
Change-Id: I36b85f44678fe232486702fa009f5f06d1a7af75
2021-03-11 12:07:31 +08:00
Chris Li
0c603d91a7 Include whether in touch mode for WindowlessWindowManager
Fix: 179583920
Fix: 180530717
Test: manually with a windowless button
Change-Id: Ice37c3182a44c6284ffa8950996507025c59270b
Merged-In: Ice37c3182a44c6284ffa8950996507025c59270b
2021-03-10 21:11:34 +00:00
Patrick Baumann
ec4ba204d8 Merge "Adds caller check to getAllPackages()" into rvc-qpr-dev 2021-03-02 23:10:45 +00:00
Abhijeet Kaur
804642bd6c Merge "Disable resetting WRITE_MEDIA_IMAGES and WRITE_MEDIA_VIDEO appops" into rvc-qpr-dev 2021-02-25 16:29:05 +00:00
Abhijeet Kaur
5630668181 Disable resetting WRITE_MEDIA_IMAGES and WRITE_MEDIA_VIDEO appops
App holding System Gallery role is allowed WRITE_MEDIA_* appops by
virtue of the role. This allows the System Gallery app write-access for
images and videos.

When app preferences are reset AppOpsService toggles the appops for
all apps. Only the appops mentioned in sOpDisableReset are not toggled.

Disable WRITE_MEDIA_* appops to reset, as the system gallery app loses
write access on images/videos.

Bug: 179133883
Test: Manual
Change-Id: I168221c641566a9f691ed7956c038206b114d802
Merged-In: I168221c641566a9f691ed7956c038206b114d802
(cherry picked from commit de862be6a8)
2021-02-23 19:09:10 +00:00
Daniel Peykov
41802905f9 Fix possible NPE when matching accessory version
As UsbAccessory#getVersion is nullable, a NPE can occur if the manufacturer/model match.

Bug: 172002066
Bug: 178227159
Bug: 180055624
Change-Id: I751a01e3d182e01e5a9dbc011b60535997f9bc15
(cherry picked from commit 25dca30e2f)
2021-02-23 09:11:52 +00:00
yawanng
5e0898d35d Adds caller check to getAllPackages()
This change enforces that only system, root or shell may call
getAllPackages(), a hidden API that shares all package names regardless
of user, instant app or package visibility rules.

The only exception is the uid of iorapd. iorapd needs the package info
to prefetch the right data.

Bug: 179618216
Bug: 174661955
Test: run iorapd and check it works well.
Change-Id: I77460ae19a4d41151577646441f11e2eddbb741a
(cherry picked from commit 8124efd57b)
2021-02-18 18:19:27 +00:00
Winson
985d71551d Parcel queriesProviders in ParsingPackageImpl
This was broken in the original migration, causing this field to be
dropped on reboot.

Bug: 178209505

Test: TODO, separate change will include comprehensive parceling test

Change-Id: I67219fe00c7b92677391fd46305bf0424d74e5f3
(cherry picked from commit 00f69942be)
2021-02-11 16:57:08 +00:00
Marco Ballesio
911519f25a freezer: handle exception in locks file format
Safeguard /proc/locks processing from wrongly formatted /proc/locks
files

Bug: 179171387
Test: could not reproduce the issue, but verified that no crashes
occurred in a prolonged test (4hrs+)

Change-Id: Ia8a12903f2e520e51780c8b05876aa1c9083e92b
(cherry picked from commit fb4f4073f6)
2021-02-09 19:36:07 +00:00
TreeHugger Robot
d11f218b8e Merge "[RESTRICT AUTOMERGE] Revert "[RESTRICT AUTOMERGE] Remove DPMS#getProfileOwner in favor of getProfileOwnerAsUser"" into rvc-qpr-dev 2021-02-05 20:53:55 +00:00
Taran Singh
e272df9338 Merge "Handle cancelled Insets animation" into rvc-qpr-dev 2021-02-05 17:38:50 +00:00
Taran Singh
e2307d9a48 Handle cancelled Insets animation
If an Insets animation was cancelled before it could complete,
handle it gracefully.

Fix: 154381667
Test: Run monkey runner that on any window that has edit text
      atest InsetsControllerTests
Change-Id: I052a0455f536a1c839a2782e54f19143295ba6c6
2021-02-05 17:38:31 +00:00
Antoan Angelov
c6bda518da [RESTRICT AUTOMERGE] Revert "[RESTRICT AUTOMERGE] Remove DPMS#getProfileOwner in favor of getProfileOwnerAsUser"
This reverts commit 10f79644fc.

Reason for revert: Explained in b/153995973#comment40

Bug: 153995973

Change-Id: I437400528cb98e9ce665ebc308bfe05f4f24ca13
2021-02-05 11:59:48 +00:00
TreeHugger Robot
536ca6cad7 Merge "Only update native InputApplicationHandle once" into rvc-dev am: 274863f9d5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13210344

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2cad950c1c9320b5bce2f030896a4c33ec9b657a
2021-01-30 01:01:00 +00:00
TreeHugger Robot
274863f9d5 Merge "Only update native InputApplicationHandle once" into rvc-dev 2021-01-30 00:06:35 +00:00
Marco Ballesio
80a05232a0 ActivityManager: don't freeze processes holding file locks
As a temporary measure waiting for the more robust b/176927978 to be
implemented, query the file lock status of processes prior freezing
them, and skip freeze if any locks are held.

Test: verified form the logs that processes holding file locks are not
frozen
Bug: 176928302

Change-Id: Ib7e1715effb63c1b304ce22a9451294fd9f7b10d
Merged-In: Ib7e1715effb63c1b304ce22a9451294fd9f7b10d
2021-01-20 22:33:20 +00:00
Michael Wright
58515946ac DO NOT MERGE "Allow DeviceConfig to change display settings for high zone"
Allow DeviceConfig to change the high zone behavior including
refresh rate and brightness thresholds.

Bug: 177636374

Test: atest DisplayModeDirectorTest
Test: adb shell device_config put display_manager refresh_rate_in_high_zone "90"
Test: adb shell device_config put display_manager fixed_refresh_rate_high_display_brightness_thresholds "200"
Test: adb shell device_config put display_manager fixed_refresh_rate_high_ambient_brightness_thresholds "8000"
Change-Id: I1463d6c5daaee46a87a193e98e7f63cad9274b49
2021-01-19 01:07:01 +00:00
Joanne Chung
19e9f00346 Merge "Get ApplicationInfo using usr id" into rvc-qpr-dev 2021-01-15 07:56:55 +00:00
Joanne Chung
d96bcfcdf2 Get ApplicationInfo using usr id
Use ApplicationInfoAsUser() to get the application information by
user id to make sure we have correct permission, othewise we will
get the SecurityException due to lack of INTERACT_ACROSS_USERS.

Bug: 176313819
Test: atest CtsVoiceRecognitionTestCases
Test: manual.
      1.create profile user
      2.Install sample recognizer app
      3.Function works fine and no security exception occurred after
      apply the change

Change-Id: I6958dbf661373606fb9dba55e386aaea4399a146
Merged-In: Iaf485537b8082d2109d2134ff987dc7244e31218
2021-01-15 12:25:06 +08:00
raylinhsu
b14bed88c5 DO NOT MERGE Revert "Allow DeviceConfig to change display settings for high zone"
This reverts commit cf55c21064.

Bug: 176018998
Test: atest DisplayModeDirectorTest
Change-Id: Ib576e16257d7903b39efa8015c2af3be8c0d0c40
2021-01-13 14:04:08 +08:00
Alisher Alikhodjaev
aadceeb17a Merge "Nfc adapter randomly returns null on devices having Nfc" into rvc-qpr-dev 2021-01-11 23:08:40 +00:00
Kevin Hufnagle
5290b8d590 Merge "docs: Remove error in requestPermissions doc" into rvc-dev am: 05efe90a8d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13122154

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1f2497b843db9d953e225da17e16f92f93f2ad99
2021-01-11 19:53:53 +00:00
Kevin Hufnagle
05efe90a8d Merge "docs: Remove error in requestPermissions doc" into rvc-dev 2021-01-11 18:56:59 +00:00
TreeHugger Robot
37ff5c9d04 Merge "Protect account chooser activities against overlay." into qt-dev am: 7f2257fa0f am: 683623e8b0 am: be186dc33e am: 88e38a7d1c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13191817

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If31258e284c7bad73295eaffcc2a1011f4538ad6
2021-01-06 23:34:54 +00:00
TreeHugger Robot
88e38a7d1c Merge "Protect account chooser activities against overlay." into qt-dev am: 7f2257fa0f am: 683623e8b0 am: be186dc33e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13191817

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifab96b3897510a77e23ed02b3c0cb8ca57d21b65
2021-01-06 23:09:49 +00:00
TreeHugger Robot
be186dc33e Merge "Protect account chooser activities against overlay." into qt-dev am: 7f2257fa0f am: 683623e8b0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13191817

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9307ed863c033d169fb91994e976a94ca9267bf0
2021-01-06 22:51:18 +00:00
TreeHugger Robot
683623e8b0 Merge "Protect account chooser activities against overlay." into qt-dev am: 7f2257fa0f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13191817

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2f86ac2f6302f63f1dc3d11d93c1a99434ec4fb6
2021-01-06 22:15:09 +00:00
TreeHugger Robot
7f2257fa0f Merge "Protect account chooser activities against overlay." into qt-dev 2021-01-06 21:50:26 +00:00
Tiger Huang
e8bd5284d3 Notify visibility change if source visibility is changed
This makes view root dispatch the up-to-date WindowInsets to the app.

Fix: 166619182
Test: Steps in the bug (comment#12)
Change-Id: I8c47e3be84357f65084a7d9994f7d7b68f15611e
(cherry picked from commit fd94351305)
2021-01-06 17:56:34 +00:00
TreeHugger Robot
a428448b1e Merge "[RESTRICT AUTOMERGE] Remove DPMS#getProfileOwner in favor of getProfileOwnerAsUser" into rvc-qpr-dev 2021-01-06 17:21:50 +00:00
TreeHugger Robot
b8e8fe89e7 Merge "[RESTRICT AUTOMERGE] Make WPMS look for DOs and POs in the correct calling user" into rvc-qpr-dev 2021-01-06 15:36:36 +00:00
Alex Kershaw
72704403aa [RESTRICT AUTOMERGE] Make WPMS look for DOs and POs in the correct calling user
Currently, it will always look in user 0 since it uses the DPM from
mContext, which will always be from user 0 as WPMS is in the system
server process.

Extend DPMI to provide the necessary external helper API. This is
preferable to just using createContextAsUser before getting the DPM
instance since it avoids a second binding.

Fixes: 144048540
Fixes: 172682826
Bug: 153995973
Bug: 174642338
Test: atest com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testSetWallpaper_disallowed
Change-Id: I52b71000fac31ff6725ddded58206f69b263ae33
(cherry picked from commit 5b36ee3f1d)
2021-01-06 13:08:42 +00:00
Varun Shah
f20d333ada DO NOT MERGE: Disable StrictMode VM Policy check.
Disable the VM policy violation for intents that contain a content URI
but don't have FLAG_GRANT_URI_PERMISSION when scheduling alarms.

Fixes: 160426113
Test: atest CalendarProvider2Test
Change-Id: If6e4a03609fc3d03dde66bcaa3136b23662ccaeb
(cherry picked from commit 224822ecaf)
2021-01-05 21:27:13 +00:00
Jack Yu
23abf11a3a Nfc adapter randomly returns null on devices having Nfc
Try to get NfcAdapter from NfcManager only when nfc service interface is
ready.

Bug: 173184157
Test: manaul test
Change-Id: Ifcb0f60e23f01cafd8b6b5f6bc8522773ece23a6
(cherry picked from commit 3217255a4d)
2020-12-21 12:27:56 -08:00
TreeHugger Robot
bc8d872805 Merge "DO NOT MERGE Correctly reset cross-profile app-op" into rvc-qpr-dev 2020-12-17 16:27:45 +00:00
Alex Kershaw
f764d9e98f DO NOT MERGE Correctly reset cross-profile app-op
Delegate the resetting of the INTERACT_ACROSS_PROFILES app-op to
DevicePolicyManager, which knows whether it should be pre-granted and
knows to apply it equally across all users in the profile group.

Further unit tests for DevicePolicyManagerInternal will be added in
b/175440570 when we have the better infra for that.

The CrossProfileAppsServiceImpl changes look more complex than they are.
They consist of the following:
- Inclusive language changes to 'allowlist'
- Static imports of permissions to improve readability
- Previously, the setInteractAcrossProfilesAppOp method would set the
app-op for every user within the profile group of the 'calling user'.
However, given that we are now exposing this as a server-side internal
API where we need to pass in a user ID (from AppOpsService), we don't
necessarily have the guarantee that the 'calling user' is in the same
profile group. So we split it up: the client-side API and AIDL API still
set the app-op for the calling profile group, whereas the internal API
sets the app-op for every user within the profile group of the provided
user. The changes simply abstract away references to the 'calling user
ID'.

Fixes: 166561076
Bug: 175440570
Test: atest services/robotests/src/com/android/server/pm/CrossProfileAppsServiceImplRoboTest.java --verbose -c
Test: manual
Change-Id: I2181fe66022aaf6c3e6d784c0569d2f41ab66537
(cherry picked from commit d004f41188)
2020-12-17 13:27:34 +00:00
Sarah Chin
0d094ad38e Merge "Move phone ID to extra for action provision" into rvc-qpr-dev 2020-12-17 08:08:14 +00:00
Peiyong Lin
23ace73ac4 Merge "[GraphicsEnvironment] Avoid null access." into rvc-qpr-dev 2020-12-15 19:02:54 +00:00