Commit Graph

7516 Commits

Author SHA1 Message Date
Lee Shombert
ebe2a0baeb Binder cache for isUserUnlocked().
Bug: 140788621

Test: A special build that puts the PropertyInvalidatedCache in
verification mode was loaded on the device.  Then one iteration of MPTS
was executed.  No cache inconsistencies were found and no SELinux
violations (associated with the binder cache) were found.  The number of
cache misses was approximately 10% of the total binder calls.  All
binder calls went through the cache.  Added a new user and later deleted
the same user; verified that caches were invalidated as expected and no
errors were detected by the PropertyInvalidatedCache verification mode.

Passed the CtsMultiUserHostTestCases test.

Change-Id: I32e3e39768e288101c82b02e63a7eb20d5ed7f93
2020-02-11 01:58:37 +00:00
Alex Buynytskyy
cd4d3875e2 Incremental install via adb.
- passing V4 signature to IncFS,
- cleanup and use InstallationFile everywhere,
- pass params to DataLoader creation,
- minor refactor for PackageManagerShellCommandDataLoader to prepare for
Incremental data loading.

Test: atest PackageManagerShellCommandTest
Bug: b/136132412 b/133435829
Change-Id: Iacc3e4c51c0fa3410b076147ce153a1303246189
2020-02-10 07:06:34 -08:00
TreeHugger Robot
0dff4461ac Merge changes from topic "statsd_libbinder_ndk"
* changes:
  Use StatsDimensionsValueParcel within statsd apex
  Use cpp aidl_interface within statsd
2020-02-08 03:33:25 +00:00
TreeHugger Robot
0bfb664126 Merge "Refactor GraphicsStatsService for updateability" 2020-02-08 00:00:36 +00:00
Ruchir Rastogi
56da4c3862 Use StatsDimensionsValueParcel within statsd apex
Because statsd now uses StatsDimensionsValueParcel instead of
StatsDimensionsValue.h/c, statsd no longer has to depend on libservices.

Test: m -j
Test: atest StatsdHostTestCases#testBroadcastSubscriber
Bug: 148604617
Change-Id: I6d65383ccec99f4672d6575232981c0f6cc40fcf
2020-02-07 15:55:11 -08:00
Songchun Fan
4889c7a823 Merge "Incremental native lib extraction" 2020-02-07 23:32:00 +00:00
Anna Trostanetski
35bbc9d4ba Merge "Introduce TRACE_TAG_APEX_MANAGER and add timing to getActiveApexInfos" 2020-02-07 19:56:02 +00:00
Songchun Fan
0f8b6fe950 Incremental native lib extraction
Basically we configure all the lib files inside Incremental Service,
e.g., create lib dirs, make lib files, extract original
lib file data from zip and then write data to the lib files on incfs.

Test: manual with incremental installation
BUG: b/136132412 b/133435829
Change-Id: I7544d2e78bcf3bdd76ce4c0766ec31ff13fd2011
2020-02-07 11:35:48 -08:00
Adam Bookatz
688689eb58 Merge "Make UM.hasBaseUserRestriction @TestApi" 2020-02-07 18:04:51 +00:00
Stan Iliev
c90438175f Refactor GraphicsStatsService for updateability
Move GraphicsStatsService to android.graphics package.
Move GraphicsStatsService JNI from libservices.core to
libandroid_runtime.
Declare GraphicsStatsService ctor as the only @SystemApi.
Remove MemoryFile usage from GraphicsStatsService, but use
SharedMemory and other SDK APIs instead. This is done to
avoid using unstable API MemoryFile.getFileDescriptor.
Propose new SharedMemory.getFdDup API for next release, which
is hidden for now.
Refactor statsd puller to avoid proto serialization by moving
data directly into AStatsEventList.
"libprotoutil" is added as a static dependancy to libhwui, which
should be fine because its implementation does not link anything.

Bug: 146353313
Test: Ran "adb shell cmd stats pull-source 10068"
Test: Passed unit tests and GraphicsStatsValidationTest CTS
Change-Id: If16c5addbd519cba33e03bd84ac312595032e0e1
2020-02-07 12:27:07 -05:00
atrost
3f8b733354 Introduce TRACE_TAG_APEX_MANAGER and add timing to getActiveApexInfos
Timing for initialize cache path only. Currently ~3ms.
This will hopefully help catch regressions.

Bug: 148959827
Test: m, flash, boot, inspect logcat.
Change-Id: Ief83b8e1a6f0e58bca509527656c67b3465a4d19
2020-02-07 14:54:08 +00:00
Alex Buynytskyy
d8b25b838f Incremental Delivery: Add device feature.
Feature is present if ro.incremental.enable set to true.

Test: builds
Bug: b/136132412 b/133435829

Change-Id: I99ad307cbd3428e0b3964a369930658ee1c8ac0f
2020-02-06 14:05:55 -08:00
Alex Buynytskyy
030536c8b8 Merge "Set incremental apk directories" 2020-02-06 15:38:15 +00:00
Narayan Kamath
85e2378965 Merge "Reland: Rework platform version to hide codenames." 2020-02-06 10:51:15 +00:00
Dianne Hackborn
db0074542c Reland: Rework platform version to hide codenames.
The public platform version no longer can be a codename, it is
always the most recently released platform.  A new build property
and API provides either the offical version or the current codename
as appropriate.  This will avoid breaking apps that look at the
platform version while development is under a codename.

Bug:  143175463
Test: manual
Exempt-From-Owner-Approval: Relanding change with zero delta in this project.
Change-Id: I4407df40151d884293fa9d301a401b65bedb5527
2020-02-06 10:50:43 +00:00
Hung-ying Tyan
2f6b69c5e7 Merge "Resolve media directories to the real paths" 2020-02-06 09:32:21 +00:00
Songchun Fan
476bcf76ac Set incremental apk directories
Set up incremental storages such that it works with the new app code
path layout.

Ensures that package names do not show up in /proc/mounts

$ cat /proc/self/mountinfo
2806 90 0:79 / /data/incremental/data_incremental_tmp_1042476774/mount rw,nosuid,nodev,noatime shared:34 - incremental-fs incfs.img rw,read_timeout_ms=10000,readahead=0,rlog_pages=2,rlog_wakeup_cnt=10
6946 90 0:79 /st2 /data/app/~~WE4d9B-MZg0iZckOxIhPGQ== rw,nosuid,nodev,noatime shared:34 - incremental-fs incfs.img rw,read_timeout_ms=10000,readahead=0,rlog_pages=2,rlog_wakeup_cnt=10
7014 2806 0:79 /st2 /data/incremental/data_incremental_tmp_1042476774/mount/st2 rw,nosuid,nodev,noatime shared:34 - incremental-fs incfs.img rw,read_timeout_ms=10000,readahead=0,rlog_pages=2,rlog_wakeup_cnt=10
7013 6946 0:79 /st2 /data/app/~~WE4d9B-MZg0iZckOxIhPGQ== rw,nosuid,nodev,noatime shared:34 - incremental-fs incfs.img rw,read_timeout_ms=10000,readahead=0,rlog_pages=2,rlog_wakeup_cnt=10

BUG: b/147371381 b/148237378
Test: manual
Change-Id: I149903ae63ee27da5957e41c16f21f3435f9e636
2020-02-06 05:26:16 +00:00
Neil Fuller
1b883e2118 Merge "Remove System APIs not required for R" 2020-02-05 11:47:13 +00:00
Hung-ying Tyan
774d89ef64 Resolve media directories to the real paths
as /product may be a symlink to /system/product.

Bug: 147688127
Bug: 147701212
Test: pass android.telecom.cts.BackgroundCallAudioTest on GSI

Change-Id: Ie3588edece1e19ad12bdbf5825b9ff7dfc31cecd
2020-02-05 17:07:31 +08:00
Alex Buynytskyy
716588dec9 Minor renaming: IIncrementalManagerNative -> IIncrementalService.
Manager(client)->Service(server) seems to be easier to understand.

Test: builds
Bug: b/136132412 b/133435829
Change-Id: I3bc447fbf7a7aac917df7b4632def75e0da3f1a0
2020-02-05 01:35:06 +00:00
Automerger Merge Worker
e0c14895d6 Merge "Add getExtension to android.os.IBinder interface" am: 935dfd2ce9 am: 84642d37d5 am: fcc3a08dd4
Change-Id: I3e36d8ab9a629377529afbb1c0276c79d3414a00
2020-02-04 22:58:57 +00:00
Automerger Merge Worker
fcc3a08dd4 Merge "Add getExtension to android.os.IBinder interface" am: 935dfd2ce9 am: 84642d37d5
Change-Id: I7e67000c0434f9f8b72af643d4fd23892fcbbb6c
2020-02-04 22:43:51 +00:00
Automerger Merge Worker
84642d37d5 Merge "Add getExtension to android.os.IBinder interface" am: 935dfd2ce9
Change-Id: I0379693d0c87e77eaed7dd133edb00c410d2dfd5
2020-02-04 22:28:29 +00:00
Automerger Merge Worker
cc8a66cb12 Merge "Allow credstore to call into KeyAttestationApplicationIdProviderService" am: 715e754115 am: 11e5071fbb am: 406f067b69
Change-Id: I1e7159c7110dfd157f25d36bcfe75c56de8e026c
2020-02-04 22:22:38 +00:00
Yo Chiang
935dfd2ce9 Merge "Add getExtension to android.os.IBinder interface" 2020-02-04 22:17:24 +00:00
Automerger Merge Worker
406f067b69 Merge "Allow credstore to call into KeyAttestationApplicationIdProviderService" am: 715e754115 am: 11e5071fbb
Change-Id: I63f2cdcd2240b842614093761390bad866ef091b
2020-02-04 22:08:52 +00:00
Automerger Merge Worker
11e5071fbb Merge "Allow credstore to call into KeyAttestationApplicationIdProviderService" am: 715e754115
Change-Id: I0d0c1be195ec894570c1fcbebca3f8b3298b1b34
2020-02-04 21:49:42 +00:00
Treehugger Robot
715e754115 Merge "Allow credstore to call into KeyAttestationApplicationIdProviderService" 2020-02-04 21:31:31 +00:00
Neil Fuller
567a91279f Remove System APIs not required for R
Test: treehugger
Bug: 148842434
Change-Id: If022a726a058a90cb5446d220628c76800da8e96
2020-02-04 18:59:23 +00:00
David Zeuthen
117fcb6c33 Allow credstore to call into KeyAttestationApplicationIdProviderService
This was previously reserved for keystore only but since credstore
also needs to do attestations, this is needed.

Bug: 111446262
Test: atest android.security.identity.cts
Test: Manually verifying the AttestationApplicationId from credstore
Change-Id: Ie44f9e4c8f2e1bd916ccbe7c7e5537dc498d8154
2020-02-04 10:18:33 -05:00
Howard Ro
756e44741e Merge "Move StatsDimensionsValue.java to statsd apex" 2020-02-04 06:38:37 +00:00
Alex Buynytskyy
c5682f5b68 Unifying non-incremental and incremental.
Step 1 moving all Incremental code into prepareDataLoaderLocked - where
non-incremental DataLoader calls reside.

Test: atest PackageManagerShellCommandTest
Bug: b/136132412 b/133435829 b/136132412
Change-Id: Icf670de6d4802bf52cd4a93fa4475629d9ac9bc0
2020-02-03 20:28:09 -08:00
Tej Singh
8ffe1eae8b Move StatsDimensionsValue.java to statsd apex
Test: builds, boots
Bug: 146578788
Change-Id: Iaeb9eaf8c412964ccf57debca1445063e9120ef9
2020-02-03 19:03:44 -08:00
Adam Bookatz
8e08977646 Make UM.hasBaseUserRestriction @TestApi
The devicepolicy CTS test now needs to know when a restrictions is due
to devicepolicy or whether it is a 'base' restriction enacted by
UserManager. Therefore UM.hasBaseUserRestriction is opened up for the
CTS test.

Bug: 147111703
Test: atest com.android.cts.devicepolicy.UserRestrictionsTest
Change-Id: I0dd5256d36249a8dfe23ae10acf344d9de5fb2ca
2020-02-03 14:36:55 -08:00
Automerger Merge Worker
3f10146fe6 Merge changes Ib7daba9c,Ib692bff0 am: 75b7e58c47 am: 72dcf0a781 am: 3503f24fe4
Change-Id: I77cc4ef70bcad85d921496a8e307997973de43b4
2020-02-03 20:28:53 +00:00
Automerger Merge Worker
3503f24fe4 Merge changes Ib7daba9c,Ib692bff0 am: 75b7e58c47 am: 72dcf0a781
Change-Id: I881ade99a6dde6566b12974b058efa4a5ef13073
2020-02-03 20:17:49 +00:00
Automerger Merge Worker
72dcf0a781 Merge changes Ib7daba9c,Ib692bff0 am: 75b7e58c47
Change-Id: I3067f3dfa8a5d0167f27af5af768d303bccd5510
2020-02-03 20:08:24 +00:00
Treehugger Robot
75b7e58c47 Merge changes Ib7daba9c,Ib692bff0
* changes:
  UpdateEngine: add WorkerThread annotation.
  UpdateEngine.AllocateSpaceResult: rename functions
2020-02-03 19:55:48 +00:00
Songchun Fan
7bf70c97b1 Merge "make adb install --incremental work" 2020-02-03 17:39:00 +00:00
TreeHugger Robot
3f5ed8b0ae Merge "Add API for updating quota type of files on external storage." 2020-02-03 11:18:32 +00:00
Martijn Coenen
6caa2d15be Add API for updating quota type of files on external storage.
In recent releases, Android has used the GID of files on external
storage to compute quota for various media types. This was implemented
by the kernel sdcard filesystem, which kept a mapping of file
extension->GID, and automatically set the correct GID on the lower
filesystem. We then simply asked the kernel "how much space is used by
the GID corresponding to image files" to determine how much space image
files took up on external storage.

sdcardfs will be removed starting with devices launching with R; this
means that the quota tracking implementation can no longer live in the
kernel on these devices. MediaProvider is a logical place to initiate
the quote handling in userspace, since it is responsible for all files
on external storage.

But since MediaProvider is now a mainline module, we don't want the
quota tracking implementation to live in MediaProvider itself. Instead,
provide a new @SystemAPI on StorageManager that can be called whenever
we need to set the quota type for a file on external storage. This
allows MediaProvider to call this API whenever a file is created on
external storage, or whenever its type is changed such that it requires
using a different quota type (eg going from an image file to an audio
file, which is presumably a rare case).

The API doesn't require a special permission, because the current
implementation is not a binder call, but an in-process call to modify
filesystem attributes. That means that the caller must already be in an
SELinux domain that allows these attribute modifications. Currently,
only MediaProvider and vold are allowed to modify these attributes.
Therefore, this API is effectively protected by SELinux.

Bug: 146419093
Test: builds. Functionality will be tested with existing
      StorageHostTest CTS test, but running that tests depends on other
      changes (eg a device without sdcardfs). This is tracked in the
      test plan for removing sdcardfs.
Change-Id: I9ffb11a89b17e5596fce70e96c06a8af2142e41f
2020-02-03 09:36:00 +01:00
Yo Chiang
b031685032 Add getExtension to android.os.IBinder interface
Provide a mechanism to extend and customize a binder interface without
having to modify the original (base) interface.
See the full motivation here: aosp/1099664

Bug: 147834064
Test: atest FrameworksCoreTests:BinderTest FrameworksCoreTests:BinderProxyTest
Change-Id: Idd3595b1302cf7ac0590d064e795ba0b75811af6
2020-02-03 16:07:35 +08:00
Songchun Fan
54c6aed58d make adb install --incremental work
With a simple Java apk (flipboard.app).

BUG: 133435829
Test: manual
Change-Id: If702afffc0e01cbb03f88560c0569fd23dda2350
2020-01-31 19:48:35 -08:00
Automerger Merge Worker
dc9e5ee91f Merge "GraphicsEnv: refactor to unify the debuggable logic" into qt-qpr1-dev am: e10e0fffcf
Change-Id: I15a25d43561f3176efaad4c92c928ea5d4223066
2020-01-31 18:37:58 +00:00
Chris Ye
24dc2c2d53 Merge "Change VibrationAttributes.Builder.replaceFlags() to @hide." 2020-01-31 17:19:08 +00:00
TreeHugger Robot
cd0c0c63b6 Merge "Clarified docs on WorkSource#size()" 2020-01-31 01:46:21 +00:00
Andrii Kulian
e11e951f66 Merge changes from topic "add_bundle_to_window_context"
* changes:
  Exempt-From-Owner-Approval: Fix usages of WindowManager.getDefaultDisplay() in f/b
  Add bundle options to Context#createWindowContext API
2020-01-31 01:16:34 +00:00
Andrii Kulian
e57f2dc246 Exempt-From-Owner-Approval: Fix usages of WindowManager.getDefaultDisplay() in f/b
Replace the existing usages of now-deprecated API
WindowManager.getDefaultDisplay() with WindowMetrics or
Context.getDisplay() in frameworks/base.

Bug: 128338354
Test: Build, auto test
Change-Id: I02d38a022c5e0e6e9d699f03d35b65d6c8126da9
2020-01-31 01:15:21 +00:00
Adam Bookatz
61899e5970 Remove UM.isUserOfType(userHandle) API
isUserOfType is @UserHandleAware, so there is no need for the version
that takes in a userHandle.
(See ag/9259675)

Test: atest UserManagerTest#testProfileTypeInformation
Bug: 139914710
Change-Id: I283900a6c0571c2dd1cdfd96fe7413f32ddb7adf
2020-01-30 11:48:29 -08:00
Yiwei Zhang
a3acf85a3b GraphicsEnv: refactor to unify the debuggable logic
By default, PR_SET_DUMPABLE is 0 for zygote spawned apps, except in the
following circumstances:
1. ro.debuggable=1 (global debuggable enabled, i.e., userdebug or eng builds).
2. android:debuggable="true" in the manifest for an individual application.
3. An app which explicitly calls prctl(PR_SET_DUMPABLE, 1).
4. GraphicsEnv calls prctl(PR_SET_DUMPABLE, 1) in the presence of
   <meta-data android:name="com.android.graphics.injectLayers.enable"
              android:value="true"/>
   in the application manifest.

So checking both ro.debuggable=1 and PR_GET_DUMPABLE is redundant.

Bug: b/144186877, b/148566223
Test: CtsAngleIntegrationHostTestCases
Test: CtsRootlessGpuDebugHostTest
Change-Id: Ica49254df2c7c090808411935cdeb8efd4e3cb51
Merged-In: Ica49254df2c7c090808411935cdeb8efd4e3cb51
(cherry picked from commit 097a3062b9)
2020-01-29 21:29:56 -08:00