Commit Graph

9801 Commits

Author SHA1 Message Date
Songchun Fan
c6924e6861 [pm/incremental/api] exposing package state names and reasons
We would like to expose package states and unstartable reasons to public
APIs. Two main users will be:
1) sys UI, which will display alert windows on top of a foreground app
when the package becomes unstartable, with different contents in the alert
window based on the reason code.

2) Play Store, which will collect package state change information which
will be used to determine future package delivery strategies.

Test: will add CTS tests.
BUG: 162600626
CTS-Coverage-Bug: 168925819
Change-Id: I71bafb36b230ea93b34e8556b57563e4ba3b837d
2020-10-14 20:18:08 +00:00
Darryl L Johnson
76b1f31b9a Add binder interface to DeviceStateManagerService.
Test: None
Bug: 159401801

Change-Id: Ia37bb555d2baf43de8d1415731eb0ce5064da907
2020-10-13 14:43:04 -07:00
Nick Moukhine
4c3ecce019 Merge "Add system service for music recognition." 2020-10-09 07:35:34 +00:00
TreeHugger Robot
23606d44e8 Merge "Improve the documentation of the paramters passed to noteOp" 2020-10-09 03:12:56 +00:00
Philip P. Moltmann
8c22ae2a0c Improve the documentation of the paramters passed to noteOp
Test: Docs only changes
Change-Id: I10bac140182db2de43399b45da683c45435ed828
2020-10-08 17:48:10 -07:00
TreeHugger Robot
36a56888f5 Merge "Using new API to obtain apk checksum." 2020-10-08 23:13:13 +00:00
Alex Buynytskyy
458f53551a Using new API to obtain apk checksum.
Fixes: 168260114
Test: refactoring, manually enabled security logs, compared with the previous version
Change-Id: I36f4939386b57130767860c13ea2816873f9f46a
2020-10-08 13:37:49 -07:00
Jeff Sharkey
f76ffeaff1 Merge changes from topic "oct6"
* changes:
  Upgrade AndroidFrameworkBinderIdentity to fatal.
  Tighten up Binder.clearCallingIdentity() usage.
  Tighten up Binder.clearCallingIdentity() usage.
  Tighten up Binder.clearCallingIdentity() usage.
2020-10-08 18:50:22 +00:00
TreeHugger Robot
26e228da83 Merge "Should not switch to a user with removal in progress" 2020-10-08 05:43:29 +00:00
Jeff Sharkey
b93712f623 Tighten up Binder.clearCallingIdentity() usage.
This is a third CL in a chain that adjusts existing malformed code
to follow AndroidFrameworkBinderIdentity best-practices.

Specifically, if a thread clears an identity they need to restore it
to avoid obscure security vulnerabilities.  In addition, the relevant
"try" block must start immediately after the identity is cleared to
ensure that its restored if/when any exceptions are thrown.

Bug: 155703208
Test: make
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: I74cb958b68d55a647547aae21baff6ddc364859b
2020-10-07 21:24:05 -06:00
Mayank Garg
84181f7db7 Should not switch to a user with removal in progress
Fix: 144506286
Test: atest FrameworksServicesTests:com.android.server.pm.UserManagerServiceUserInfoTest
Change-Id: I465ea4c70421e5e84bbfcb50c3c6a87ae9ef2012
2020-10-07 20:41:02 +00:00
Rhed Jao
d03db99731 Merge changes from topic "intent_extra_automatic"
* changes:
  Send extra when automatically removing packages (2/2)
  Send extra when automatically removing packages (1/2)
2020-10-07 08:06:24 +00:00
TreeHugger Robot
0572a76bc1 Merge "Addressing API review comments." 2020-10-06 15:24:53 +00:00
Sergey Nikolaienkov
48e47d1a2c Teach PackageManager to handle <required-(not-)feature>
Introducing 'required-feature' and 'requred-not-feature' tags that could
be used "inside" 'uses-permission' elements.
Elements of both types should have non-empty 'android:name' attribute to
specify the name of the feature.
If the 'uses-permission' element contains 'required-feature' and/or
'required-not-feature' elements, the permission will only be "requested"
if the system supports all the 'required-feature's and does not support
any of the 'required-not-feature's.
The new elemets are "replacement" of the existing
'android:required(Not)Feature' attributes that can be optionally added
to 'uses-permission' elements, but allow to specify only 1 feature each.
However the 'android:required(Not)Feature' attributes remain supported
for compatibility and will be treated similarly to the
'require-(not-)feature' elements.

Bug: 168079571
Test: make && flash
Test: atest CtsContentTestCases:PermissionFeatureTest
Change-Id: Id3043530ebac6bd11805a611cebbf08b45e12f68
2020-10-06 06:55:16 +00:00
Todd Kennedy
acbe943d64 Send extra when automatically removing packages (1/2)
Introduce a new extra field for ACTION_PACKAGE_REMOVED intent to
signal that the application was removed automatically without the
user-initiated action.

If the system automatically prunes a package [eg. an instant app], we
mark the broadcast with that information. Launchers or other applications
can use this information to potentially alter their behaviour.

Bug: 111318529
Test: atest CtsAppSecurityHostTestCases:EphemeralTest
Change-Id: I3a4690d7df6e2dce10b246fe20a627ba2eed5da0
2020-10-06 14:09:36 +08:00
Alex Buynytskyy
c40b4f2851 Addressing API review comments.
Fixes: 169153620
Fixes: 168601298
Test: atest ChecksumsTest
Change-Id: Ibe593ccd388ad56f01ba0e3f58fb5a17c86e5e5c
2020-10-05 20:39:39 -07:00
Steven Moreland
0acafec609 incremental: Move AIDL file to declared package.
There was a regression in the AIDL compiler recently that removed the
requirement that, like in Java, .aidl unstructured parcelables (these
parcelable declarations) are in directories and files which match their
packages and file names. This CL moves relevant files to the correct
directory required by their type.

Bug: N/A
Test: build
Change-Id: I5fd112f1bcd0d1fc3be3c8dc7f1959242d43858e
2020-10-05 21:04:27 +00:00
Chris Li
ccf45834e2 Merge "Reverse the requested orientation on DisplayAreaGroup" 2020-10-05 16:30:06 +00:00
Chris Li
2d560e6976 Reverse the requested orientation on DisplayAreaGroup
When the DisplayAreaGroup has a different orientation from the Display,
reverse the app requested orientation.

As a result, when the display rotates to the reversed orientation, the
DAG and the requested app will be in the requested orientation.

For example, if the display is 1200x900 (landscape), and this DAG is
600x900 (portrait).
When an app below this DAG is requesting landscape, it should actually
request the display to be portrait, so that the DAG and the app will be
in landscape.

Bug: 155431879
Test: manual: test with dual display area policy
Test: atest WmTests:DisplayAreaGroupTest
Change-Id: Ie6874413ca0f6fa999632fb26f27e9913ccaee0d
2020-10-02 15:40:35 -07:00
Songchun Fan
587ecc88b8 Merge "[incremental/pm] app states and transitions" 2020-10-02 18:14:40 +00:00
Songchun Fan
3309398cbf [incremental/pm] app states and transitions
Based on go/incremental-states-design with basic
setter/getters.

Defines IncrementalStates class which handles state transitions.

New (internal) Intent actions: PACKAGE_FULLY_LOADED, PACKAGE_STARTABLE,
PACKAGE_UNSTARTABLE.

BUG: 168043976
Test: unit tests
Change-Id: I7b0ec2dd9f028ee620a9307a1e71ddf12ea5a9af
2020-10-01 16:36:25 -07:00
Evan Severson
3b7af77649 Merge changes from topic "BackgroundMicCamera"
* changes:
  Do not show rationale when permission is restricted
  Add role allowlist for restricted permissions
  Add documentation to APIs using non-inclusive lanuage
  Treat background mic/camera normally
  Introduce new permissionFlag
  Split camera and microphone for background modes
  Add background microphone and camera permission
2020-09-30 16:46:57 +00:00
Nick Moukhine
cf47bdd888 Add system service for music recognition.
The client submits a RecognitionRequest via MusicRecognitionManager.  System server opens an audio stream based on the request and sends it to a MusicRecognitionService (which is exposed by a system app).  The result is passed back through system server to the original caller.

Test: tracked in b/169662646
Bug: 169403302
Change-Id: I4c7fd9d9d72ddd5678867fd037cab6198bff2c2d
2020-09-30 14:44:01 +00:00
Neil Fuller
02d943f44d Get ready to add System APIs for use by SUW
This commit introduces the TimeManager API class. It is intended to
provide access to the time and time zone detector services, which
historically have had their own (internal) API classes to access them.

This commit contains various fixes to the listener handling logic
noticed while testing the APIs.

The first APIs on TimeManager are being exposed for use by SetUp Wizard,
which requires System APIs.

The APIs enable the calling app to determine the capabilities for /
config of the current user that affect time zone detection and then
alter them.

The primary usecase:

The rules for who can do what and when for time zone detection are
becoming more complicated, and device and user capabilities will be
affected by compile time constants, device config (resources) and device
hardware. By exposing this API, the complex logic can be encoded in one
place (the system server), rather than duplicating them in multiple
client apps.

These APIs are also intended for use by SettingsUI (and the various form
factor versions of that), but settings apps do not currently require
them to be marked with @SystemApi.

Bug: 159891384
Test: atest services/tests/servicestests/src/com/android/server/timezonedetector/
Test: atest android.app.time
Change-Id: I9b59099748e2391c180e124edf83fa521beb1b51
2020-09-30 13:34:05 +01:00
vadimt
8f16a6c96f Implementing Lock contention API
This API allows the test to create
contention on AM, PM and/or WM locks.

Test: a prototype lock contention test
Bug: 168630376
Change-Id: I656b6b412d517cb3b3b16367d8712f78ccbc33d8
2020-09-24 13:18:12 -07:00
Evan Severson
c1e6e73e52 Add role allowlist for restricted permissions
Test: Manual
Bug: 158311343
Change-Id: If14c9c667b98a92e3e29efd572567f5ea3cc61d3
2020-09-23 14:20:27 -07:00
Evan Severson
ee7b9310aa Add documentation to APIs using non-inclusive lanuage
Test: Build

Change-Id: Ib887c85cfce827f085fbe65892ded88a5e1a8b11
2020-09-23 14:20:27 -07:00
Evan Severson
d7087b25ce Introduce new permissionFlag
The new permission flag is for restricted permissions which the
installer is not able to exempt.

Test: Install test app
Bug: 158311343
Change-Id: I7340948690ea69750ef479d1b8f0ac8a6177c98c
2020-09-23 14:06:06 -07:00
Patrick Baumann
92e912e8d2 Merge "Expose grantImplicitAccess in IPackageManager" into rvc-qpr-dev am: e530998c9e am: 0e914bd102
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12294962

Change-Id: Ic11d011d8ae228c1558fab3f0dc5ebc7ea79d470
2020-09-23 20:02:28 +00:00
Patrick Baumann
0e914bd102 Merge "Expose grantImplicitAccess in IPackageManager" into rvc-qpr-dev am: e530998c9e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12294962

Change-Id: I31db3a2016da589f2c0b7f4bc955a870ebc384c5
2020-09-23 18:28:16 +00:00
Patrick Baumann
e530998c9e Merge "Expose grantImplicitAccess in IPackageManager" into rvc-qpr-dev 2020-09-23 17:48:57 +00:00
Jackal Guo
1f484774e2 Merge "Prevent arbitrary installers installing apps as instant" 2020-09-23 01:16:54 +00:00
TreeHugger Robot
099a2373a7 Merge "Update BIND_INCLUDE_CAPABILITIES javadoc for R." 2020-09-22 17:40:42 +00:00
Sally Yuen
b486020186 Merge "Add Bold Text to Configuration" 2020-09-21 23:10:21 +00:00
Alex Buynytskyy
b39d13ed7f Installer digests for Incremental installations.
Bug: 160605420
Test: atest ChecksumsTest
Change-Id: I9d46c218cccf87781e9b33711c4d02d94bf824f5
2020-09-21 12:40:56 -07:00
TreeHugger Robot
1488119306 Merge "Added UserInfo.convertedFromPreCreated" into rvc-qpr-dev am: 7d2354bdc5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12495367

Change-Id: I164ccf69a41291610cf7f87f8cbbb453aa2aba2b
2020-09-21 19:20:55 +00:00
Sally
38eba02bba Add Bold Text to Configuration
Bug: 110991537
Test: atest CtsContentTestCases
Change-Id: If010da29d03d06d22bf0fc4cbc3780ed42bf5f86
2020-09-21 19:04:08 +00:00
TreeHugger Robot
7d2354bdc5 Merge "Added UserInfo.convertedFromPreCreated" into rvc-qpr-dev 2020-09-21 18:40:48 +00:00
Charles Chen
a73d039aee Merge "Make a context dervied from an UI context as an UI context" 2020-09-21 10:43:30 +00:00
Rhed Jao
aa5e39fd93 Merge "Updates more CtsContentTestCases to TEST_MAPPING" 2020-09-21 02:18:13 +00:00
Winson Chiu
189a385fd7 Merge "Add getTargetSdkVersion without AppInfo" 2020-09-18 18:18:28 +00:00
Hui Yu
21c57d7787 Update BIND_INCLUDE_CAPABILITIES javadoc for R.
Bug: 164453985
Test: make and check javadoc.
Change-Id: I91b55663f1e8d9e305be3bfb93756cf41cbc71ac
2020-09-18 11:14:27 -07:00
Rhed Jao
096b5ee6c7 Updates more CtsContentTestCases to TEST_MAPPING
Bug: 158798848
Test: atest CtsContentTestCases:android.content.om.cts
Test: atest CtsContentTestCases:android.content.res.cts
Test: atest CtsContentTestCases:android.content.pm.cts
Change-Id: Ibd1d1de550e6cd15f0f3bd0b8b3245afdfe7fb75
2020-09-18 16:42:02 +08:00
Treehugger Robot
61d3e5ca97 Merge "Clarify docs for FLAG_SYSTEM" am: 40dcbcad28 am: b4ff7c066f am: 687923e2c7 am: 8ce81bcb12 am: 2046ae1522
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426971

Change-Id: I26725df92f2f114ca1a43c6471173aaf7d20630e
2020-09-18 04:52:47 +00:00
Treehugger Robot
2046ae1522 Merge "Clarify docs for FLAG_SYSTEM" am: 40dcbcad28 am: b4ff7c066f am: 687923e2c7 am: 8ce81bcb12
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426971

Change-Id: I903496a4c0b124d39643a590e8eb42b45bb458ef
2020-09-17 23:25:32 +00:00
Treehugger Robot
8ce81bcb12 Merge "Clarify docs for FLAG_SYSTEM" am: 40dcbcad28 am: b4ff7c066f am: 687923e2c7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426971

Change-Id: I8b6e9e6de24d6c6332a5a224d1375ebc63c08899
2020-09-17 21:43:35 +00:00
Winson
050de3f78b Add getTargetSdkVersion without AppInfo
For quickly checking an app's targetSdkVersion without building and
returning an entire ApplicationInfo object.

Bug: 164459559

Test: atest android.content.pm.cts.PackageManagerTest#testGetInfo

Change-Id: Ibe1a3e977cd71b23e26395eb6cc73f61c1a85a0e
2020-09-17 10:37:11 -07:00
Felipe Leme
4c0f6907fb Added UserInfo.convertedFromPreCreated
This attribute is useful to identify (on bugreports) whether a
user was created "from scratch" or converted from a pre-created user.

Test: adb shell cmd user list --all -v
Test: adb shell dumpsys user
Test: atest UserControllerTest UserManagerServiceUserInfoTest

Fixes: 165703573

Change-Id: Iee9df636db5677b4d968d49bb5f5b3fbb9a7f02d
Merged-In: Iee9df636db5677b4d968d49bb5f5b3fbb9a7f02d
(cherry picked from commit c5986436a9779bbe9068609062fb231aff37e1d4)
2020-09-17 06:47:26 +00:00
TreeHugger Robot
a8f4e86533 Merge "Update language to comply with Android's inclusive language guidance" into rvc-qpr-dev am: 792e2be0fd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12593704

Change-Id: I31fc971801d9c30bbc61e8fbd97b5aed4d5a775a
2020-09-17 03:45:48 +00:00
TreeHugger Robot
e6ed556cce Merge "Update ContentResolver documentation." 2020-09-16 16:38:30 +00:00