Commit Graph

6899 Commits

Author SHA1 Message Date
Philip P. Moltmann
a4b3022c51 Make PackageManager#arePermissionsIndividuallyControlled system-api
The PermissonController is going to become a mainline module, hence it
has to compile against @SystemApi.

PackageManager#arePermissionsIndividuallyControlled controls how certain
permissions are presented in the UI, hence Permission controller needs
to read it. The value of this API comes from a config option.

Bug: 110953302
Test: Built
Change-Id: If78b1bb594af0c85e92abf70ae8315e7ba3f31fa
2018-09-10 16:46:30 -07:00
David Brazdil
b19f26e78f Merge "Move ApplicationInfo.usesNonSdkApi to private flags" 2018-09-06 14:10:22 +00:00
David Brazdil
a5b4df2a89 Move ApplicationInfo.usesNonSdkApi to private flags
No need to create an extra field for a boolean flag. Move the recently
added ApplicationInfo.usesNonSdkApi to one bit in privateFlags.

This also solves an issue where the field was not propagated during
copying of the data structure.

Bug: 113315999
Test: phone boots
Change-Id: I09f8f39454c013a84893ac304904a4412fc542bf
2018-09-06 09:53:08 +01:00
TreeHugger Robot
329fd3bc0d Merge "Add FEATURE_FACE and FEATURE_IRIS" 2018-09-05 20:12:54 +00:00
Chia-I Wu
c803806efb Merge "Fix widecg and hdr ordering in Configuration" 2018-09-05 17:24:56 +00:00
TreeHugger Robot
73855d4071 Merge "Avoiding potential NPE when dumping to proto." 2018-09-05 01:11:26 +00:00
Kweku Adams
15afdebe38 Avoiding potential NPE when dumping to proto.
Inspired by http://aosp/736453.

Bug: 113087610
Test: Android builds
Change-Id: I9f0dae9cd5a839947c7ed150980eb30b928beef7
2018-09-04 11:57:34 -07:00
Chia-I Wu
0d8acf5a96 Fix widecg and hdr ordering in Configuration
Wide Gamut qualifier should be before the HDR one.

Bug: 78136980
Test: am get-config
Change-Id: If0f09ddb750d586d29b4cedcbab3d5981f393b92
2018-08-31 17:18:36 +00:00
Philip P. Moltmann
7a80e14184 Merge "Factor some RestrictedLockUtils out of SettingLib" 2018-08-31 04:47:28 +00:00
TreeHugger Robot
49fa609ba0 Merge changes from topic "biometric-prompt-service"
* changes:
  Add BiometricPromptService
  Remove common biometric directory
2018-08-31 01:21:07 +00:00
Kevin Chyn
15bb32d33c Add FEATURE_FACE and FEATURE_IRIS
Fixes: 110535333

Test: make update-api
Test: make -j
Change-Id: I64e99c1437a497a37bc7d89c9c76a4930455f767
2018-08-30 14:49:32 -07:00
Kevin Chyn
a24e9fd9ac Add BiometricPromptService
The change introduces the following:
  - BiometricPrompt communicatates with BiometricPromptService (new)
    system service. The service does the decision making for which
    biometric modality to use.
  - As a result, a lot of logic is moved from <Biometric>Manager
    to BiometricPrompt. FingerprintManager now does not care about
    BiometricPrompt logic anymore (reverts several P changes).

Face, and all future <Biometric>Service interfaces must be protected by
the signature-only MANAGE_BIOMETRIC permission. Settings, SystemUI, and
BiometricPromptService are their only clients.

Bug: 72825012

Test: BiometricPromptDemo works
Test: Keyguard works
Test: Settings works

Change-Id: I2b7d6eff81bc07950202c50e592d733032523bf0
2018-08-30 14:49:32 -07:00
Philip P. Moltmann
4e615e6986 Factor some RestrictedLockUtils out of SettingLib
Also make the new lib only use system-apis.

This allows mainline module to use the new
RestrictedLockUtilsSettingLib.

Unfortunately the whole RestrictedLockUtils would have caused to much
new system-api. Hence it was split into RestrictedLockUtils and
RestrictedLockUtilsInternal. This caused a lot of trivial code changes.

Bug: 110953302
Test: Built
Change-Id: I693b3bf56f3be71f0790776e3aad5694717786ef
2018-08-30 11:59:29 -07:00
David Brazdil
03b72ae608 Merge "Add android:usesNonSdkApi manifest attribute" 2018-08-30 12:52:52 +00:00
Makoto Onuki
e183a40764 Add detailed log around requestSync.
Bug: 113136683
Test: Boot and trigger sync

Change-Id: I6b79696c57fbe80d77dcde85bebe57a1adc3e935
2018-08-29 12:55:53 -07:00
TreeHugger Robot
4379d6537e Merge "ContentResolver: Always set calling package name" 2018-08-29 01:01:00 +00:00
Makoto Onuki
2cc250b651 ContentResolver: Always set calling package name
Change-Id: I170fba7df8422c68d42c22eb5953b7a47f6c95d5
Fixes: 112306907
Test: atest CtsContentTestCases
2018-08-28 15:57:48 -07:00
Jeff Sharkey
202a16ec96 Merge "More robust MTP-to-MIME-type mappings." 2018-08-28 20:51:37 +00:00
Jeff Sharkey
3d80a7d36a Merge "Clean/destroy app shared storage via installd." 2018-08-28 19:37:19 +00:00
Jeff Sharkey
91e3cd4c6c More robust MTP-to-MIME-type mappings.
Recently in I830717428e72ac37c5ecd1f23d915aa878ef3744, we greatly
improved the underlying file-extension-to-MIME-type mappings defined
in libcore and used across the OS.

Instead of maintaining divergent mappings here in MediaFile, this
change delegates all file extension logic down to libcore, and
standardizes all MediaScanner internals on using MIME types.  To
register new file types in the future:

1. Add the MIME-to-extension registration in libcore.
2. Add the MIME-to-MTP mapping here in MediaFile.

This change also ensures that unknown MIME types are surfaced
across MTP, using constants like FORMAT_UNDEFINED_AUDIO for audio/*
until an explicit format is defined.

We now surface WMA/WMV file formats, even if the device can't
natively play them back, since we still want to offer the ability
for users to copy them around, and the user may have a third-party
app capable of playing them.

Keeps @UnsupportedAppUsage intact for now.

Bug: 111268862, 112162449
Test: atest frameworks/base/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaFileTest.java
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: I2f6a5411bc215f776f00e0f9a4b7d825b10b377d
2018-08-28 13:02:35 -06:00
Sudheer Shanka
8e7cf05d27 Merge "Remove DefaultContainerService usage in StorageManagerService." 2018-08-28 18:01:24 +00:00
David Brazdil
787b6f22a6 Add android:usesNonSdkApi manifest attribute
ActivityManagerService decides on the non-SDK API enforcement policy
of every newly spawned process. System apps can be exempted by adding
their package name to a config XML file, tests can pass a flag to
'am instrument'. This patch adds a new @hide attribute on the <application>
manifest tag, "android:usesNonSdkApi", which can be used by both
system apps and tests, and is automatically set by the build system.

The use of the attribute remains guarded as follows:
- if invoked via 'am instrument', must hold shell user permission,
- if app launched, must be a system app or an updated system app.
The attribute is ignored in all other cases.

Bug: 113315999
Test: N/A
Change-Id: I2f6cb56f63fa2c5dd6c7c25fcefe8205da1ec96a
2018-08-28 15:20:50 +01:00
Sudheer Shanka
25469aacb8 Remove DefaultContainerService usage in StorageManagerService.
StorageManagerService uses DefaultContainerService to obtain ObbInfo
for files passed through mountObb() transaction. This change moves this
logic to client side and so ObbInfo will be passed as part of mountObb()
transaction.

Bug: 111838160
Test: atest src/android/os/storage/cts/StorageManagerTest.java
Test: atest core/tests/coretests/src/android/os/storage/StorageManagerIntegrationTest.java
Test: atest services/tests/servicestests/src/com/android/server/MountServiceTests.java
Change-Id: I29aee3aa54a45057df96aae289888161a3e3af71
2018-08-27 15:50:59 -07:00
Aurimas Liutikas
bf1c1fca55 Add comments about mData in TypedArray.
Test: None
Change-Id: I85556c7c26a7323012e552d69ab6bb1c741d9360
2018-08-27 15:45:48 -07:00
TreeHugger Robot
84f7d7b37c Merge "Deprecate Resources#getMovie()" 2018-08-27 21:06:28 +00:00
Jeff Sharkey
4e7a765855 Clean/destroy app shared storage via installd.
In P we moved destroying per-user shared storage into installd,
where it can iterate quickly over large sets of files.  This change
now moves cleaning/destroying of per-app shared storage data down into
installd, letting us greatly simplify the logic in PMS to no longer
require spinning up DefaultContainerService.  This also fixes an
obscure bug where DCS (which always runs as USER_SYSTEM) wasn't able
to clear shared storage for secondary users.

This also gives us the ability to target specific storage devices
by UUID, such as when the user has migrated their primary shared
storage to an adopted device.

We no longer distinguish between keeping or deleting OBB files
during various operations, since upcoming changes in the Q release
will mean OBB files are no longer shared between users, and they'll
now live inside a sandbox that will be fully cleared when the user
clears data.  (Going forward, apps should be using splits instead
of OBBs, so they're effectively deprecated.)

Uses newer "const" feature of AIDL to ensure constant values remain
consistent between native and Java code.

Bug: 111854851, 111838160
Test: atest android.appsecurity.cts.StorageHostTest#testCache
Change-Id: Ib90be155718a768da76110fbfcf010a471b37378
2018-08-27 20:42:47 +00:00
Eric Holk
67c0091fc7 Merge "Add more tracing for obtainStyledAttributes" am: 2ef6338351 am: 106905df2e
am: 66a177f90e

Change-Id: Ic3155c4c7685e5ea7bdf55eae2d250081d8e12f3
2018-08-23 18:03:37 -07:00
Eric Holk
66a177f90e Merge "Add more tracing for obtainStyledAttributes" am: 2ef6338351
am: 106905df2e

Change-Id: I8e7a40aab8bdf2e50c741bcad62dc81bc3df88c0
2018-08-23 17:50:19 -07:00
Eric Holk
106905df2e Merge "Add more tracing for obtainStyledAttributes"
am: 2ef6338351

Change-Id: I9f65106687262f180dd62d329c7197cb720def51
2018-08-23 17:35:16 -07:00
Aurimas Liutikas
f0764b5c46 Deprecate Resources#getMovie()
Movie class has been deprecated, deprecate the getMovie as well.

Bug: 113054577
Test: None
Change-Id: Ic217adc002c7cfbe795e855689af1a58447b7d39
2018-08-22 13:13:07 -07:00
Ashley Rose
6c5670577a Merge "Create ColorStateListDrawable" 2018-08-22 20:00:42 +00:00
Ashley Rose
e3b135743f Create ColorStateListDrawable
Previously, you could not use references to colors in places that
expected a Drawable. This new class, ColorStateListDrawable bridges the
gap by attaching a ColorStateList to a ColorDrawable, and hooks it into
resource loading wherever you might expect a Drawable.

Fixes: 18126411
Test: Unit tests to be added to CTS
Change-Id: I0ff9a089669da96e6b22b214f04d6726bc278152
2018-08-22 14:08:30 -04:00
TreeHugger Robot
973f55d0ee Merge "Move query methods" 2018-08-22 17:32:05 +00:00
Anton Hansson
a101ff0571 Merge "Support /product-services partition" 2018-08-22 13:58:00 +00:00
Todd Kennedy
cf82703f0d Move query methods
Continue trying to reduce the size of PackageManagerService by
extracting intent queries to a separate class. This is the first,
low hanging fruit, pass.

Test: Manual
Fixes: 110090130
Change-Id: I89f6968b3460ad9d64cdac75bea1eac8a9c90599
2018-08-21 15:38:07 -07:00
Eric Holk
c37457799b Add more tracing for obtainStyledAttributes
Much of the time for View inflation is spent in calls to
obtainStyledAttributes. This change adds more granular tracing of this method so
we can better attribute how inflation time is spent.

Test: manual - looked at systrace for starting an app.

Change-Id: Ib72aef1e8b788ce5a61ba13b57bb4417a263b48c
2018-08-21 13:35:07 -07:00
Julia Reynolds
4bc42b9858 Provide a uid list extra to package un/suspended
This matches the pattern for other package broadcasts
(e.g. package removed) and reduces ambiguity for
system_server services that handle the broadcast.

Test: presubmit, adb shell pm suspend(/unsuspend)
Change-Id: I41c3b853cbc6aac15a6cef7409309c0859ca783e
Fixes: 112439969
2018-08-21 10:45:15 -04:00
Chad Brubaker
a6b2d5caaf Limit clipboard access to the default IME or current focused app.
Test: atest ClipboardManagerTest.java
Bug: 6229949
Change-Id: I450ba3d3c2d0f1c4a6a4c24f50539c68ac844c26
2018-08-17 10:56:28 -07:00
Dario Freni
2bef1768a8 Support /product-services partition
This CL is largely an adaptation of Change-Id
I16175933cebd9ec665d190cc5d564b5414a91827 . I also used the same way for
testing the change.

This CL will support the followings.
- installing a RRO package for framework from /product-services/overlay
- installing apps from /product-services/app
- installing priv-apps from /product-services/priv-app
- installing permissions from
  /product-services/etc/[default-permissions|permissions|sysconfig]

Bug: 80741439
Test: `mm` under frameworks/base/tests/[libs|privapp]-permissions
  adb sync && adb reboot
  adb shell cmd package list libraries
    => confirmed com.android.test.libs.product_services library
  adb shell cmd package dump \
    com.android.framework.permission.privapp.tests.product_services
    => confirmed that the package is a priv-app

  And I moved vendor/overlay/framework-res__auto_generated_rro.apk
  into system/product-services/overlay/ on taimen, and I confirmed that the
  RRO was installed properly.

Change-Id: I7a6a30bf8e8db9f2738594d187bb9148f138b8da
(cherry picked from commit a4af41736894bd3bf5bdc2a279acbeed2a24dd3d)
2018-08-17 16:34:03 +00:00
Mathew Inwood
a5191dacdc resolve merge conflicts of 2ee069f73d to stage-aosp-master
am: 8b62717128

Change-Id: Ib32e90ab073d32cc1354c2a3e889ebca813c59f1
2018-08-17 01:43:27 -07:00
Mathew Inwood
8b62717128 resolve merge conflicts of 2ee069f73d to stage-aosp-master
Bug: None
Test: I solemnly swear I tested this conflict resolution.
Merged-In: Ia79256a3d04e16dd78331a61af0dcddc5fc1599b
Change-Id: Ieb9836ae90f6f2565fa3ba5c395b42069b58ff71
2018-08-17 08:31:16 +01:00
Mathew Inwood
1c77a11db2 Add @UnsupportedAppUsage annotations
For packages:
  android.content.res
  android.content.pm.split
  android.content.pm.permission
  android.content.pm.dex
  android.content.pm
  android.content.om
  android.content

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: Ie932bb108f8e21aad8576e444d43e7a553a4d128
Merged-In: Ia79256a3d04e16dd78331a61af0dcddc5fc1599b
2018-08-15 09:59:43 +01:00
Mathew Inwood
5c0d354758 Add @UnsupportedAppUsage annotations
For packages:
  android.content.res
  android.content.pm.split
  android.content.pm.permission
  android.content.pm.dex
  android.content.pm
  android.content.om
  android.content

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: Ia79256a3d04e16dd78331a61af0dcddc5fc1599b
2018-08-15 09:55:56 +01:00
Jeff Sharkey
9b191c2415 Merge "Methods to translate sandbox paths." 2018-08-14 21:39:15 +00:00
Jeff Sharkey
eb0fb4efba Merge "Start defining strongly-typed storage permissions." 2018-08-14 21:38:10 +00:00
TreeHugger Robot
b08079307c Merge "Making api isPackageSuspended public" 2018-08-14 18:41:29 +00:00
Laura Davis
55b37efb65 Merge "Docs: Removed narrative content and edited links." into pi-dev am: 37a29795e4
am: 187a4a0710

Change-Id: I5a5371d1fc25118950df274169243d99a60f9a10
2018-08-14 11:25:46 -07:00
Laura Davis
187a4a0710 Merge "Docs: Removed narrative content and edited links." into pi-dev
am: 37a29795e4

Change-Id: Ic5f65ddb5903a79e13379c395e770e28bba7c6e6
2018-08-14 11:17:46 -07:00
Jeff Sharkey
5790af08f8 Methods to translate sandbox paths.
System components (like MediaProvider) will live in a mount namespace
that has a view of the "real" shared storage device, and normal apps
will have "sandboxed" views of the shared storage device.  (Parallel
changes are implementing these namespaces in vold and installd.)

The system components mentioned above will need to translate between
the two namespaces, so this change introduces methods that perform
that translation, along with a nice batch of tests to verify.

Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/StorageManagerServiceTest.java
Bug: 111893193, 111892833, 111268862
Change-Id: Iae91a44ce09eb33d6cd9b90f6c7b4f88c8cd12f0
2018-08-14 10:56:43 -06:00
Jeff Sharkey
4aacd8b668 Start defining strongly-typed storage permissions.
We now have separate permissions that correspond to the various
MediaStore tables:

-- READ/WRITE_MEDIA_AUDIO
-- READ/WRITE_MEDIA_VIDEO
-- READ/WRITE_MEDIA_IMAGES

From a product point-of-view, Images and Videos will being treated as
a single permission group of "Visual" media in Q.  We're also defining
two other special permissions:

-- ACCESS_MEDIA_LOCATION: indicating that the app can see any
geographic location related metadata associated with media, such
as being stored in the EXIF data.  We're willing to grant this under
the unbrella of the larger "Visual" runtime permission group, but we
still want apps to request it for full disclosure of their intent.

-- WRITE_OBB: can be held by app stores that need to deliver OBB
files into app-specific sandboxes to keep legacy apps working.

Test: manual
Bug: 111801780, 110228267, 111789719, 111892833
Change-Id: If28247efdd7ac185ad3c6cbceda2e6346c26d032
2018-08-14 09:11:18 -06:00