Commit Graph

2994 Commits

Author SHA1 Message Date
Makoto Onuki
dc4aa4b86e Add a permission for CDM apps to start FGS from the background
Previously, any apps with a CDM association was allowed to start
foreground services from the background.

Now, only apps with
REQUEST_COMPANION_START_FOREGROUND_SERVICES_FROM_BACKGROUND
(or REQUEST_COMPANION_RUN_IN_BACKGROUND) are allowed to do so.

Bug: 186536261
Test: Manual test with a test app using CDM. With and without these
    permissions.
Change-Id: Ic00aa1c7cfefc37bf89ea3079ef0977aee12499b
2021-05-13 12:21:39 -07:00
Makoto Onuki
987f904072 Merge "Implement requestForegroundServiceExemption, without enabling it" into sc-dev 2021-05-11 15:55:14 +00:00
Kholoud Mohamed
80ed0ced6c Merge "Allow forceUpdateUserSetupComplete for non system users" into sc-dev 2021-05-11 14:50:38 +00:00
TreeHugger Robot
d85097d1ad Merge "Add android: to text constant to prevent namespace conflicts." into sc-dev 2021-05-11 12:50:54 +00:00
kholoud mohamed
158dd8fc09 Allow forceUpdateUserSetupComplete for non system users
Test: atest android.devicepolicy.cts.DevicePolicyManagerTest
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
Bug: 183716601
Change-Id: Id2340ac1c6404ac41ca7b5a31c6fbb1577804595
2021-05-11 09:25:20 +01:00
shubang
5afdd12cfe Modify error codes and improve descriptions
Bug: 167036690
Test: atest MediaMetricsAtomTests
Change-Id: Ib34f402d29043cdda839340e23e26a40e82e57f2
2021-05-10 19:10:35 -07:00
Makoto Onuki
26f28d4a29 Merge "Send a broadcast when an app is granted SCHEDULE_EXACT_ALARM" into sc-dev 2021-05-10 22:14:48 +00:00
Makoto Onuki
619c5a46d8 Implement requestForegroundServiceExemption, without enabling it
Bug: 187429663
Test: Checked ApplicationInfo.hasRequestForegroundServiceExemption()
  of a test app, with and without the new attribute set.

Change-Id: I98342a35a82e44327db896c9820806eb3eda5b4c
2021-05-10 11:50:32 -07:00
Makoto Onuki
306ed287f4 Send a broadcast when an app is granted SCHEDULE_EXACT_ALARM
Bug: 187206399
Test: atest AlarmManagerServiceTest
Test: Manual test with a test app.
- Grant the permission to test app and make sure it can start FGS.
Log:
```
05-07 10:12:08.671  1000  1579  9475 I ActivityManager: Background started FGS: Allowed [callingPackage: com.google.omakoto.testapp; callingUid: 10294; uidState: RCVR; intent: Intent { act=fgs cmp=com.google.omakoto.testapp/.MyFgs }; code:(unknown:207); tempAllowListReason:<broadcast:1000:android.app.action.SCHEDULE_EXACT_ALARM_PERMISSION_STATE_CHANGED,reason:,reasonCode:(unknown:207),duration:10000,callingUid:1000>; targetSdkVersion:30; callerTargetSdkVersion:30; startForegroundCount:0]
```
- Grant the permission to a different app and make sure the test app
  won't receive the broadcast.

Test: CTS -- Incoming

Change-Id: Iefe3e12dcf51318d8433532ba3048caa69b1edcd
2021-05-07 17:34:12 -07:00
Adam He
b9cdc84c87 Add android: to text constant to prevent namespace conflicts.
Fixes: 187219011
Test: atest CtsTranslationTestCases
Change-Id: I980156c8653581aa5020afaa5bcb97e909d291df
2021-05-07 15:14:30 -07:00
Hyunyoung Song
c8478e5a9d All Apps Search API council feedback (second round)
Bug: 186756959
Test: atest CtsSearchUiServiceTestCases
Change-Id: I0c83d79ede8801f71c89e71cc6ec2c73b2d8bfcd
2021-05-07 11:41:43 -07:00
TreeHugger Robot
d8ef2b30f4 Merge "Add a default implementation of UiTranslationStateCallback#onResumed." into sc-dev 2021-05-06 23:07:12 +00:00
Ahaan Ugale
ebc8d5154a Add a default implementation of UiTranslationStateCallback#onResumed.
This is temporary, to avoid breaking clients that already implemented
the API before onResumed was added.

Bug: 185274258
Test: manual
Change-Id: Icd2c392e248f01c22b95e0b88ba56847ae71f10a
2021-05-06 13:48:58 -07:00
Pierre Barbier de Reuille
94cd7cbb04 Merge "Remove system_app_widget_internal_padding resource" into sc-dev 2021-05-06 18:54:16 +00:00
TreeHugger Robot
8c62b2ba7c Merge "Rename OnProjectionStateChangeListener -> OnProjectionStateChangedListener" into sc-dev 2021-05-06 18:36:32 +00:00
Pierre Barbier de Reuille
1187a1448e Remove system_app_widget_internal_padding resource
Fix: 187326256
Test: atest AppWidgetDimensionsTest
Change-Id: Ic78fa7e3165d9b937d100082915f28e90fca1f5b
2021-05-06 15:15:56 +01:00
Svetoslav Ganov
720add59c7 Merge "Prepare AttributionSource to expose to native" into sc-dev 2021-05-05 23:23:54 +00:00
Kurt Dresner
81f2994f35 Rename OnProjectionStateChangeListener -> OnProjectionStateChangedListener
Bug: 175130323
Test: Presubmits
Change-Id: Ica48cd073e256055d5cac0f12e9ce814227eb0d6
2021-05-05 15:27:31 -07:00
Treehugger Robot
a5c04b6fd9 Merge "update L photo size name with JPN_ prefix" am: 2a46c6491f am: 70100919d0 am: 9e0ab4a327
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1697309

Change-Id: Id300ef712eda7bfab164044c95c807ebf4e9798f
2021-05-05 21:35:24 +00:00
Kurtis Schlepp
11749564b1 update L photo size name with JPN_ prefix
Updates the Japanese Photo L media size name with JPN_ prefix

Test: L is present in API with updated name
Signed-off-by: Kurtis Schlepp <mopriadevteam@gmail.com>
Change-Id: Ib4e52b23571b166f6c000676fb81b4ac7c1f9a7a
2021-05-05 10:06:03 -07: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
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
Joanne Chung
bd351242a9 Merge "API feedback: seperate start and resume state for UiTranslationStateCallback" into sc-dev 2021-05-05 06:36:24 +00:00
Joanne Chung
8e9d678ff0 API feedback: seperate start and resume state for UiTranslationStateCallback
Bug: 185274258
Test: manual
Test: atest android.translation.cts.UiTranslationManagerTest

Change-Id: Ic2246a9ef64a214ce39e187056a9add56e616d1a
2021-05-05 12:31:25 +08:00
Lucas Dupin
534b1ea38f Merge "Add shade 10 to system palette" into sc-dev 2021-05-04 23:43:29 +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
Sahana Rao
8f28e57780 Merge "Change hasRequestRawExternalStorageAccess() to return integer" into sc-dev 2021-05-04 19:19:17 +00:00
Inseob Kim
0bc6f0f6be Merge "Add an api for platform sepolicy version to vintf" am: 3ea60e26f5 am: 5c50929036 am: 77b8f5858f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1689587

Change-Id: I540e6e54f2a345372dd2e95a2eaeecb32afe747b
2021-05-04 16:21:02 +00:00
Lucas Dupin
ad070286d6 Add shade 10 to system palette
Fixes: 186851836
Test: manual
Test: atest SystemPalette
Change-Id: Ic594c7f9079703f4ab664871519a900c69e124bd
2021-05-04 08:53:21 -07:00
Inseob Kim
4055ce5313 Add an api for platform sepolicy version to vintf
PLATFORM_SEPOLICY_VERSION will be the latest version in system's
compatibility matrix. This change adds a function
getPlatformSepolicyVersion, which ultimately gets
PLATFORM_SEPOLICY_VERSION, just like getSepolicyVersion for vendor.

This will be used from the SELinux CTS.

Bug: 186596569
Test: atest CtsSecurityHostTestCases:android.security.cts.SELinuxNeverallowRulesTest
Change-Id: Ic7863ece9413b9a6a4a91ff42d3121935823fe8b
2021-05-04 12:53:52 +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
George Mount
b1aee44bea Remove edge effect type from the API.
Fixes: 186758538

Relnote: "Removes edge effect type from the API -- EdgeEffect now
supports only stretch edge effect for all applications."

Test: existing tests, modified to work with stretch
Change-Id: Iec7a9d4a0316ff3ba7297c4565bb881a1adcf949
2021-05-03 22:45:10 +00:00
Sahana Rao
d559e78253 Change hasRequestRawExternalStorageAccess() to return integer
Previously, hasRequestRawExternalStorageAccess would return null if the
app doesn't have requestRawExternalStorageAccess attribute in the
manifest. And, return true/false based on the value specified in
manifest.

Based on API review comments, changed the method to
getRequestRawExternalStorageAccess which returns
* RAW_EXTERNAL_STORAGE_ACCESS_DEFAULT if app didn't specify
requestRawExternalStorageAccess attribute in the manifest.
* RAW_EXTERNAL_STORAGE_ACCESS_REQUESTED if the app requested raw
external storage access.
* RAW_EXTERNAL_STORAGE_ACCESS_NOT_REQUESTED if the app requests to
disable raw external storage access

The API is not guarded with any system level API permissions, hence
changing the API to public API instead of system API. Also added
documentation to ensure apps don't misunderstand this API

Bug: 185484514
Test: atest packages/providers/MediaProvider
Change-Id: Ib7e41ab8ee38389bf44a360e4288d03e58ef44cf
2021-05-03 22:16:56 +01:00
Grace Jia
e2099469d2 Add support for selected contacts device to device sharing.
Bug: 163085177
Test: CTS tests
Change-Id: I4f6da463a29ba9cf067d36941a9b4e584012c817
Merged-In: I4f6da463a29ba9cf067d36941a9b4e584012c817
2021-05-03 12:19:27 -07:00
TreeHugger Robot
1d92fd8123 Merge "Fix nullability of the group name parameter in queryPermissionsByGroup()." into sc-dev 2021-05-03 15:12:34 +00:00
Nikita Dubrovsky
686e4780e3 Merge "Update ContentInfo to implement Parcelable" into sc-dev 2021-05-01 00:25:24 +00:00
Hai Zhang
8f6290db77 Fix nullability of the group name parameter in queryPermissionsByGroup().
Change-Id: Id503da0fe4f16a92997634089fc052d58e78f9df
Fixes: 141452667
Test: presubmit
2021-04-30 21:43:05 +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
Nikita Dubrovsky
9b9b00ff46 Update ContentInfo to implement Parcelable
Bug: 186683314
Test: atest CtsViewReceiveContentTestCases:ContentInfoTest
Change-Id: I59376947cfa8dad5d2021cb1d2f5c121a1f90596
2021-04-30 11:09:04 -07:00
Tyler Gunn
a6502cc4d6 Merge "Remove deprecated at birth DiagnosticCall class." into sc-dev 2021-04-30 15:54:09 +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
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
Andy Hung
a4c82624e9 Audio: Add ENCODING_DRA
China DTMB digital TV.
See SJ/T11368-2006
“Specification for multichannel digital audio coding technology”.

Test: atest AudioFormatTest
Bug: 185950819
Merged-In: Id6078e65941020a73f8a43017f480574c2a78999
Change-Id: Id6078e65941020a73f8a43017f480574c2a78999
2021-04-29 19:13:33 -07:00
Andy Hung
bd3a68b6f1 Audio: Add ENCODING_DTS_UHD
See ETSI TS 103 491 V1.2.1 (2019-05)
DTS-UHD Audio Format; Delivery of Channels,
Objects and Ambisonic Sound Fields

Test: atest AudioFormatTest
Bug: 184538197
Merged-In: I740a9ba041ad444ead5513fb3b632a78d391ab1c
Change-Id: I740a9ba041ad444ead5513fb3b632a78d391ab1c
2021-04-29 17:55:34 -07:00
Jeff Sharkey
9a9fa815f1 Merge "Ensure privileged APIs require runtime permission." into sc-dev 2021-04-29 22:22:25 +00:00
Martin Brabham
329a11f7c6 Merge changes from topic "bluetooth_oob_api" am: 2e67798711 am: 8411b5d7b3 am: 50e294ad9b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1686315

Change-Id: I00dc7f393edb9b562c97147d053302159c12fcdb
2021-04-29 21:33:10 +00:00
Martin Brabham
d50c8e0703 OOB: Remove static creator methods in favor of public constructors am: 1cd46165dd am: e897917de7 am: 2d3dbcab8f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1684129

Change-Id: Ia4d99bf5f2dcee3d688796dfa3e11c1d104132a1
2021-04-29 21:32:57 +00:00
Martin Brabham
e897917de7 OOB: Remove static creator methods in favor of public constructors am: 1cd46165dd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1684129

Change-Id: I36420ea92322b00a6b55a4b4c5bbd759cc7ee263
2021-04-29 20:53:58 +00:00