Commit Graph

20704 Commits

Author SHA1 Message Date
Svetoslav Ganov
720add59c7 Merge "Prepare AttributionSource to expose to native" into sc-dev 2021-05-05 23:23:54 +00:00
Chavi Weingarten
9a0bcd29df Merge "Capture layer and children when calling takeSurfaceControlScreenshot" into sc-dev 2021-05-05 19:43:52 +00:00
TreeHugger Robot
969a1a8643 Merge "Add javadoc for trampoline restrictions" into sc-dev 2021-05-05 18:41:38 +00:00
Tom Natan
43bf4624ec Merge "Add an API method for clearing compat overrides on release builds" am: b9680bac79 am: 9e9e1c4af5 am: 65654644bc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1688626

Change-Id: Id1b221629fee21648ee2a4683ab9a34b2efef1d6
2021-05-05 16:41:16 +00:00
Tom Natan
65654644bc Merge "Add an API method for clearing compat overrides on release builds" am: b9680bac79 am: 9e9e1c4af5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1688626

Change-Id: Ic1b9bb5b3f6cfba5192838020fc1b9770715f80a
2021-05-05 16:13:03 +00:00
Bernardo Rufino
0875925d06 Add javadoc for trampoline restrictions
Added to notification APIs and browser exemption in ROLE_BROWSER in
topic CL.

Bug: 167676448
Test: Builds
Change-Id: Ibb4bee91fc2b8fcd8bbe194812cc8c3fa22c41ec
2021-05-05 16:41:42 +01:00
Tom Natan
b9680bac79 Merge "Add an API method for clearing compat overrides on release builds" 2021-05-05 14:58:41 +00:00
tomnatan
2697018f70 Add an API method for clearing compat overrides on release builds
This will be useful when we want to clear overrides for apps that are no longer needed regardless of the version that is installed on device, e.g., when an app is being uninstalled, when we want to rollback an override, or when we deprecate a change-id.

In addition, rename CompatChanges#setPackageOverride to
addPackageOverrides.

Bug: 183183372
Test: atest FrameworksServicesTests:CompatConfigTest
Test: atest FrameworksServicesTests:PlatformCompatTest
Change-Id: Iff416c8b4c88b5eddc9e21c73219198d23266fa1
2021-05-05 07:10:41 +00:00
Louis Chang
ba6bf9dad3 Merge "Remove WINDOWING_MODE_FULLSCREEN_OR_SPLIT_SCREEN_SECONDARY" into sc-dev 2021-05-04 23:42:51 +00:00
chaviw
80bb00b977 Capture layer and children when calling takeSurfaceControlScreenshot
When calling UiAutomationConnection.takeSurfaceControlScreenshot, it
should capture the requested SurfaceControl and its children. The
current code only captures the children. Therefore, call setChildrenOnly
with false to ensure it captures the parent, as well.

Test: ASurfaceControlTest
Bug: 185390632
Change-Id: I62707f808934177c8db05485ac28559982b8c607
2021-05-04 14:32:48 -05:00
Alex Buynytskyy
1e5cf8f1ff Customer API feedback.
Use two separate interfaces for flags and single value. This produces
correct API documentation.

Bug: 160605420
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest
Change-Id: I9a7eaf86af558d8dcfd1636a4baf6a28e2ee79b1
2021-05-04 15:24:02 +00:00
Anna Zappone
8315904e81 Merge "Handle work profile, DND state, app pauses" into sc-dev 2021-05-04 15:16:52 +00:00
Stanislav Zholnin
3476ed1d68 Merge "Add more explanation on difference between aggregate and discrete information." into sc-dev 2021-05-04 11:23:40 +00:00
Alex Johnston
345ff0cc74 Merge "DPM Check for unaffiliated secondary users" into sc-dev 2021-05-04 10:23:39 +00:00
Svet Ganov
4bf102ae26 Prepare AttributionSource to expose to native
Separate the internal state of AttributionSource from the
class to make it a simple AIDL we can translate automatically
to native - keeping Java and native parts in sync. This
would allow writing a thin native lib for checking attribution
source permissions which would be used to teach camera and
audio about attributions.

Deinfe an AIDL interface for passing around an attribution
source and opr performing permission checker oprations allowing
native and Java permission checks on attribution chains to be
handled. The Java side permission checker functions are in a dedicated
permisison checker service on top of which sits the PermissionChecker.
We expose similar PermissionChecker native APIs sitting on top
of the same remote interface. The nice thing is that we have
native and Java permisison checkers in sync sharing remoting
code and being close in shape.

For now the PermissionChecker in Java is divorced from the
PermissionManager but in T we will consider how to unify them,
either by an extension object on the PermmissionManager or
APIs on the PermissionManager, or another approach, and then
migrate clients off the PermissionChecker APIs.

Sync app ops were not tracked across multiple binder calls which
prevents moving the permission checks in the system server as
this adds one more hop. Now sync ops are propagated backed the
call stack and only the ops for the package are dispatched to
it and the rest are propagated back to the caller, recursively.

bug: 158792096

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

Change-Id: Ia5cbd2eb20a2da172a5960afdddd7e467f4bcb0d
2021-05-04 07:42:45 +00:00
Louis Chang
3100c1e4f4 Merge "Do not relaunch bg activities when application info changes" into sc-dev 2021-05-04 04:06:48 +00:00
Svetoslav Ganov
70e272de83 Merge "Use the correct switch for AR bypass" into sc-dev 2021-05-03 19:13:09 +00:00
Stanislav Zholnin
dd60f56455 Add more explanation on difference between aggregate and discrete
information.

Bug: 185226805
Test: Change limited to docs, no tests.
Change-Id: If041bad776d60dcfe018ef4d095f3e68e33a9e8d
2021-05-03 19:08:32 +01:00
Anna Zappone
1b12d3d473 Handle work profile, DND state, app pauses
Listen and respond to changes in state on background thread. Store in-memory to avoid
requerying frequently

Test: PeopleSpaceWidgetManagerTest, PeopleTileViewHelperTest,
PeopleSpaceUtilsTest
Bug: 182891880
Change-Id: Id0142b02bb549275c77d8940cda4eb1f0bf4e947

Change-Id: I65712a7a43d8956499533689fe77afbeeac5bd6e
2021-05-03 17:23:28 +01:00
Eran Messeri
84b3b6fb99 Merge "Document access to device identifiers on managed devices" into sc-dev 2021-05-03 07:27:22 +00:00
Ruslan Tkhakokhov
bdd1f279c5 Merge "Make changes guarding the new opt-out scheme overridable" into sc-dev 2021-05-01 13:22:21 +00:00
Svet Ganov
05d15ce5ad Use the correct switch for AR bypass
bug: 182204957

Test: atest CtsPermissionTestCases

Change-Id: Ic43106ced06bcca2a9abded299671ce92aacf938
2021-05-01 01:25:51 +00:00
Florian Mayer
748c3a8040 Merge changes from topic "playprofileable" into sc-dev
* changes:
  Add packageInstaller to packages.list.
  Add profileable opt-out to packages.list.
2021-04-30 20:42:16 +00:00
Kurt Dresner
3a4ecbf88f Merge "Make PROJECTION_TYPE_ALL=-1 so that all bits are on." into sc-dev 2021-04-30 18:23:24 +00:00
TreeHugger Robot
78a91deb5e Merge "Change streaming policy implementations" into sc-dev 2021-04-30 13:34:01 +00:00
Florian Mayer
6ea939f3bf Add profileable opt-out to packages.list.
We now have two notions of profileable:
 * profileable from shell: the user can profile the app using ADB-based
   tools (e.g. Android Studio or shell) . This is off unless the app
   opts in.
 * profileable from platform services: trusted platform services can,
   in accordance to the app installer's Terms Of Service profile the
   app. This is the default unless the app opts out. This is enforced
   by the profilers with information provided by the framework.

A new flag <profileable android:enable="false"/> can be used to opt out
of profiling in general. If this is not given, the app is considered
profilable by the platform, but the data will *not* be exposed to the
user via shell or adb. If profiles of the app should be given to the
user (e.g. for using Android Studio), <profileable
android:shell="true"/> can can still be used.

We write whether the app opted out or not to packages.list, to be
consumed by the profilers.

CTS-Coverage-Bug: 186720347

Test: m
Test: on userdebug: /data/system/packages.list for preinstalled, Play
      Store installed app and sideloaded app.
Test: on user: atest CtsPerfettoTestCases.
Bug: 170284829

Change-Id: I8d4bbedc043976fd11a95a511bd95a05c7ced7b9
2021-04-30 11:52:31 +00:00
Ruslan Tkhakokhov
a40ec3b70a Make changes guarding the new opt-out scheme overridable
Mark app compat changes guarding the new opt-out rules for D2D transfers
as @Overridable. This allows enabdling / disabling the behaviour without
code changes.

Bug: 186833084
Test: m -j
Change-Id: I97396bd2a27c86ffccffec364cf57d9647bb760d
2021-04-30 11:15:08 +01:00
Alex Johnston
9bedbd28b8 DPM Check for unaffiliated secondary users
* Add authorization check in DPMS for API
  methods to set the private DNS mode and
  the recommended global proxy.
* When there is a unaffiliated user, it is
  assumed that it is managed separately.
* These are device-wide policies that affect
  all users, so should only be set when it is
  the same managing entity and all users on
  the device are affiliated.

Bug: 177926343
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testProxyPacProxyTest
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testProxyStaticProxyTest
Change-Id: I119a84988ad3cda42b709dbc6d63acf76b0031d6
2021-04-30 10:09:51 +01:00
Hui Yu
e37fdc9e8a Merge "Do not allow FGS start when temp allowlist reasonCode is REASON_PUSH_MESSAGING_OVER_QUOTA" into sc-dev 2021-04-30 06:26:39 +00:00
Richard Ho
de8fe06dfa Change streaming policy implementations
- Use userId in streaming policy getters.
- Check if PO or DO exist
- Return NEARBY_STREAMING_NOT_CONTROLLED_BY_POLICY if DPC is not
present.

Bug: 179910174
Bug: 179910177
Test: Builds successfully
Change-Id: I49191a4ddea45925772d39614f5d7f82657b26ee
2021-04-29 19:31:56 -07:00
Nate Myren
4399632290 Merge "Add RECORD_INCOMING_PHONE_AUDIO app op" into sc-dev 2021-04-30 00:30:20 +00:00
Hui Yu
a6b92260d3 Do not allow FGS start when temp allowlist reasonCode is REASON_PUSH_MESSAGING_OVER_QUOTA
If temp allowlist reasonCode is REASON_PUSH_MESSAGING_OVER_QUOTA, check
DeviceConfig key "push_messaging_over_quota_behavior" to decide if
temp allowlist and FGS start are allowed. Three options:
1. -1, temp allowlist not allowed, FGS start not allowed.
2. 0, temp allowlist allowed, FGS start allowed.
3. 1, temp allowlist allowed, FGS start not allowed. This is default.

The device config command to change the behavior:
adb shell device_config set activity_manager push_messaging_over_quota_behavior <-1|0|1>

If temp allowlist reasonCode is REASON_DENIED, do not allow temp allowlist
at all.

Also, in DeviceIdleController.addPowerSaveTempAllowlistAppInternal(),
there used to be a check if the callingUid is on the mPowerSaveWhitelistSystemAppIds list,
this is unnecessary because upstream callers already checked if callingUid has
 permission CHANGE_DEVICE_IDLE_TEMP_WHITELIST, and this permission is a privileged permission,
so removing the check of mPowerSaveWhitelistSystemAppIds should be safe.

Bug: 182796372
Test: atest cts/tests/app/src/android/app/cts/ActivityManagerFgsBgStartTest.java#testPushMessagingOverQuota
Test: atest cts/tests/app/src/android/app/cts/ActivityManagerFgsBgStartTest.java#testTempAllowListReasonCode

Change-Id: Id34b1c26c819dc4fe07838eb2e3a8f0138cbcf8f
2021-04-29 16:27:41 -07:00
Hyunyoung Song
ce5f5faab8 Merge "API council review for SearchUiManager" into sc-dev 2021-04-29 15:52:12 +00:00
Eran Messeri
e192379833 Document access to device identifiers on managed devices
Document when, on a managed device or profile, the DPC can
read hardware identifiers, and when it must use the new
enrollment-specific ID.

Bug: 172636282
Test: m docs
Change-Id: I783725853d0654d49518a38d8d8d04b3ca7e3ab0
2021-04-29 10:33:07 +01:00
Martijn Coenen
166400b045 Merge "Revert "Revert "Fixup app-private dirs that are not writable.""" into sc-dev 2021-04-29 09:02:45 +00:00
Hyunyoung Song
1717e02ea6 API council review for SearchUiManager
Bug: 184265048
Test: atest CtsSearchUiServiceTestCases

Change-Id: Ib4dd0d3b29438418d4deb31e999a076e5eeff484
2021-04-28 20:57:11 -07:00
Chris Li
328079de27 Merge "Determine whether to support activities in multi window (1/n)" into sc-dev 2021-04-29 01:09:53 +00:00
Felipe Leme
056452001f Merge "Disabled DevicePolicyManager.setLocationEnabled() for automotive." into sc-dev 2021-04-28 16:31:45 +00:00
Martijn Coenen
d6b7b6b3aa Revert "Revert "Fixup app-private dirs that are not writable.""
Fixup non-writable app-private dirs that could have been left around by
an earlier race condition in the setup of the FUSE filesystem.

Bug: 181726193
Bug: 182088154
Test: erase userdata, check Youtube dirs are fixed up correctly

Reason for revert: fixing issue in original CL

Change-Id: Ifacf807f62dec3c9e22b5e5af0f2b00c4423ede4
2021-04-28 15:23:15 +00:00
Adrian Roos
3e7a628f0f Merge "Revert "Fixup app-private dirs that are not writable."" into sc-dev 2021-04-28 15:17:46 +00:00
Adrian Roos
20705fdb10 Revert "Fixup app-private dirs that are not writable."
This reverts commit 13f793aec9.

Reason for revert: Breaks device health checks; crashes if dir is null.

Bug: 181726193
Bug: 182088154

Fixes: 186633787
Change-Id: Ia28df79c6ff4aacd6bdadf1d9c540f49dcace707
2021-04-28 15:16:55 +00:00
Martijn Coenen
8e176d97ae Merge "Fixup app-private dirs that are not writable." into sc-dev 2021-04-28 13:43:51 +00:00
Tom Natan
ba2767ef4a Merge "Document version codes in CompatChanges API" am: d4691f8a31 am: de7b72d03e am: bfc894c34f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1688067

Change-Id: I6bc5d31fa7fc02194fd7e638658f7120f1b68500
2021-04-28 10:26:25 +00:00
Tom Natan
bfc894c34f Merge "Document version codes in CompatChanges API" am: d4691f8a31 am: de7b72d03e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1688067

Change-Id: Ibf988dded00d18d3ceb7e7642e466641eea27862
2021-04-28 10:00:17 +00:00
Stanislav Zholnin
bd45b82617 Merge "Bug fixes and testing support for DiscreteRegistry" into sc-dev 2021-04-28 09:09:35 +00:00
Louis Chang
33a4336877 Do not relaunch bg activities when application info changes
Update the configurations via ActivityTaskManager to prevent the
activities being relaunched while in background. Instead, the
activities will be relaunched after brought to front and being visible.

This also prevents all activities in the system being relaunched
at the same time.

For framework resource updates, the global configuration will be
updated.

For individual package overlay changes, new asset sequence would be
set to the activity's requested configurations to ensure the activity
will be relaunch once visible. The requested asset sequence will be
reset if its parent has a newer asset sequence.

Bug: 185301309
Test: update app info via shell command while activity in background
Test: atest ResourcesLoaderValuesTest
Test: atest RoleManagerTest#requestRoleAndAllowThenIsRoleHolder
Change-Id: Ic7f13b768fb575d6301f05f7fda71b15d1ccf312
2021-04-28 17:00:07 +08:00
Martijn Coenen
13f793aec9 Fixup app-private dirs that are not writable.
Fixup non-writable app-private dirs that could have been left around by
an earlier race condition in the setup of the FUSE filesystem.

Bug: 181726193
Bug: 182088154
Test: erase userdata, check Youtube dirs are fixed up correctly
Change-Id: I7972f79d14893571289a2245f98e90e6c8c69f0a
2021-04-28 09:48:50 +02:00
Chris Li
cde271685f Determine whether to support activities in multi window (1/n)
Add a field of supportsMultiWindow to TaskInfo for WM Shell to use.

Because we will change to Task#supportsMultiWindow to check the
support based on the root activity's resizibilty, min widht/height,
and the device settings, using this to replace the check in
ActivityTaskManager, which is pure device settings.

Bug: 176061101
Test: atest WMShellFlickerTests
Change-Id: Iad94b39506e71b6224d923f02bd7fc454cae02c8
2021-04-27 23:59:38 -07:00
Rhed Jao
f4baaf8a8e Merge "Add a synchronized lock into the SplitDependencyLoaderImpl" into sc-dev 2021-04-28 03:42:05 +00:00
Stanislav Zholnin
c5f09f687b Bug fixes and testing support for DiscreteRegistry
Fixed following bugs:
- in certain cases deduplication could fail
- while requesting discrete ops, beginTimeMillis parameter was
  ignored
- device_config parameters above guardrails were
  still applied after reboot

Added support tests (coming in next CL):
- ability to offsetHistory for test
- ability to change quantization parameter to any value for tests

Test: coming in next CL
Bug: 183238944
Bug: 183239281
Bug: 176965672
Change-Id: I838a7897058b38aa0957a3666d4b37a5378e36be
2021-04-27 18:31:30 +01:00