Commit Graph

20493 Commits

Author SHA1 Message Date
Kholoud Mohamed
a09e44982d Merge "Add testAPI to get adopted shell permissions." into sc-dev 2021-04-06 16:50:05 +00:00
Jeff DeCew
6a39b82e8b Merge "Do not highlight group expanders" into sc-dev 2021-04-06 15:10:57 +00:00
kholoud mohamed
0ac02444e8 Add testAPI to get adopted shell permissions.
Added a new testAPI in UiAutomation to get the currently adopted
shell permissions using adoptShellPermissionIdentity.

Test: atest UiAutomationTest
Bug: 183716601
Change-Id: I66a6c753480cecf971f7354daaddbb404f5c1453
2021-04-06 14:08:03 +00:00
Roshan Pius
a88aa31269 UwbManager: Use AttributionSource for runtime permission enforcement
This attribution source is going to be used by Gmscore to proxy
the blame for uwb_ranging runtime permission check (since Gmscore which
is the direct caller of this surface is in most cases proxying the
request from 1p/3p apps).

Note: This CL just adds the skeletal API to start the API reviews. The
actual implementation needs a major refactor of the stack which is WIP.

Bug: 183904955
Test: atest android.uwb
Change-Id: Ia0338b573306f44c493bf1c136e68b4f46877816
2021-04-05 17:31:31 -07:00
Jeff DeCew
018dd31970 Do not highlight group expanders
Bug: 181048615
Test: manual
Change-Id: I491e0cf5aeb97bf6baf13a467481dd799893106e
2021-04-05 20:21:06 +00:00
Yuri Lin
048571dd57 Remove notification channels from history when they're deleted.
To make this possible, this change adds functionality for notification channel removal to NotificationHistory, NotificationHistoryDatabase, and NotificationHistoryManager and corresponding tests.

This change does not remove the notifications from deleted channels from the "recently dismissed" list (stored in mArchive); will follow up with that later.

Test: atest NotificationHistoryTest, NotificationHistoryDatabaseTest, NotificationManagerServiceTest; manual via creating channels, deleting them and verifying
Bug: 169349809

Change-Id: I7b1c137e516d14703665750f06554ac7ca44c90e
2021-04-05 10:49:07 -04:00
Julia Reynolds
47fe65234f Merge "Allow apps to migrate NLS filter settings" into sc-dev 2021-04-05 13:30:57 +00:00
Svetoslav Ganov
6f7e03244d Merge "Hookup renounced permissions" into sc-dev 2021-04-05 00:55:30 +00:00
Jeff DeCew
7116f04929 Merge "Fix NPE in obtainThemeColor due to use of Mocks" into sc-dev 2021-04-02 20:52:37 +00:00
Caitlin Cassidy
4be0810f5b Merge "[Ongoing Call Chip] Add feature flag + controller" into sc-dev 2021-04-02 18:12:20 +00:00
Jeff DeCew
6ec691868b Fix NPE in obtainThemeColor due to use of Mocks
Fixes: 184358158
Test: atest DisconnectedCallNotifierTest
Change-Id: Ia561e262e288d71b93cc18e842eefcba054a32d8
2021-04-02 13:32:26 -04:00
Svet Ganov
48801b0bbd Hookup renounced permissions
Propagate renounced permissions from context params
to the context attribution source. Throw if one
tries to request at runtime a renounced permission.

Also make the AttributionSource take null for the
setters to ease usage, otherwise folks should always
check for null before calling a builder method.

Additionally, we allow apps that have UPDATE_APP_OPS_STATS
to register arbitrary trusted AttributionSource for
testing. Note that this permission allows abritrary app
op operations, thus we are not relaxing the security
model.

bug: 158792096

Test: atest CtsPermission5TestCases

Change-Id: I4330684bb8695fb998cf31e9363b94ad981ba2cc
2021-04-02 17:30:10 +00:00
Julia Reynolds
0e36d959d0 Allow apps to migrate NLS filter settings
On a per user vs manifest wide basis.

Test: atest, cts-verifier
Bug: 184027330
Change-Id: Iae591765e410e360f289692bac012a1f26574add
2021-04-02 17:04:58 +00:00
Jeff Sharkey
a1d8bbb3ba Merge changes from topic "uwb_ranging_permission" into sc-dev
* changes:
  Add a new uwb ranging app-ops
  Add a new uwb ranging runtime permission
2021-04-02 14:45:57 +00:00
Roshan Pius
f5b1cf217e Add a new uwb ranging app-ops
This will be part of the nearby devices permission group.

Bug: 183904955
Test: Compiles
Change-Id: I8d225f6b9f40cc106aeb5ad661282cd394d7b826
2021-04-01 14:07:35 -07:00
Caitlin Cassidy
6a0fdd47e5 [Ongoing Call Chip] Add feature flag + controller
Bug: 183229367
Test: atest ran and manual
Change-Id: I8f754f4d894999a4bd5c13db81324e9abe204747
2021-04-01 18:38:54 +00:00
Jeff DeCew
2016350655 Merge "Remove unused code" into sc-dev 2021-04-01 16:24:26 +00:00
Jeff DeCew
9c95884765 Merge "Notification color fixes" into sc-dev 2021-04-01 14:34:45 +00:00
Kholoud Mohamed
58d0a2a950 Merge "Remove DATA_SHARING_RESTRICTION_CHANGED broadcast" into sc-dev 2021-04-01 14:21:00 +00:00
arangelov
4e75a9dc76 Update description for skip ownership screen extra
Bug: 175238386
Fixes: 179307805
Test: compiled
Change-Id: I5633a9145992eff12c3796fedd28aba339f5be43
2021-04-01 12:09:02 +00:00
kholoud mohamed
1192835a56 Remove DATA_SHARING_RESTRICTION_CHANGED broadcast
This broadcast was previously used to notify Managed Provisioning
that data sharing restrtiction has changed, this is no longer handled
in Managed Provisioning and is now handled in DPMS.

Fixes: 177221010
Test: N/A
Change-Id: I4e3fbb94c41f944afb41e226c06d1fffcc8bc264
2021-04-01 11:47:04 +00:00
Zhen Zhang
bf5667bec6 Merge "Persist user-agnostic lastTimeAnyComponentUsed in disk" into sc-dev 2021-03-31 22:43:53 +00:00
Nikita Dubrovsky
2bb75a4007 Merge "Rename getOnReceiveContentMimeTypes (drop "On")" into sc-dev 2021-03-31 21:06:21 +00:00
Zhen Zhang
131f53fdf4 Persist user-agnostic lastTimeAnyComponentUsed in disk
Persist the user-agnostic lastTimeAnyComponentUsed usage stats in disk.

Bug: 183462940
Test: atest UsageStatsServiceTest
Test: atest UserStatsPersistenceTest
Test: atest CtsUsageStatsTestCases:UsageStatsTest

Change-Id: Ibe946f8e9fd9fa7d9ba546da67a6040c00e0f9ea
2021-03-31 11:27:26 -07:00
Mady Mellor
3da85d8e80 Merge "API: Expose whether bubbles are enabled or not" into sc-dev 2021-03-31 16:53:16 +00:00
TreeHugger Robot
456fb2e78b Merge "Improve javadocs for new S constants" into sc-dev 2021-03-31 13:49:46 +00:00
Zhen Zhang
eed249828f Merge "Create package-level last time usage stats for app hibernation" into sc-dev 2021-03-31 09:04:50 +00:00
Louis Chang
3f790d2eba Merge "Dump warning logs to prevent app crash while no top-resumed changes" into rvc-qpr-dev am: b6d433cdbd am: 2b5dae1c57
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13896651

Change-Id: I4719a6ff203dafa59fd688f405efe44f19c1577b
2021-03-31 07:17:54 +00:00
Louis Chang
2b5dae1c57 Merge "Dump warning logs to prevent app crash while no top-resumed changes" into rvc-qpr-dev am: b6d433cdbd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13896651

Change-Id: I199c71ab75007a6fef25c71ecf433d2f939e43e9
2021-03-31 06:55:05 +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
Svet Ganov
7d058d62e5 Addressing comments from commit:8d2ed5
bug:158792096
bug:180647319
bug:184051153
bug:184027531

Test:atest CtsPermissionTestCases
     atest CtsPermission2TestCases
     atest CtsPermission3TestCases
     atest CtsPermission4TestCases
     atest CtsPermission5TestCases
     atest CtsAppOpsTestCases
     atest CtsAppOps2TestCases
     atest CtsAlarmManagerTestCases

Change-Id: Id324ed0e2a653dface6ba273bba27e92bea14f99
2021-03-31 02:11:46 +00:00
Mady Mellor
c5561c9c5c API: Expose whether bubbles are enabled or not
There's no way for devs to check whether the user has
disabled or enabled bubbles at the feature level. This
adds an API for devs to make this query.

Test: atest NotificationManagerTest NotificationManagerServiceTest
Bug: 171162184
Change-Id: I3b201e8267f36b45473987db773c08663b8d8126
2021-03-30 18:59:11 -07:00
Zhen Zhang
b8b107372a Create package-level last time usage stats for app hibernation
Create a user-agnostic package-level last time used usage stats for app
hibernation. Usage is updated when USER_INTERACTION or
APP_COMPONENT_USED event reported. Also moved checkAndGetTimeLocked and
convertToSystemTimeLocked methods up to UsageStatsService class and
refactored usages.

Bug: 183142974
Test: atest CtsUsageStatsTestCases:UsageStatsTest
Test: atest UsageStatsServiceTest
Test: atest UserUsageStatsServiceTest

Change-Id: I93d8653bb92b98af8f6b57156eb1139fbd7e562a
2021-03-30 16:16:08 -07:00
Jeff DeCew
d11b3561c9 Notification color fixes
* Change Notification.isColorized() to return false if the given color is COLOR_DEFAULT.  This removes an odd, inconsistent, and likely unused state.
* Remove config_tintNotificationsWithTheme which we're not going to be using to reduce the color palette complexity.
* Change ensureColors() to use the theme's primary/secondary text colors.
* Numerous simplifications in logic that fall out from these changes.

Bug: 181048615
Test: atest NotificationComparatorTest NotificationTest AppOpsCoordinatorTest NotificationGutsManagerTest NotificationManagerServiceTest NotificationBuilderTest
Change-Id: Ie49cc9f3f9ea01685ae026587e2d1cdb96391eb2
2021-03-30 15:56:39 -04:00
arangelov
307c5cfd17 Improve javadocs for new S constants
- Distinguish between PROVISIONING_TRIGGER_PERSISTENT_DEVICE_OWNER
and PROVISIONING_TRIGGER_MANAGED_ACCOUNT
- Explain difference between
PROVISIONING_MODE_MANAGED_PROFILE_ON_PERSONAL_DEVICE and
PROVISIONING_MODE_MANAGED_PROFILE
- Improve deprecation message for ACTION_PROVISION_MANAGED_DEVICE

Test: compiled
Fixes: 179709752
Change-Id: Id56316982581cf98dab78ef0b09c9243960d2893
2021-03-30 18:10:18 +01:00
Jeff DeCew
f05199069c Merge "Fix the text color in the highlighted expander" into sc-dev 2021-03-30 13:01:50 +00:00
Makoto Onuki
d0b0f4ce83 Merge "Add TEMPORARY_ALLOW_LIST_TYPE_NONE." into sc-dev 2021-03-29 21:32:40 +00:00
Svetoslav Ganov
a6c3d6ad39 Merge "Runtime permission attribution improvements" into sc-dev 2021-03-29 21:03:06 +00:00
Jeff DeCew
f0c7dbbb1a Remove unused code
Bug: 181048615
Test: manual
Change-Id: I69dc97c2ced3025e7b8b9809bdb0ac7954b862d2
2021-03-29 16:32:05 -04:00
Yuri Lin
e0d692833e Merge "Delete deleteConversationNotificationChannels from NotificationManagerService." into sc-dev 2021-03-29 19:39:25 +00:00
Jeff DeCew
f8b8e45cb2 Fix the text color in the highlighted expander
Bug: 183710694
Test: manual
Change-Id: Ib95fbb4409e98004f0ea57befec3923508577cce
2021-03-29 15:16:08 -04:00
Mustafa Emre Acer
7c4f635b3b Merge "Expose TimeManager.suggestExternalTime()" into sc-dev 2021-03-29 18:46:59 +00:00
Yuri Lin
c5f668e141 Delete deleteConversationNotificationChannels from NotificationManagerService.
This method isn't used anywhere and its functionality is superseded by onConversationRemoved, which handles deleted conversations.

Test: atest NotificationManagerServiceTest
Bug: 169349809

Change-Id: Iad7f592e71ecf425930e31873088a02e298380b3
2021-03-29 17:20:36 +00:00
Richard Ho
2335acd9a2 Merge changes from topic "nearby-streaming-policy" into sc-dev
* changes:
  Add policy for nearby app streaming
  Add policy for nearby notification streaming
2021-03-29 17:12:03 +00:00
Svet Ganov
8d2ed50604 Runtime permission attribution improvements
When an app is proxying access to runtime permission protected
data it needs to check whether the calling app has a permission
to the data it is about to proxy which leaves a trace in app ops
that the requesting app perofmed a data access. However, then the
app doing the work needs to get the protected data itself from the
OS which access gets attributed only to itself. As a result there
are two data accesses in app ops where only the first one is a
proxy one that app A got access to Foo through app B - that is the
one we want to show in the permission tracking UIs - and one
for the data access - that is the one we would want to blame on
the calling app, and in fact, these two accesses should be one -
that app A accessed Foo though B. This limitation requires fragile
one off workarounds where both accesses use the same attribution
tag and sys UI has hardcoded rules to dedupe. Since this is not
documented we cannot expect that the ecosystem would reliably
do this workaround in apps that that the workaround in the OS
would be respected by every OEM.

This change adds a mechaism to resolve this issue. It allows for
an app to create an attribution context for another app and then
any private data access thorugh this context would result in a
single app op blame that A accessed Foo though B, i.e. we no longer
have double accounting. Also this can be nested through apps, e.g.
app A asks app B which asks app C for contacts. In this case app
B creates an attribution context for app A and calls into app C
which creates an attribution context for app B. When app C gets
contacts the entire attribution chain would get a porper, single
blame: that C accessed the data, that B got the data from C, and
that A got the data form B. Furthermore, this mechanism ensures
that apps cannot forget to check permissions for the caller
before proxying private data. In our example B and C don't need
to check the permisisons for A and B, respectively, since the
permisisons for the entire attribution chain are checked before
data delivery. Attribution chains are not forgeable preventing
a bad actor to create an arbitrary one - each attribution is
created by the app it refers to and points to a chain of
attributions created by their corresponding apps.

This change also fixes a bug where all content provider accesses
were double counted in app ops due to double noting. While at
this it also fixes that apps can now access their own last ops.
There was a bug where one could not pass null getting the attributed
ops from a historical package ops while this is a valid use case
since if there is no attribution everything is mapped to the null
tag. There were some app op APIs not being piped thorough the app
ops delegate and by extension through the app ops policy. Also
now that we have nice way to express the permission chain in a
call we no longer need the special casing in activity manager to
handle content provider accesses through the OS. Fixed a bug
where we don't properly handle the android.os.shell calls with
an invlaid tag which was failing while the shell can do any tag.

Finally, to ensure the mechanims is validated and works end-to-end
we are adding support for a voice recognizer to blame the client
app for the mic access. The recognition service can create a blaming
context when opening the mic and if the mic is open, which would
do all permission checks, we would not do so again. Since changes
to PermissionChercker for handling attribution sources were made
the CL also hooks up renounced permissoins in the request permission
flow and in the permission checks.

bug:158792096
bug:180647319

Test:atest CtsPermissionsTestCases
     atest CtsPermissions2TestCases
     atest CtsPermissions3TestCases
     atest CtsPermissions4TestCases
     atest CtsPermissions5TestCases
     atest CtsAppOpsTestCases
     atest CtsAppOps2TestCases

Change-Id: Ib04585515d3dc3956966005ae9d94955b2f3ee08
2021-03-29 16:49:33 +00:00
Jeff Chang
d4a142719e Merge "Update saving persistent state documentation" into sc-dev 2021-03-29 10:57:28 +00:00
Nikita Dubrovsky
f3ebaed6e4 Rename getOnReceiveContentMimeTypes (drop "On")
Bug: 179143943
Test: Presubmit
Change-Id: Ib2109f0a45c25ae6c4507a9199bf8b34fc394af5
2021-03-26 10:48:58 -07:00
Jeff DeCew
d1cc1421df Merge "Fix regressions with DecoratedCustomViewStyle" into sc-dev 2021-03-26 02:11:02 +00:00
Chris Tate
d8022c3d5b Merge "Make FGS notification deferral control tri-state" into sc-dev 2021-03-25 23:50:36 +00:00
Mustafa Acer
5265da19f9 Expose TimeManager.suggestExternalTime()
This CL exposes an API that allows system clock time suggestions from an
external clock / time source to be made. The nature of "external" could
be highly form-factor specific. Example, times obtained via the VHAL for
Android Auto OS.

Bug: 157504928
Bug: 177079827
Test: atest android.app.time
CTS-Coverage-Bug: 182275086
Change-Id: I3527e3827a03c1df73fdc1e00c815ad5971a92ca
2021-03-25 21:17:19 +00:00