Commit Graph

14801 Commits

Author SHA1 Message Date
Eran Messeri
346cee22ff Merge "DPMS refactoring: Get Profile / Device owner" 2020-08-19 10:01:11 +00:00
Vishnu Nair
5084fa3e83 Merge "Enable compositor shadows" 2020-08-18 23:50:19 +00:00
Eran Messeri
9ac405b39e DPMS refactoring: Get Profile / Device owner
Get the Profile Owner or Device Owner directly, rather than using the
ComponentName provided by the caller to look it up.

For DevicePolicyManager methods that are only callable by DO or PO,
there is no need to use the ComponentName to distinguish between
different potential admins, as there could be only one.

Bug: 163028934
Test: atest FrameworksServicesTests:DevicePolicyManagerTest
Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest
Change-Id: I5fc3345101c8f61c12a9bbdbd224e95e719a0795
2020-08-18 22:50:31 +01:00
Vishnu Nair
545fc92c8c Enable compositor shadows
Composition strategy has been fixed in R. This enables the
change in master.

Fixes: 165076424

Change-Id: I710ee561da66c84d018ce93882d8594080e87280
2020-08-17 23:48:27 +00:00
Julia Reynolds
f9239b3afc Merge "Remove app ops indicators from notifications" 2020-08-14 13:17:42 +00:00
Alex Johnston
ae5e71786e Merge "Add precondition checks" 2020-08-13 22:21:27 +00:00
Alex Johnston
af1c3cb440 Add precondition checks
* Add precondition checks to check the call authorization
  and the calling user.
* Add CallerIdentity object and helper method to create
  and return a CallerIdentity object.
* Add isDeviceOwner check which takes in a CallingIdentity
* Update setLocationEnabled to use new precondition check

Bug: 162825394
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testSetLocationEnabled
Change-Id: I6054620aab661f302ebe0cb8c13bf906aad3cb68
2020-08-13 17:30:10 +01:00
Julia Reynolds
3a72daad2b Remove app ops indicators from notifications
Test: atest
Bug: 163076432
Change-Id: I5b7514f765811ffd3b0aca63d0108591755974ab
2020-08-13 11:33:43 -04:00
Miranda Kephart
016ef828b4 Merge "Make screenshot process unbind correctly" into rvc-qpr-dev am: 8a912c716b am: bebfed8bbf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12087986

Change-Id: I0f706c1aa3855d47286076aac4850912a3a664a7
2020-08-11 18:54:58 +00:00
Miranda Kephart
bebfed8bbf Merge "Make screenshot process unbind correctly" into rvc-qpr-dev am: 8a912c716b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12087986

Change-Id: I63421e3e9672afb61842b75e9cc7a476cc3fb532
2020-08-11 18:20:46 +00:00
Miranda Kephart
8a912c716b Merge "Make screenshot process unbind correctly" into rvc-qpr-dev 2020-08-11 18:00:13 +00:00
Miranda Kephart
6bb575bab1 Make screenshot process unbind correctly
There's a bug in ScreenshotHelper that causes the process not to
unbind properly. Now that the screenshot connection is kept track
of by the class, we don't need to compare its value at the
beginning and end of the started service before closing the
connection.

This also fixes an issue where screenshots didn't work right,
immediately after switching users (since the process is now
closed correctly, a new one can begin for the secondary user).

Bug: 158303623
Bug: 160355802
Fix: 158303623
Fix: 160355802
Test: manual; tested single screenshots and multiple in succession;
made sure that after switching users screenshots could be taken
immediately.

Change-Id: Idf25c6a60bdde8ab970c4af68884de798159ef3f
2020-08-11 09:32:29 -04:00
Hongwei Wang
c9be08b5aa Merge "Move ProtoLog to shared place" 2020-08-11 01:48:28 +00:00
Suprabh Shukla
9e07b814cb Merge "Switching StatLogger to uptime" 2020-08-10 20:14:59 +00:00
Dmitri Plotnikov
326e3ca1fc Merge "Add binder call stats tracking for individual UID" 2020-08-10 17:21:48 +00:00
Kevin Chyn
19293693e8 Merge changes from topics "async-challenge", "lss-sp"
* changes:
  Remove GenerateChallengeBlocking from FingerprintManager
  Change GenerateChallengeCallback from abstract class to interface
  3/n: Remove challenge from verifyCredential
  2/n: Remove unnecessary RequestThrottledException for verify paths
  1/n: Allow LockSettingsService to return Gatekeeper Password
2020-08-08 00:05:53 +00:00
Kevin Chyn
cdf4b2868a 3/n: Remove challenge from verifyCredential
Decouples the remainder of challenges from LockSettingsService.
Clients that require Gatekeeper HATs that wrap challenges should
request the Gatekeeper Password, then request LockSettingsService
to verify(GatekeeperPassword, Challenge). If the challenge is
biometric-related, it must be generated after LockSettingsService
completes verifyCredential, since LockSettingsService internally
does generateChallenge/resetLockout/revokeChallenge.

Bug: 161765592
Test: CtsVerifier biometric portion
Test: Reset fingerprint/face lockout
Test: atest com.android.server.locksettings

Change-Id: Icb384194ce5007b264068e697113d55cbf94945b
2020-08-07 12:17:29 -07:00
Kevin Chyn
6e6a735e65 2/n: Remove unnecessary RequestThrottledException for verify paths
verifyCredential and verifyTiedProfileChallenge return a
VerifyCredentialResponse object instead of a byte[] now. Thus,
any/all information regarding the authentication attempt is
received by callers. We no longer need to use exceptions as a
method of returning an alternate non-byte[] result.

The RequestThrottledException cannot be completely removed yet
because checkCredential returns a boolean and has no way of
returning a timeout yet. See b/161956762

Bug: 161765592

Test: Accept/Reject/Lockout the following
      1) Owner profile
      2) Managed profile with separate challenge
      3) Managed profile with unified challenge
Change-Id: Ia61c71bdde42dec34d8f2eac86d7ea964b1485c2
2020-08-07 12:17:29 -07:00
Kevin Chyn
e7694cc54c 1/n: Allow LockSettingsService to return Gatekeeper Password
For certain scenarios, it's ideal if a single prompt for the user's
credential could generate multiple Gatekeeper HATs, each containing
a distinct challenge. To do so, we expose the gatekeeper password
to the caller, which can then be sent to LockSettingsService to
mint a Gatekeeper HAT with a challenge specified by the caller.

Functionally, this is split into two pieces:
1) ILockSettings#verifyCredential* has a new flags parameter,
   which if contains VERIFY_FLAG_RETURN_GK_PW, returns the gatekeeper
   password
2) ILockSettings introduces a new method, verifyGatekeeperPassword,
   which takes the Gatekeeper Password and challenge, from which
   Gatekeeper creates a HardwareAuthToken. This is different than
   the rest of spBasedDoverifyCredential and __only__ requests
   Gatekeeper to create the HardwareAuthToken. It does not proceed
   to do other things such as unlocking keystore keys, unlocking
   managed profiles, etc.

Slightly cleaned up VerifyCredentialResponse: moved to builder pattern,
cleaned up serialization/deserialization

Returning a VerifyCredentialResponse object (instead of a byte[])
also makes it easier to debug failure cases (e.g. credential was
verified but HAT was null, vs originally we have no idea). Similarly,
this allows us to remove RequestThrottledException, which can help
make it easier to reason about code flow (less unexpected nullness)

Test: Clients with VERIFY_FLAG_RETURN_GK_PW have correct "accept,
      reject, timeout" behavior
Test: Current biometric enrollment works and not affected
Test: PIN/Pattern/Password verifyGatekeeperPassword works
      (see ag/12222644)

Bug: 161765592
Change-Id: I6e2a7ea234aac1a278b35cdaff62b1c7e3e9f205
2020-08-07 12:17:29 -07:00
TreeHugger Robot
153d5a5b34 Merge "Add logging for nearby." 2020-08-07 18:51:09 +00:00
Susi Kharraz-Post
b80a4c4f17 Merge "Fix argument order in Sharesheet Started logging" into rvc-qpr-dev am: 4eb63b672f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12332850

Change-Id: I42efb7d531b40f6681e69f13901ad16f849e60d9
2020-08-07 18:42:42 +00:00
Alison Cichowlas
c737ae678a Add logging for nearby.
Bug: 157234789
Test: with statsd_testdrive; new tests in ChooserActivityTest
Change-Id: Iad154c4f18058b8a2c67aa6ca909d615db639f95
2020-08-07 12:39:09 -04:00
Susi Kharraz-Post
ce030f1d75 Fix argument order in Sharesheet Started logging
Argument order for westworld logging number of direct and app targets
provided by the app got turned around in the function call. Fixing the
order by moving the lines

Bug: 162982477
Test: manual
Change-Id: I23d0d2861c169b8e6eb26ce3040913db42f3e01f
(cherry picked from commit 6eb59aa87e)
2020-08-07 16:20:42 +00:00
Susi Kharraz-Post
97e02fa146 Merge "Fix argument order in Sharesheet Started logging" 2020-08-07 14:36:19 +00:00
Fabian Kozynski
2e552e3625 Merge "Separate mic + camera from location" into rvc-qpr-dev am: 515db30387
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12316034

Change-Id: If659f1af8b48637b8bc047be5074e1483db44e0b
2020-08-07 13:32:02 +00:00
Fabian Kozynski
515db30387 Merge "Separate mic + camera from location" into rvc-qpr-dev 2020-08-07 13:22:04 +00:00
Fiona Campbell
8a6813c938 Merge "Simplify BrightnessSynchronizer" 2020-08-07 10:22:37 +00:00
Hongwei Wang
6014caf1ed Move ProtoLog to shared place
Designed to work with both WM and WM-Shell
- source code is moved to com.android.internal.protolog, on contrast,
  com.android.internal.logging is mainly used for uieventlogger
- the protolog-lib is defined in frameworks/base/Android.bp, similar to
  uieventloggerlib as well
- to include protolog, reference what's in services/core/Android.bp

See also go/protolog-migration-s

Bug: 161561475
Test: atest ProtoLogImplTest \
            ProtoLogViewerConfigReaderTest \
            WmTests:ProtoLogIntegrationTest \
            LogDataTypeTest \
            protologtool-tests
Change-Id: I249a5675527d54778ac01529b4cb39fb09cb5d59
2020-08-06 20:36:22 -07:00
Susi Kharraz-Post
6eb59aa87e Fix argument order in Sharesheet Started logging
Argument order for westworld logging number of direct and app targets
provided by the app got turned around in the function call. Fixing the
order by moving the lines

Bug: 162982477
Test: manual
Change-Id: I23d0d2861c169b8e6eb26ce3040913db42f3e01f
2020-08-06 15:08:31 -04:00
Dmitri Plotnikov
38daff3ce2 Add binder call stats tracking for individual UID
Test: $ adb shell cmd binder_calls_stats --work-source-uid <UID>
followed by
$ adb shell dumpsys binder_calls_stats
or
$ adb shell dumpsys binder_calls_stats --work-source-uid <UID>

Change-Id: I8e7d8d4b50b4bd068ad13cbdc75bd87b8c25e7a6
2020-08-05 17:33:43 -07:00
Zhen Zhang
201e1d41bd Merge "Fix bug: NullPointerException in ChooserActivity" into rvc-qpr-dev am: b0c1ac5b2e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12317069

Change-Id: I6e3d25d70fdcd2e7083199eb7b1a59d35bc41de2
2020-08-05 21:44:25 +00:00
Fabian Kozynski
70f3600c5c Merge "Separate mic + camera from location" 2020-08-05 20:39:05 +00:00
TreeHugger Robot
127fa988aa Merge "Fix bug: NullPointerException in ChooserActivity" 2020-08-05 20:03:46 +00:00
Dmitri Plotnikov
1a33ace694 Merge "Implement a PowerCalculator to attribute system service power to apps" 2020-08-05 18:15:16 +00:00
Fabian Kozynski
e534fb7782 Separate mic + camera from location
The different states are:
- No indicators enabled. Location is displayed using
LocationControllerImpl
- Only mic + camera indicators. Location is displayed using
LocationControllerImpl
- All indicators enabled. LocationControllerImpl is ignored.

Also, hardwire OP_MONITOR_HIGH_POWER_LOCATION as user sensitive.

Fixes: 162552566
Test: atest com.android.systemui.privacy
Test: manual

Change-Id: I1e7f62d6fccb4a3bc4fdf2a47a8d5c8a4f55421d
Merged-In: I1e7f62d6fccb4a3bc4fdf2a47a8d5c8a4f55421d
2020-08-05 13:54:42 -04:00
Zhen Zhang
7a6365ae7e Fix bug: NullPointerException in ChooserActivity
Add a null check for mResolverDrawerLayout in ChooserActivity

Bug: 162900698
Test: ChooserActivityTest
Change-Id: Id2b4442a0c5f22e1ecff04a1d20b48784ecc47dd
2020-08-05 16:13:51 +00:00
Suprabh Shukla
21489b3443 Switching StatLogger to uptime
Uptime is a better estimate of time spent in cpu. Adding uptimeNanos to
SystemClock to get finer timestamps.

Test: Manual:
`adb shell dumpsys alarm` should show sensible information under 'Stats'
printed at the end.

Bug: 162791194
Change-Id: I4f1c9d41c53ec03fc414730d38fd7a2233bb0569
2020-08-05 00:34:15 -07:00
Zhen Zhang
400a865f6c Fix bug: NullPointerException in ChooserActivity
Add a null check for mResolverDrawerLayout in ChooserActivity

Bug: 162900698
Test: ChooserActivityTest
Change-Id: Id2b4442a0c5f22e1ecff04a1d20b48784ecc47dd
2020-08-05 06:48:07 +00:00
Christian Wailes
3df6c69265 Merge "Rename blacklist to denylist" into rvc-dev-plus-aosp am: 47c5c8d1ef am: bafa9fb77e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12286466

Change-Id: I69c6713d5d5a11f68529ee71a52913ec5c1defea
2020-08-04 22:22:32 +00:00
Christian Wailes
bafa9fb77e Merge "Rename blacklist to denylist" into rvc-dev-plus-aosp am: 47c5c8d1ef
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12286466

Change-Id: I32bf6f846df71614413cd0846547bca2b070eda1
2020-08-04 22:05:17 +00:00
Christian Wailes
47c5c8d1ef Merge "Rename blacklist to denylist" into rvc-dev-plus-aosp 2020-08-04 21:41:59 +00:00
Hongwei Wang
c32b547d01 Migrate PiP logs to UiEvent
Per go/uievent, migrated PiP logs to UiEvent and also in this change
- Deprecates counterpart proto definitions in metrics_constants
- Record PiP logs from SysUI only, deprecates what's used to be in WM

Changes to the actual logging
- No longer logs the actual aspect ratio
- Disables logging the change of aspect ratio since there are flood of
  events can trigger this
- Splits menu visibility log to SHOW_MENU and HIDE_MENU
- Splits removal of PiP to TAP_TO_REMOVE and DRAG_TO_REMOVE
- No longer logs supportsEnterPipOnTaskSwitch
- Adds new RESIZE logging

Bug: 147508020
Test: $ANDROID_HOST_OUT/bin/statsd_testdrive -terse 90
Change-Id: I805d16ae6f30c07270b743f7ae1e66cbbd121131
2020-08-04 14:07:25 -07:00
Fabian Kozynski
2fb81031d8 Separate mic + camera from location
The different states are:
- No indicators enabled. Location is displayed using
LocationControllerImpl
- Only mic + camera indicators. Location is displayed using
LocationControllerImpl
- All indicators enabled. LocationControllerImpl is ignored.

Also, hardwire OP_MONITOR_HIGH_POWER_LOCATION as user sensitive.

Bug: 162552566
Test: atest com.android.systemui.privacy
Test: manual

Change-Id: I1e7f62d6fccb4a3bc4fdf2a47a8d5c8a4f55421d
2020-08-04 17:07:19 -04:00
Dmitri Plotnikov
6c3defc282 Implement a PowerCalculator to attribute system service power to apps
Test: atest FrameworksCoreTests:com.android.internal.os.SystemServicePowerCalculatorTest
Test: atest FrameworksCoreTests:com.android.internal.os.SystemServerCpuThreadReaderTest
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryStatsBinderCallStatsTest
Bug: 158232997

Change-Id: I14f6527524d6c32de460d80b33dfa0d6c0ad863c
2020-08-04 18:01:58 +00:00
Jack Yu
cb631bcf15 Merge changes from topic "refactor_pdcs"
* changes:
  Refactored precise data connection state
  Added hashcode for ApnSetting class
2020-08-03 22:54:50 +00:00
Ryan Mitchell
5fa0c6d621 Merge "OMS: Add config_signature policy handling" 2020-08-03 14:14:41 +00:00
Christian Wailes
1a08982881 Merge "Rename blacklist to denylist" 2020-08-03 14:02:47 +00:00
Orion Hodson
6f379f0346 Merge "Update art-team members in OWNERS files" am: 63ceb6abdb am: be3aeabfef am: 489aa7f7a2 am: fb84aa69d3 am: 181934aa7e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1376496

Change-Id: Ibbededd570645c4d6619c37406e1b160b8cfa77d
2020-08-03 10:16:15 +00:00
Orion Hodson
181934aa7e Merge "Update art-team members in OWNERS files" am: 63ceb6abdb am: be3aeabfef am: 489aa7f7a2 am: fb84aa69d3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1376496

Change-Id: I15a51e9275717d184ba410ce1f963b3898123e1c
2020-08-03 09:53:57 +00:00
Orion Hodson
fb84aa69d3 Merge "Update art-team members in OWNERS files" am: 63ceb6abdb am: be3aeabfef am: 489aa7f7a2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1376496

Change-Id: I3aa4516eb8a4785eacb61b7dec2dc6401915a466
2020-08-03 09:30:37 +00:00