Commit Graph

10003 Commits

Author SHA1 Message Date
Rhed Jao
903e3bbcae Merge "Fix PackageManager did not recognize OTA when only upgrade product" 2021-11-24 01:56:41 +00:00
Yasin Kilicdere
c7b8b6acdd Merge "Change createUser API in UserManager to create a user with seed account data." 2021-11-22 14:24:16 +00:00
Yasin Kilicdere
d4a6b38ccd Change createUser API in UserManager to create a user with seed account data.
Add createUserWithAttributes method to UserManagerService.
Refactor createUser API in UserManager to call createUserWithAttributes in UserManagerService.
Add someUserHasSeedAccountOrAccount method to UserManager system API.
Did some refactoring on UserManagerService to prevent permission check chaining.

Bug: 204560945
Bug: 205100630
Test: atest UserManagerTest (cts)
Change-Id: I137ddcddba2ad422f74231fe37d3d2469b4562fc
2021-11-19 19:17:26 +00:00
Rhed Jao
d150569b03 Fix PackageManager did not recognize OTA when only upgrade product
- Introduce the PackagePartitions.FINGERPRINT to represent the
  fingerprint of the build and all system partitions. Using it to
  determine whether the system update has occurred.

- Update PackageManager relating modules to replace Build.FINGERPRINT
  with the PackagePartitions.FINGERPRINT.

Bug: 135224411
Test: atest PackagePartitionsTest
Change-Id: I4c6244cd71cd0954b4d551f62b81b6ce3e2c4b17
2021-11-19 13:59:52 +08:00
Treehugger Robot
4f10090196 Merge "Create StatsBootstrapAtomService" am: e9f913aee8 am: c2566e6582 am: c74d9d6911 am: c9c355889c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1885469

Change-Id: I30eeb8206bca1d8d298977a80bcd35c554e98fe5
2021-11-19 00:40:21 +00:00
Treehugger Robot
c9c355889c Merge "Create StatsBootstrapAtomService" am: e9f913aee8 am: c2566e6582 am: c74d9d6911
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1885469

Change-Id: Ia2fa8a3d576b41a0b55cbdd6dc29a3d3126e9cfa
2021-11-19 00:22:11 +00:00
Treehugger Robot
c74d9d6911 Merge "Create StatsBootstrapAtomService" am: e9f913aee8 am: c2566e6582
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1885469

Change-Id: I08d70d539650a2bec4e08681f3c6bd7bd12698cd
2021-11-19 00:04:36 +00:00
Treehugger Robot
c2566e6582 Merge "Create StatsBootstrapAtomService" am: e9f913aee8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1885469

Change-Id: I9fe270fa5bffb2edd912ba59fbc6c002497e76b4
2021-11-18 23:48:16 +00:00
Treehugger Robot
e9f913aee8 Merge "Create StatsBootstrapAtomService" 2021-11-18 23:25:21 +00:00
Tej Singh
da79f2a110 Create StatsBootstrapAtomService
Design doc is at go/statsd-bootstrap-logging. Creates a proxy service for
logging atoms from bootstrap processes to statsd. Service has one API,
which converts StatsBootstrapAtom into StatsEvent and logs to statsd.
This should only used by processes that start in the bootstrap namespace
and cannot directly link statsd's libraries to log to statsd.

Bug: 204889815
Test: booted, made sure binder service was published.
Change-Id: I09709a30a42a7a398234c995324f62a0d62ad24f
2021-11-18 13:27:21 -08:00
TreeHugger Robot
33f9db9246 Merge "Add public vibrate method with VibrationAttributes" 2021-11-18 17:12:46 +00:00
Xin Li
10d9972786 Merge sc-qpr1-dev-plus-aosp-without-vendor@7810918
Bug: 205056467
Merged-In: I13199bc39e9445929195f3d15579cbffe94e92b0
Change-Id: I35fa3c6c2abf679c51033f1395a08d511ed8739f
2021-11-18 17:00:37 +00:00
Makoto Onuki
5c53f4a047 Improve the javadoc for the new Process APIs.
Fix: 206696542
Test: treehugger
Change-Id: Iab420163f7970d2c5036e997f567812bf31fca22
2021-11-17 11:30:01 -08:00
Mayank Garg
a8d31ebbc8 Merge "Implementation for new createUser call" 2021-11-17 18:08:39 +00:00
Mayank Garg
04f9d971cc Implementation for new createUser call
Bug: 199446283
CTS-Coverage-Bug: 199446283
Test: m
Change-Id: Ib15377cdac667b3ab6842aa894bb0890e341d610
2021-11-17 15:45:05 +00:00
Martijn Coenen
e57620446b Have getVolumeList() take a userId instead of a UID.
getVolumeList() previously accepted a uid and a packagename. This
approach has a few issues:
1) The uid wasn't actually checked in the implementation to match the
calling UID, nor was the package name checked against the UID in all
cases.
2) The implementation assumed that the UID also specificies the userId
that we want to get the volumes for. This was historically true, but
with the new app cloning implementation, MediaProvider running in user 0
might ask for volumes in the clone user.

To fix this, explicitly pass in the userId that we're requesting volumes
for, and verify that the calling UID and the passed in package name
match.

Bug: 206624903
Test: atest packages/providers/MediaProvider
Change-Id: Idffbb4ae7740c1b9725af0974948dc55bf1f1fde
2021-11-17 13:59:54 +00:00
Lais Andrade
4e9af66050 Add public vibrate method with VibrationAttributes
Deprecate Vibrator.vibrate method that takes AudioAttributes and
introduce a new one that takes VibrationAttributes instead.

Update setAlwaysOnEffect to also take VibrationAttributes.

Introduce new public constructor for VibrationAttributes.Builder that
takes AudioAttributes, to be used in scenarios where the vibration
is meant to accompany an audio, and have similar attributes.

Bug: 163119475
Test: VibratorTest
Change-Id: I2721e3638aeb1aa4df3d515c3c0465923457dcc0
2021-11-17 13:25:45 +00:00
Bernardo Rufino
f5956d39ae Merge "Deprecate unsafe parcel APIs" am: 9f8b914c9f am: 87b6f365d3 am: 04f4d7aa21 am: df232c0faf
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1890540

Change-Id: Ied54481c20c266512190fb0a438b5756c87b7687
2021-11-17 10:57:04 +00:00
Bernardo Rufino
df232c0faf Merge "Deprecate unsafe parcel APIs" am: 9f8b914c9f am: 87b6f365d3 am: 04f4d7aa21
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1890540

Change-Id: I1cedae136129697fcf2df852034eb6c422e6316a
2021-11-17 10:37:31 +00:00
Bernardo Rufino
04f4d7aa21 Merge "Deprecate unsafe parcel APIs" am: 9f8b914c9f am: 87b6f365d3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1890540

Change-Id: If483ab5bd836e3700d67bc7ba6701f5e35a58b57
2021-11-17 10:20:56 +00:00
Bernardo Rufino
9f8b914c9f Merge "Deprecate unsafe parcel APIs" 2021-11-17 09:43:11 +00:00
Yifan Hong
e0d06afbe5 Merge "Add ServiceManager.registerForNotifications" am: ce80de5db0 am: 45ddf12cbc am: 3b546f86e0 am: 5c940e62c3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1883550

Change-Id: I873e0e99b6671858cdbc4ed85312f77fd2bbe077
2021-11-17 06:24:57 +00:00
Yifan Hong
5c940e62c3 Merge "Add ServiceManager.registerForNotifications" am: ce80de5db0 am: 45ddf12cbc am: 3b546f86e0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1883550

Change-Id: Ic5346dff7ffdb0f2d0d8e911cb931db167c7a2b0
2021-11-17 06:12:15 +00:00
Yifan Hong
3b546f86e0 Merge "Add ServiceManager.registerForNotifications" am: ce80de5db0 am: 45ddf12cbc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1883550

Change-Id: I8f7746e16b1e60fbc29a93dae3046b05f00c212d
2021-11-17 05:55:32 +00:00
Makoto Onuki
15b2e036ee Merge "Add new APIs to android.os.Process" 2021-11-16 22:10:35 +00:00
Dmitri Plotnikov
03fca4a0ef Merge "Reduce object allocation in procstate CPU attribution" 2021-11-16 21:10:12 +00:00
TreeHugger Robot
3ae8743e33 Merge "Made USER_TYPE_FULL_GUEST a @SystemApi" 2021-11-16 19:45:38 +00:00
TreeHugger Robot
f86b4b4974 Merge "Go to sleep on fold for foldable devices." 2021-11-16 04:09:38 +00:00
Makoto Onuki
13f2f6a511 Add new APIs to android.os.Process
- APIs the get the current process name
- APIs to get the process start "request" time

Fix: 205629074
Fix: 205337677
Test: atest CtsProcessTest

Change-Id: Id284fa169eb303011cdade6c3ab96e7026654612
2021-11-15 15:37:37 -08:00
Yifan Hong
6a2929d6ce Add ServiceManager.registerForNotifications
Add the API to call into IServiceManager.registerForNotifications.

Test: pass
Change-Id: Ia74d8a1bd5be767a076560bf8ee4af3095b4623a
2021-11-12 19:36:52 -08:00
Dmitri Plotnikov
72e63c66a4 Reduce object allocation in procstate CPU attribution
Bug: 197162116
Test: atest FrameworksCoreTests:BatteryStatsTests
Change-Id: Iee0ed61305248f69943a8e4a6c9baacdd523df0c
2021-11-12 17:37:00 -08:00
Bernardo Rufino
36cf3994ed Deprecate unsafe parcel APIs
Deprecate unsafe parcel APIs and point to the safer ones that take the
expected type as parameter. Where applicable also mention the typed ones
that take the creator as argument since those are also more performant.

APIs deprecated here are:
* readMap(Map, ClassLoader)
* readList(List, ClassLoader)
* readHashMap(ClassLoader)
* readArrayList(ClassLoader)
* readArray(ClassLoader)
* readSparseArray(ClassLoader)
* readParcelable(ClassLoader)
* readParcelableCreator(ClassLoader)
* readSerializable()

Test: Builds
Bug: 195622897
Bug: 199275680
Bug: 205985058
Change-Id: Ic41ae13e0d965b1fd346985c77c1eecc605285b2
2021-11-12 17:56:53 +00:00
Makoto Onuki
a6a60b7750 Cache more users in UserHandle.of()
We pass around more and more UserHandle these days because of mainline
modules, because even @SystemApi are not allowed to use integer user
IDs.

So let's make sure even in extreme cases we don't keep allocating
new UserHandle's for the same user.

Test: atest $ANDROID_BUILD_TOP/frameworks/base/core/tests/coretests/src/android/os/UserHandleTest.java
Test: atest $ANDROID_BUILD_TOP/cts/tests/app/src/android/app/cts/UserHandleTest.java
Change-Id: Iae34e1d11638ced53246d68d310ad62e058dba93
2021-11-10 15:42:19 -08:00
Donald Chai
a67a245111 Merge "Fix some obvious typos and copy-paste bugs." am: 1cfd0c7546 am: b78ad69fa0 am: 9378d318f4 am: 13b24677c2 am: b5217cf799
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1851673

Change-Id: Ic3f9eea675bc6c17eca035146b0fc948846191f3
2021-11-10 23:04:50 +00:00
Hao Ke
f0b2d8e383 Merge "Adding typed Parcel readMap and readHashMap APIs." am: c1f406eb81 am: 4c669c6685 am: 9bc154843f am: eb937f4dc2 am: fd018845a0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1882888

Change-Id: I3f8a04dd92d7fa0c6d3efe750a9ab9c5cccbf1d8
2021-11-10 23:04:01 +00:00
Donald Chai
b5217cf799 Merge "Fix some obvious typos and copy-paste bugs." am: 1cfd0c7546 am: b78ad69fa0 am: 9378d318f4 am: 13b24677c2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1851673

Change-Id: I426f2f418a371a60a5ed6bf752190536d35dd5c6
2021-11-10 22:46:44 +00:00
Hao Ke
fd018845a0 Merge "Adding typed Parcel readMap and readHashMap APIs." am: c1f406eb81 am: 4c669c6685 am: 9bc154843f am: eb937f4dc2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1882888

Change-Id: I1edee63ffcef1140016e96beab414028ff00eedc
2021-11-10 22:45:49 +00:00
Donald Chai
13b24677c2 Merge "Fix some obvious typos and copy-paste bugs." am: 1cfd0c7546 am: b78ad69fa0 am: 9378d318f4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1851673

Change-Id: I6023e92cb9c6b338f96fbb85c9df51b81286e0a1
2021-11-10 22:24:56 +00:00
Hao Ke
eb937f4dc2 Merge "Adding typed Parcel readMap and readHashMap APIs." am: c1f406eb81 am: 4c669c6685 am: 9bc154843f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1882888

Change-Id: Ica5ee4975ff02abcd126372d6372db4ea3ace057
2021-11-10 22:24:30 +00:00
Donald Chai
1cfd0c7546 Merge "Fix some obvious typos and copy-paste bugs." 2021-11-10 21:16:52 +00:00
Hao Ke
c1f406eb81 Merge "Adding typed Parcel readMap and readHashMap APIs." 2021-11-10 21:14:41 +00:00
Hao Ke
446144c9a8 Adding typed Parcel readMap and readHashMap APIs.
Added typed read API of `readMap` and `readHashMap`,
that takes extra clazz parameters check that the class written
on the wire is the same or a descendant from the one provided
as the key and value arguments.

Doing so could enhance the security of Parcel deserialization,
as it would prevent unexpected types of objects being deserialized.
More details can be found at go/safer-parcel.

Test: atest -d android.os.cts.ParcelTest
Bug: 195622897
Change-Id: Ife9d1d7277b6345a6e11856179c301339b2dc087
2021-11-10 15:45:12 +00:00
Santos Cordon
4f7ca41f6f Go to sleep on fold for foldable devices.
Allow configuration of foldable states to indicate the device
should sleep when entering certain states.

Test: Check that device still wakes up on unfold, and sleeps on fold.
Bug: 180154690
Change-Id: I179d93ec506deee7e9da7d9190934c52a0bc188f
2021-11-10 14:26:16 +00:00
Jooyung Han
03e6f7969f Merge "Parcel: add new methods for interface list/array" am: 2500e149bc am: ef7ca34bbe am: 90d9045ad5 am: ecc29bfce7 am: 1d52ea1455
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1881006

Change-Id: I225b171275ae178b655483f8994c2f53dfc3fe94
2021-11-10 02:09:07 +00:00
Jooyung Han
1d52ea1455 Merge "Parcel: add new methods for interface list/array" am: 2500e149bc am: ef7ca34bbe am: 90d9045ad5 am: ecc29bfce7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1881006

Change-Id: I5f809b781cf8e62624840183659c25ce1bcb31d1
2021-11-10 01:51:11 +00:00
Jooyung Han
ecc29bfce7 Merge "Parcel: add new methods for interface list/array" am: 2500e149bc am: ef7ca34bbe am: 90d9045ad5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1881006

Change-Id: I375c7a2dfe80addbc4cf8dcb1dfcd4455aa31c1a
2021-11-10 01:31:48 +00:00
Dmitri Plotnikov
7582c4accc Merge "Add process state to BatteryUsageStats atoms" 2021-11-09 19:24:22 +00:00
Jooyung Han
bbacfde150 Parcel: add new methods for interface list/array
New methods are to write a list/array of interface objects and to read
them again.

Basically these methods are quite similar to those for IBinder objects.
But when reading IInterface objects, we need to create an array of the
exact type and need a way of converting IBinder into IInterface value.

Two functional interfaces (newArray and asInterface) are just like
while Parcelable.Creator does. We could pass "Stub" class which is
generated by the AIDL compiler and use reflection to create a typed
array instance and call `asInterface` method. But rather than relying on
reflection, passing `IMyInterface[]::new` and
`IMyInterface.Stub::asInterface` would be simple enough to use.

Bug: 205195901
Test: atest -d android.os.cts.ParcelTest
Change-Id: I275db9ebf52d3b9713fa105d81da3a1d289d96a8
2021-11-09 10:26:29 +09:00
Bernardo Rufino
3690f92461 Merge "Refactor Bundle for thread-safety of Bundle.hasFileDescriptors()" am: f5cc73d25f am: adcfd2f940 am: f509e2d9b7 am: 7ceb94a294 am: 7e83fa172f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1878339

Change-Id: Idefb8a2b014d08da48ae9fb30368c718546020cd
2021-11-05 21:24:16 +00:00
Roopa Sattiraju
b39c550a58 Merge "Change getEnabledComponentOverrides return type" am: 30cd5df67f am: 3374e0478a am: 27d3253e54 am: 802dd06c6b am: c11076edb3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1853043

Change-Id: Icf59fba3efa0a665198066c1f813746a0489d1ea
2021-11-05 21:23:39 +00:00