Commit Graph

17947 Commits

Author SHA1 Message Date
Varun Shah
d95ce6779d Update deletion conditions for a package's UsageStats.
If a profile owner is defined for a specific user, do not delete usage
stats for a package on package deletion.

Bug: 197399948
Test: atest  UsageStatsTest [all]
Change-Id: I94a8e3dfca8ef4c7616f77944d61726e06043b85
Merged-In: I94a8e3dfca8ef4c7616f77944d61726e06043b85
2021-11-11 10:13:47 -08:00
Bernardo Rufino
f7c195b4e9 Merge "Fix background bypass via notifications" into qt-dev am: 22500563c1 am: 57af3050d2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14937196

Change-Id: I0bf46422d4f7d2621a33776a4c98375d566af117
2021-06-30 15:41:55 +00:00
Bernardo Rufino
57af3050d2 Merge "Fix background bypass via notifications" into qt-dev am: 22500563c1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14937196

Change-Id: I193bfe3aa08c2f397d037c2d5c71cfe854cd343d
2021-06-30 15:30:23 +00:00
Bernardo Rufino
14c1c7b4a7 Fix background bypass via notifications
This is a CP of ag/14736230 to qt-dev.

Apps were able to bypass BAL and BG-FGS restrictions by retrieving their
own notifications and firing their PI since those were allowlisted for
those operations.

Now we strip the token that granted them that ability
from notifications returned via NM.getActiveNotifications(), which
returns the notifications of the caller.

Notifications returned via notification listener APIs still contain such
token, as they should.

Bug: 185388103
Bug: 169821287
Test: Manually tested
Change-Id: I2ede0d639a560f6acacec3864a0a7d23af152ba5
Merged-In: I2ede0d639a560f6acacec3864a0a7d23af152ba5
(cherry picked from commit 5fbeff59df)
2021-06-24 18:15:04 +00:00
Aemon Cannon
d2317d0fac Merge "Add instrumented app to JAR path (isolated splits)" into qt-qpr1-dev 2021-04-28 22:38:41 +00:00
Christopher Tate
3c507386ca DO NOT MERGE - Disallow deletion of channels with FGS notifications am: 88380a00d5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13728411

Change-Id: I5c649a005fb5ad7bd904b64d03488a6be6ff30f7
2021-04-27 21:22:35 +00:00
Jason O'Brien
472e9444ac Add instrumented app to JAR path (isolated splits)
The base APK is loaded during normal execution even when isolated splits
are requested. This preserves that behavior during instrumented tests,
which previously skipped the base APK (causing class loading errors).

Test: tested on device with a trivial automated instrumented test
Bug: 146183755
Change-Id: Ia54072ee91b7c06cb4a787a8954ad2e69b322cac
(cherry picked from commit 6f2978c9fc)
2021-04-19 22:04:25 +00:00
Christopher Tate
88380a00d5 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
2021-03-19 04:24:45 +00:00
Christopher Tate
8cb7e0a881 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
(cherry picked from commit 39b3890268913bc2dc8b90671d042c0e9b4090d2)
2021-03-18 08:11:45 -07:00
Kevin Hufnagle
05efe90a8d Merge "docs: Remove error in requestPermissions doc" into rvc-dev 2021-01-11 18:56:59 +00:00
Tiem Song
a9565b2cb0 Update link for Permissions samples in Javadoc
Bug: 158042826
Change-Id: I71ab17b21b31ff6584facd023e4c4818b0ab1b55
Merged-In: I71ab17b21b31ff6584facd023e4c4818b0ab1b55
Test: N/A
2020-12-02 20:50:04 -08:00
Kevin Hufnagle
bd7aba8cbf docs: Remove error in requestPermissions doc
If an app has already been granted a permission and it requests that
permission again, the user shouldn't see a system dialog. Update the
documentation to reflect this intended behavior.

Test: m ds-docs-java

Bug: 157530031

Exempt-From-Owner-Approval: Docs-only change
Change-Id: I7096e17480831324dee72f4093cdaa064e3b9165
2020-11-24 18:30:38 -05:00
TreeHugger Robot
8b1151e4d5 Merge "[RESTRICT AUTOMERGE] Revert "[RESTRICT AUTOMERGE] Revert "Require permission to create trusted displays""" into rvc-dev 2020-10-16 18:26:02 +00:00
Charles Chen
c947b10f99 [RESTRICT AUTOMERGE] Revert "[RESTRICT AUTOMERGE] Revert "Require permission to create trusted displays""
This reverts commit ae03031efe.

Reason for revert: Merge the reverted patch by accident.

Bug: 162627132
Change-Id: Ic2f072730050cb47926cec6ed24af7ef9e5e7055
2020-10-13 01:14:25 +00:00
Linus Tufvesson
334190f26e Update javadoc for setLaunchDisplayId
.. to match behavior post I1f9662c2bd14b34e00fbc8ebb926538f0329c37a

Bug: 167593637
Test: Javadoc change only.
Change-Id: I4cb9fe4a5ae74b1474f9da39b6aeb3a374f8cf12
2020-10-09 09:54:40 +00:00
Pinyao Ting
df8bc34ba6 Fix the issue provider can be wrong when requesting slice permission am: e3eba1322b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12687714

Change-Id: Ie3fefe8638c85c5b887b62612cfd5c5a338b827b
2020-10-05 23:01:26 +00:00
Charles Chen
5c393cb830 Merge "[RESTRICT AUTOMERGE] Revert "Require permission to create trusted displays"" into rvc-dev 2020-09-29 05:59:59 +00:00
Charles Chen
ae03031efe [RESTRICT AUTOMERGE] Revert "Require permission to create trusted displays"
This reverts commit f21c885ca7.

Reason for revert: Have regression b/168268396.
Needs to pull out from Nov. builds.

Bug: 162627132

Change-Id: I29fa3937d1655a0cc7591abcfa2067f4fb2b2bcb
2020-09-29 03:21:52 +00:00
Pinyao Ting
149bb7e038 Fix the issue provider can be wrong when requesting slice permission
SlicePermissionActivity reads provider_pkg from intent, which can be
modified at will. As a result user might see incorrect package name in
the dialog granting slice permission.

Bug: 159145361
Test: manual
Merged-In: I8b66c02786df4096dad74b7e76255d5ddd1d609d
Change-Id: I8b66c02786df4096dad74b7e76255d5ddd1d609d
(cherry picked from commit 0ad32a2d70)
2020-09-24 19:06:32 +00:00
Pinyao Ting
e3eba1322b Fix the issue provider can be wrong when requesting slice permission
SlicePermissionActivity reads provider_pkg from intent, which can be
modified at will. As a result user might see incorrect package name in
the dialog granting slice permission.

Bug: 159145361
Test: manual
Merged-In: I8b66c02786df4096dad74b7e76255d5ddd1d609d
Change-Id: I8b66c02786df4096dad74b7e76255d5ddd1d609d
(cherry picked from commit 0ad32a2d70)
2020-09-24 19:06:07 +00:00
TreeHugger Robot
06adb3f55c Merge "Sanitize more of the notification text fields" into pi-dev am: c0ec138c47
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12512485

Change-Id: Ie8e9b9a1273f5fd48a038f16749a7ecdd85078cf
2020-09-09 23:57:36 +00:00
TreeHugger Robot
ceb7aefd6f Merge "Sanitize more of the notification text fields" into rvc-dev 2020-09-09 23:55:10 +00:00
Julia Reynolds
a19f9ed2b1 Sanitize more of the notification text fields
Test: manual; monitor SystemUI performance when an app tries to
post a messaging style notification with messages with long text
Bug: 158304295
Bug: 147358092

Merged-In: c953fdf6bc
Change-Id: I0e2ea12fc3351b1a56645b556720ea2306f5422a
(cherry picked from commit c953fdf6bc)
2020-09-03 19:42:23 +00:00
Julia Reynolds
8061246d4a Sanitize more of the notification text fields
Test: manual; monitor SystemUI performance when an app tries to
post a messaging style notification with messages with long text
Bug: 158304295
Bug: 147358092

Merged-In: c953fdf6bc
Change-Id: I0e2ea12fc3351b1a56645b556720ea2306f5422a
(cherry picked from commit c953fdf6bc)
2020-09-03 19:39:55 +00:00
Julia Reynolds
7857da6431 Sanitize more of the notification text fields
Test: manual; monitor SystemUI performance when an app tries to
post a messaging style notification with messages with long text
Bug: 158304295
Bug: 147358092

Merged-In: c953fdf6bc
Change-Id: I0e2ea12fc3351b1a56645b556720ea2306f5422a
(cherry picked from commit c953fdf6bc)
2020-09-03 19:38:08 +00:00
Andrii Kulian
f21c885ca7 Require permission to create trusted displays
Bug: 162627132
Test: atest VirtualDisplayTest#testTrustedVirtualDisplay
Test: atest
frameworks/base/packages/SystemUI/tests/src/com/android/systemui/bubbles
Test: atest DisplayTest
Test: atest VirtualDisplayTest#testTrustedVirtualDisplay
Test: atest VirtualDisplayTest#testUntrustedSysDecorVirtualDisplay
Test: adb logcat -b events

Change-Id: Id06b2013ef5fdeadf321f14f8b611c733031d54d
Merged-In: Id06b2013ef5fdeadf321f14f8b611c733031d54d
2020-09-01 13:22:29 +08:00
Jing Ji
3bda3bf8c6 Java docs update: Advise not to include PII in setProcessStateSummary
Bug: 161812603
Test: m -j offline-sdk-docs & manual verify the javadoc
Change-Id: I741bbf7b83badcd7f1610f31bbd41a49b8b975fb
2020-07-22 11:03:30 -07:00
Jing Ji
42ef19d57c Merge "Fix javadoc error in ApplicationExitInfo#getDefiningUid()" into rvc-dev 2020-07-09 18:11:00 +00:00
Jing Ji
219da992ad Fix javadoc error in ApplicationExitInfo#getDefiningUid()
Bug: 160875447
Test: m -j offline-sdk-docs & manual verify the javadoc
Change-Id: Iae09584b42990092166be3c9a2bb792fa2d0abef
2020-07-09 09:33:10 -07:00
Charles Chen
3b8e8d7631 Fix NPE when invoking Context#isUiContext
Add null checks in both ContextWrapper and before obtaining
ContextImpl#getOuterContext.

Test: atest ContextTest#testIsUiContext_ContextWrapper
fixes: 160037462
Change-Id: Ic6a71dd9ac4b195d219d6e5431f2f2b199a400fa
2020-07-08 23:58:58 +08:00
TreeHugger Robot
d70c7dda50 Merge "Fix Bundle#getParcelableArray call" into rvc-dev 2020-07-03 02:22:57 +00:00
Charles Chen
8deb612a14 Merge "Revert "Revert "Enable IMS and its config context to obtain UI component""" into rvc-dev 2020-07-01 23:21:51 +00:00
Tadashi G. Takaoka
c4a13e9b0b Fix Bundle#getParcelableArray call
Because Bundle.getParcelableArray() returns Parcelable[] object,
simply casting a return value to a typed array will cause
ClassCastException.

Bug: 158584842
Bug: 160120833
Test: manually install ArcNotificationTest2 and try inline reply
Change-Id: Idd8eaa412925ac826590d44a0db297aacef806d8
2020-06-30 14:18:49 +09:00
Charles Chen
ba4ffa4a6d Revert "Revert "Enable IMS and its config context to obtain UI component""
Test: atest StrictModeTest
Bug: 157027563
Bug: 159795597
Change-Id: I2a1b3fefa0bd82eeaa507c08fc4a79fc9f4391c5
2020-06-29 14:27:08 +00:00
Stanislav Zholnin
ebe2773f3d Merge "Add testAppOps test to TEST_MAPPING." into rvc-dev 2020-06-26 09:47:32 +00:00
Stanislav Zholnin
2a4f925537 Add testAppOps test to TEST_MAPPING.
Approval are here: ag/11091388.

Test: atest UidAtomTests#testAppOps
Change-Id: I571e549f57968a83b32f5871994ea7b1b74be3d0
2020-06-26 09:44:11 +00:00
TreeHugger Robot
9e7c46190a Merge "Revert "Enable IMS and its config context to obtain UI component"" into rvc-dev 2020-06-25 00:41:07 +00:00
Alistair Delva
71b8a0456c Revert "Enable IMS and its config context to obtain UI component"
Revert "Verify IMS to get display and WM"

Revert submission 11823238-ims_ui_context

Reason for revert:
Broke the following tests:
android.os.cts.StrictModeTest#testIncorrectContextUse_GetDisplay
android.os.cts.StrictModeTest#testIncorrectContextUse_GetSystemService
android.os.cts.StrictModeTest#testIncorrectContextUse_GetViewConfiguration
But was submitted with a bypass.

Reverted Changes:
I688b46a92:Verify IMS to get display and WM
I172ceb2e1:Enable IMS and its config context to obtain UI com...

Bug: 157027563
Bug: 159795597
Change-Id: Id309faac0ac8f60ee0d92c26767a89f450ddc455
2020-06-24 22:31:53 +00:00
Evan Severson
aacd48b0bc Implement permission revoke with reason
The reason is passed to app exit info so a given app can get more
information about why their app was killed in the event of permission
revoke.

Test: atest RevokePermissionTest ActivityManagerAppExitInfoTest#testPermissionChangeWithReason
Fixes: 159659620
Change-Id: Id711667eb2c1579ecb2a1b83a62af3cc7862d5f6
2020-06-24 10:03:54 -07:00
Charles Chen
8655743001 Merge "Enable IMS and its config context to obtain UI component" into rvc-dev 2020-06-24 03:33:53 +00:00
Jeff Sharkey
38a6333ff6 Merge "Override MIME type to match MediaStore behavior." into rvc-dev 2020-06-23 15:56:44 +00:00
Jeff Sharkey
83aaf908a6 Override MIME type to match MediaStore behavior.
Internally, DownloadManager synchronizes its contents with MediaStore,
which relies heavily on using file extensions to determine MIME types.

To prevent these two databases from getting confused, this change
adjusts DownloadManager to force the MIME type of already-completed
downloads based on the file extension, matching what MediaStore does.

Bug: 159594536
Test: atest PublicApiAccessTest#testAddCompletedWithoutExtension
Change-Id: I60c613eafcfe55007dffcac2d7d1fe375b753c19
2020-06-23 07:13:13 -06:00
Issei Suzuki
16868fbef0 Merge "Update virtual display size before turning it on." into rvc-dev 2020-06-23 11:46:16 +00:00
Kweku Adams
6cca001863 Merge "Disable restricted bucket." into rvc-dev 2020-06-23 00:13:41 +00:00
Charles Chen
d2fd037ab3 Enable IMS and its config context to obtain UI component
Test: atest StrictModeTest
Bug: 157027563

Change-Id: I172ceb2e17722a7cba917a6e3a808d7559cad3e0
2020-06-23 03:45:17 +08:00
Michael Groover
2bcb70322c Merge "Update docs for methods that require subscriberId" into rvc-dev 2020-06-22 19:30:10 +00:00
Hongwei Wang
997150ee0a Merge "Updates enterPictureInPicture API doc" into rvc-dev 2020-06-22 18:14:10 +00:00
Stanislav Zholnin
7a65a7a37c Merge "Prevent developer provided strings from being uploaded through statsd." into rvc-dev 2020-06-22 08:10:52 +00:00
TreeHugger Robot
48e9dc67f1 Merge "Revert "Fix transition return issues when more than 1 level depth"" into rvc-dev 2020-06-22 03:04:37 +00:00
Jeff Chang
79f5a49b3c Revert "Fix transition return issues when more than 1 level depth"
This reverts commit 6d834d86fb.

Reason for revert: <http://b/159230864 WhatsApp image is visible after existing a chat>
Bug: 159230864

Change-Id: Ib266cff2e06a82ae9a0e85142ef80ae00328a040
2020-06-20 06:09:04 +00:00