Commit Graph

11963 Commits

Author SHA1 Message Date
Rubin Xu
d4f9d26e89 Merge "Do not suppress severe exception when password change fails" 2019-09-05 09:45:54 +00:00
Anthony Hugh
dcd137410c Merge "Refactor PermissionManager.SPLIT_PERMISSIONS" 2019-09-05 00:53:17 +00:00
TreeHugger Robot
d8c549a0e9 Merge "Add ability to get soundtrigger props from dsp" 2019-09-04 23:59:05 +00:00
Anthony Hugh
de787d4a83 Refactor PermissionManager.SPLIT_PERMISSIONS
Creating a SystemConfig from a non-system process is taking 500+ ms.
This CL instead exposes the needed split permissions from system_server
to optimize performance.

Tested locally and creating PermissionManager / retrieving SystemConfig
is now less than 1 ms.

Bug: 139828734
Bug: 139485700
Fixes: 139828734
Test: Added systrace / logs to PermissionController app and traced
runtime of onGrantDefaultRoles().

Change-Id: I111403e8dae3bc2b0acafc32e61aa5cd890fea29
2019-09-04 15:00:24 -07:00
Rubin Xu
6a7303d03c Do not suppress severe exception when password change fails
Redefine the return condition of LPU.saveLock{Password,Pattern}:

1. When password change fails due to the caller providing an
incorrect existing password (or password throttling is still
being enforced), treat this as a normal failure mode and return
false.
2. For all other exceptions thrown during password change,
throw it to the caller so it fails fast, instead of relying
on the caller to check the return value.

Bug: 62410009
Test: atest com.android.server.locksettings
Change-Id: I8fa6320b7134d18ed5dae1af7f6f05002100d291
2019-09-03 12:13:33 +01:00
Yin-Chia Yeh
51d8516b7a Camera: add camera audio restriction API
Test: new CTS tests
Bug: 135676184
Change-Id: I4f28d28972b9ced0fee0afe996ef1c4f68d0d2c9
2019-08-30 14:44:46 -07:00
TreeHugger Robot
8e6a69c3a2 Merge "Allow apps to collect which appops were noted" 2019-08-30 18:53:22 +00:00
Nicholas Ambur
1aa4b4b779 Add ability to get soundtrigger props from dsp
exposes sound trigger module properties to privileged
system apps with MANAGE_SOUND_TRIGGER permission

Bug: 139071862
Test: GTS test confirmed API accessible and providing valid data
Change-Id: Iec7ba6fc59912f44341fbe8d7f99193b9ead52f0
2019-08-30 10:10:18 -07:00
Philip P. Moltmann
2b08aafc14 Allow apps to collect which appops were noted
If private user data is send to an app the data provider should note an
app-op. This change adds a new API AppOpsManager#setNotedAppOpsCollector
that allows an app to get notified every time such an private data access
happens.

This will allow apps to monitor their own private data usage. Esp. with
big, old apps, distributed teams or 3rd party libraries it might not always
be clear what subsystems access private data.

There are three different situations how private data can be accessed and
an app op is noted:

1. Private data access inside a two-way binder call.
E.g. LocationManager#getLastKnownLocation. When we start a two way
binder transaction, we remember the calling uid via
AppOpsManager#collectNotedAppOps. Then when the data providing code
calls AppOpsManager#noteOp->AppOpsManager#markAppOpNoted the noted
app-op is remembered in
AppOpsManager#sAppOpsNotedInThisBinderTransaction. Then when returning
from the binder call, we add the list of noted app-ops to the
reply-parcel via AppOpsManager#prefixParcelWithAppOpsIfNeeded. On the
calling side we check if there were any app-ops noted in
AppOpsManager#readAndLogNotedAppops and then call the collector while
still in the binder code. This allows the collector e.g. collect a stack
trace which can be used to figure out what app code caused the
private data access.

2. Very complex apps might do permissions checks internal to themself.
I.e. an app notes an op for itself. We detect this case in
AppOpsManager#markAppOpNoted and immediately call the collector similar
to case (1).

3. Sometimes private data is accessed outside of a two-way binder call.
E.g. if an app registers a LocationListener an app-op is noted each time
a new location is send to the app. In this case it is not clear to the
framework which app-action triggered this app-op-note. Hence the data
provider has to describe in a AsyncNotedAppOp object when an why the
access happened. These objects are then send to the system server via
IAppOpsService#noteAsyncOp and then the collector in the app. There are
rare cases where a private data access happens before the app is running
(e.g. when a geo-fence is triggered). In this case we cache a small
amount of AsyncNotedAppOps (in AppOpsService#mUnforwardedAsyncNotedOps)
and deliver them when the app is ready for these events (in
AppOpsManager#setNotedAppOpsCollector).

Test: atest CtsAppOpsTestCases (includes new tests covering this
                                functionality)
Bug: 136505050
Change-Id: I96ded4a8d8d9bcb37a4555d9b1281cb57945ffa9
2019-08-30 08:18:50 -07:00
Mathieu Chartier
6c0c2ad9c0 Merge "Clean up class preloading" am: 4082bc010b am: 5b2da73fa3 am: 8a3781df49 am: 47313fedf1
am: 4d7a214df6

Change-Id: I7411cf45dafe63525df871ba7052aa1540a4d951
2019-08-29 16:18:49 -07:00
Mathieu Chartier
4d7a214df6 Merge "Clean up class preloading" am: 4082bc010b am: 5b2da73fa3 am: 8a3781df49
am: 47313fedf1

Change-Id: I8c0795592ebc008a63cdef02194c76c19be9fb53
2019-08-29 15:59:28 -07:00
Mathieu Chartier
47313fedf1 Merge "Clean up class preloading" am: 4082bc010b am: 5b2da73fa3
am: 8a3781df49

Change-Id: I925808dc2e79b928692833b22d6d8667cff748dc
2019-08-29 15:40:58 -07:00
Mathieu Chartier
5b2da73fa3 Merge "Clean up class preloading"
am: 4082bc010b

Change-Id: I719d2a223a1ab17aed832b618e26091cb3e368e8
2019-08-29 15:23:26 -07:00
Mathieu Chartier
83bea97333 Clean up class preloading
Remove logic to set heap target utilization to 0.8. The default is
0.75 and this should not have any fragmentation benefit since the
GC is compacting.

Removed some unused logging and a variable.

Test: TH

Change-Id: Ife7219e94fa0aa7f489569e16248cdd23d09089a
2019-08-29 12:03:09 -07:00
Rubin Xu
6762470fc2 Merge "Make DPM.isActivePasswordSufficient() synchronous again" 2019-08-29 12:24:00 +00:00
Tobias Thierer
92d2e65f0f Merge changes from topic "bug136256059_revert" am: aff95e5e7c am: 2d7cc3acf3 am: 2cf0f7a6c3 am: 0e77247fee
am: 901f252e89

Change-Id: I89ff2c864f64f8f6498adcacba7eaed8026afcee
2019-08-29 04:14:19 -07:00
Tobias Thierer
419d70912f Revert "Tweak RuntimeInit docs around MimeMap registration." am: 89bcfa5a21 am: f4cbf933b7 am: aa9b7696d1 am: 1b41ce4701
am: 1080bcbc06

Change-Id: Iec378b5d1ab929bb892436f1f6f58c1c8fe43dd0
2019-08-29 04:14:10 -07:00
Tobias Thierer
901f252e89 Merge changes from topic "bug136256059_revert" am: aff95e5e7c am: 2d7cc3acf3 am: 2cf0f7a6c3
am: 0e77247fee

Change-Id: Iff8a4d3a293f0aa7414b69d57e9f6e216f9ff44f
2019-08-29 04:01:43 -07:00
Tobias Thierer
1080bcbc06 Revert "Tweak RuntimeInit docs around MimeMap registration." am: 89bcfa5a21 am: f4cbf933b7 am: aa9b7696d1
am: 1b41ce4701

Change-Id: I9eda7d07d5b51aefcff9f6ce798214993cac5976
2019-08-29 04:01:36 -07:00
Tobias Thierer
0e77247fee Merge changes from topic "bug136256059_revert" am: aff95e5e7c am: 2d7cc3acf3
am: 2cf0f7a6c3

Change-Id: I4d7290175f5f5b41909c5428b66439402f22d12b
2019-08-29 03:50:24 -07:00
Tobias Thierer
1b41ce4701 Revert "Tweak RuntimeInit docs around MimeMap registration." am: 89bcfa5a21 am: f4cbf933b7
am: aa9b7696d1

Change-Id: Ice18e8e9e599856e12406b1190250477e58507ab
2019-08-29 03:49:53 -07:00
Tobias Thierer
2d7cc3acf3 Merge changes from topic "bug136256059_revert"
am: aff95e5e7c

Change-Id: I7b1caa27badbe5f77a0c12704d0050a6c15eb178
2019-08-29 03:25:10 -07:00
Tobias Thierer
f4cbf933b7 Revert "Tweak RuntimeInit docs around MimeMap registration."
am: 89bcfa5a21

Change-Id: I0ded17aa79749bd189f9149563787d9f56f7bf20
2019-08-29 03:24:59 -07:00
Tobias Thierer
aff95e5e7c Merge changes from topic "bug136256059_revert"
* changes:
  Revert "Move default MimeMap implementation to frameworks."
  Revert "Tweak RuntimeInit docs around MimeMap registration."
2019-08-29 10:05:20 +00:00
Tobias Thierer
f83bd777f3 Revert "Move default MimeMap implementation to frameworks."
This reverts commit 53f15f39f8.

Reason for revert: Caused slower app startup (I don't know why).

Change-Id: Id9e3811078bc435073f42996767589a711172400
2019-08-28 22:43:33 +00:00
Tobias Thierer
89bcfa5a21 Revert "Tweak RuntimeInit docs around MimeMap registration."
This reverts commit 098a533e78.

Reason for revert: Base CL caused slower app startup (I don't know why).

Change-Id: Ib67852b900ff2baeb34f5d553fb0d233f5475888
2019-08-28 22:43:06 +00:00
Sehee Park
01addff1b8 Merge "Define TAG_SYSTEM_DNS" am: fdc37666cb am: b849d1fe35 am: 1666fbe3e0 am: 822d3ea264
am: 2d7bbb4230

Change-Id: I84f21ab54cb9233f8ef9071f4a76a30b60bd1d31
2019-08-26 14:54:35 -07:00
Sehee Park
2d7bbb4230 Merge "Define TAG_SYSTEM_DNS" am: fdc37666cb am: b849d1fe35 am: 1666fbe3e0
am: 822d3ea264

Change-Id: I508a3608dbd883dd915b40c49eea9f025f8f485e
2019-08-26 13:46:38 -07:00
Mathieu Chartier
5834544053 Merge "Add phenotype property for profiling system server" 2019-08-26 16:37:25 +00:00
Sehee Park
822d3ea264 Merge "Define TAG_SYSTEM_DNS" am: fdc37666cb am: b849d1fe35
am: 1666fbe3e0

Change-Id: I722a17e3ae9a102e4012d982d1482d5d77ee42c0
2019-08-25 20:33:42 -07:00
Sehee Park
b849d1fe35 Merge "Define TAG_SYSTEM_DNS"
am: fdc37666cb

Change-Id: I8509280254eb207fe0e97ac5fb74abe599f692e6
2019-08-25 20:07:04 -07:00
Treehugger Robot
fdc37666cb Merge "Define TAG_SYSTEM_DNS" 2019-08-26 02:57:06 +00:00
Anna Trostanetski
a6fe3996e1 Merge "Rename android.compat.IPlatformCompat" am: ee716a23a2 am: 81af0fc8bb am: 20f25166c3 am: 884ef46cdc
am: 8649477e74

Change-Id: I1722a3c2fc9444b4e05932bb287d5ccd389f1493
2019-08-24 01:40:24 -07:00
Tobias Thierer
237f58d0d1 Merge "Tweak RuntimeInit docs around MimeMap registration." am: bc6371727c am: 41438c3730 am: b0c5a7af5a am: bc59f857aa
am: eb2a053326

Change-Id: Ib5ae1da4687531c71d24f2c9a1d0dba776ebd719
2019-08-24 01:37:23 -07:00
Tobias Thierer
89accb0841 Merge "Merge "Move default MimeMap implementation to frameworks." am: 19c3bdc88a am: 3f1d5d92fc am: 1b6d718387 am: 4999ce080d" into qt-qpr1-dev-plus-aosp
am: 867daa7d82

Change-Id: I8ff51aa59aeebda8d117e5142100b9b86ccbfac9
2019-08-24 01:14:13 -07:00
Xin Li
a770df1d2e DO NOT MERGE - Merge build QP1A.190711.019 into stage-aosp-master
Bug: 139893257
Change-Id: I94fce9c5c0b35cbb88ee27fa4cd037927964d2cd
2019-08-24 05:22:23 +00:00
Anna Trostanetski
8649477e74 Merge "Rename android.compat.IPlatformCompat" am: ee716a23a2 am: 81af0fc8bb am: 20f25166c3
am: 884ef46cdc

Change-Id: I11d25c6de70389b9f8fb74b914a247bca224e631
2019-08-23 22:04:54 -07:00
Tobias Thierer
eb2a053326 Merge "Tweak RuntimeInit docs around MimeMap registration." am: bc6371727c am: 41438c3730 am: b0c5a7af5a
am: bc59f857aa

Change-Id: I09976c187805459c01101e2c8dd1b056fc2067a5
2019-08-23 22:04:24 -07:00
Tobias Thierer
011723e214 Merge "Move default MimeMap implementation to frameworks." am: 19c3bdc88a am: 3f1d5d92fc am: 1b6d718387
am: 4999ce080d

Change-Id: Id03e7205f9f89ed34e53a4db7ff42f47138f1b48
2019-08-23 21:54:32 -07:00
Mathieu Chartier
7b31c74ddb Add phenotype property for profiling system server
Added the property profilesystemserver in the RUNTIME_NATIVE_BOOT
namespace. This property is overrides the system one if it is
present.

Bug: 138851258
Test: set the property manually and verify that system server is started
Test: with profiling

Change-Id: Ifd69530e52a717a381b3f91b15a74329614906f2
2019-08-23 09:50:00 -07:00
Rubin Xu
1985486fbf Make DPM.isActivePasswordSufficient() synchronous again
At the moment isActivePasswordSufficient() can return stale result
immediately after a password change since the latest password metrics
information is pushed from LSS to DPMS asynchronously (this is to
avoid deadlock between LSS and DPMS due to lock inversion). Fix this
by moving the password metrics ground truth to LSS, and make DPMS
query LSS about the password metrics when needed.

Bug: 37090873
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
Test: atest com.android.server.locksettings
Test: atest DeviceAdminHostSideTestApi24#testResetPassword_nycRestrictions
Test: atest DeviceAdminHostSideTestApi24#testRunDeviceOwnerPasswordTest
Test: atest MixedManagedProfileOwnerTest#testPasswordQualityWithoutSecureLockScreen
Test: atest MixedManagedProfileOwnerTest#testResetPasswordWithToken
Test: atest MixedManagedProfileOwnerTest#testPasswordSufficientInitially

Change-Id: Ib1d1716024b8a6a6554afdb4ee9824d457ed8308
2019-08-23 13:38:14 +01:00
Anna Trostanetski
884ef46cdc Merge "Rename android.compat.IPlatformCompat" am: ee716a23a2 am: 81af0fc8bb
am: 20f25166c3

Change-Id: Icbdf02f150e14b4c63b24e70e72f0faf3946e130
2019-08-23 03:15:57 -07:00
Tobias Thierer
bc59f857aa Merge "Tweak RuntimeInit docs around MimeMap registration." am: bc6371727c am: 41438c3730
am: b0c5a7af5a

Change-Id: Iaa0664ec6cf5f5f993d6cc5719120d7a9461037b
2019-08-23 03:15:04 -07:00
Anna Trostanetski
20f25166c3 Merge "Rename android.compat.IPlatformCompat" am: ee716a23a2
am: 81af0fc8bb

Change-Id: I815189c133f274d1a754327807915a02e642a44b
2019-08-23 02:54:36 -07:00
Tobias Thierer
b0c5a7af5a Merge "Tweak RuntimeInit docs around MimeMap registration." am: bc6371727c
am: 41438c3730

Change-Id: Id2c69ea4d9e0c75c871ab4ff3f7e609e4e2746cb
2019-08-23 02:53:18 -07:00
Tobias Thierer
4999ce080d Merge "Move default MimeMap implementation to frameworks." am: 19c3bdc88a am: 3f1d5d92fc
am: 1b6d718387

Change-Id: I0deb1fa3af8baf73841322477b914f60abe7641f
2019-08-23 02:50:36 -07:00
Tobias Thierer
1b6d718387 Merge "Move default MimeMap implementation to frameworks." am: 19c3bdc88a
am: 3f1d5d92fc

Change-Id: Ie30ff146804d651ddf922ea790150fbd57a9281d
2019-08-23 02:33:50 -07:00
Anna Trostanetski
81af0fc8bb Merge "Rename android.compat.IPlatformCompat"
am: ee716a23a2

Change-Id: I88fd93b46bcaa5ed782c407f2a9e9469fb0f5f0e
2019-08-23 02:26:15 -07:00
Tobias Thierer
41438c3730 Merge "Tweak RuntimeInit docs around MimeMap registration."
am: bc6371727c

Change-Id: I4c3cee161fec5f8065e4ea77f1bf5aa694909874
2019-08-23 02:25:10 -07:00
Tobias Thierer
3f1d5d92fc Merge "Move default MimeMap implementation to frameworks."
am: 19c3bdc88a

Change-Id: I4bb456d64ad27dabb7db920d6e40dd32c92af900
2019-08-23 02:13:28 -07:00