Commit Graph

12294 Commits

Author SHA1 Message Date
Peter Visontay
f5ba933e9c Merge "Log an App Op when an accessibility action is performed." 2017-12-15 15:58:12 +00:00
Pavel Grafov
d1319bb059 Merge "Introduce DISALLOW_UNIFIED_PASSWORD." 2017-12-15 13:47:55 +00:00
Peter Visontay
19eb58959b Log an App Op when an accessibility action is performed.
Bug: 63907873
Test: manually tested that the app op is being logged for TalkBack and a 3rd party accessibility service. Ran UIAutomator-based tests to check that they work as expected.
Change-Id: I1a40d4ead52ba2258cc7ddc8be594a13895d8340
2017-12-15 12:05:32 +00:00
Peter Visontay
47197c8870 Merge "Log when an app shows a UI overlay." 2017-12-15 11:20:38 +00:00
Mady Mellor
414ad18358 Merge "Adds hint summary to slice" 2017-12-14 21:48:59 +00:00
Pavel Grafov
c4f87e9ceb Introduce DISALLOW_UNIFIED_PASSWORD.
When DISALLOW_UNIFIED_PASSWORD is enforced by managed profile
owner, the user is disallowed to user single lock for both primary
user and the profile.

DMP.isUsingUnifiedPassword() can be called by DPC to check if
this restriction is obeyed.

Test: make cts-verifier
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases -t
  com.android.cts.devicepolicy.ManagedProfileTest#testIsUsingUnifiedPassword
Test: cts-tradefed run cts -m CtsAdminTestCases -t
  android.admin.cts.DevicePolicyManagerTest#testIsUsingUnifiedPassword_failIfNotProfileOwner
Bug: 63909482
Change-Id: Ib758e32d4bf4012d805185bce874f481e17576ba
2017-12-14 20:53:27 +00:00
Peter Visontay
96449f61e6 Log when an app shows a UI overlay.
Bug: 63907873
Test: manually checked that the op is logged when an app shows an overlay.
Change-Id: I932a394a6d829a6a48d17e9d8c00e3e66623bd43
2017-12-14 18:28:17 +00:00
Eran Messeri
a173064047 DevicePolicyManager: Support attestation for generated keys.
If the KeyGenParameterSpec passed into
DevicePolicyManager.generateKeyPair contains an attestation challenge,
request an attestation record for the newly-generated key with the
challenge provided.

This particular implementation was chosen, rather than letting the
attestation record be generated at the same time as key generation, to
avoid having the attestation chain stored in Keystore and associated
with the generated alias.

The rationale is that this is a key that is potentially accessible by
multiple applications and the attestation chain may end up being sent
as a TLS client certificate chain, for example.

As the attestation challenge should be unique per device, to avoid
the potential of sending / sharing unique device information, by
explicitly requesting an attestation record after key generation, the
attestation record is only returned to the generateKeyPair client and
not persistend in Keystore.

Bug: 63388672
Test: New CTS test to be run with: 'cts-tradefed run commandAndExit cts-dev -a armeabi-v7a -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.DeviceOwnerTest#testKeyManagement -l DEBUG'
Change-Id: I95a9aef179173b571b533301ac438c675e8fe702
2017-12-14 18:09:05 +00:00
Antoan Angelov
ce0fe9b674 Merge "Add profile owner transfer functionality." 2017-12-14 15:09:05 +00:00
Peter Visontay
5607d0b72b Merge "Log an App Op when an accessibility service is registered." 2017-12-14 15:07:58 +00:00
arangelov
08841efcdf Add profile owner transfer functionality.
Test: cts-tradefed run cts-dev --module DevicePolicyManager --test com.android.cts.devicepolicy.TransferProfileOwnerTest
Test: bit FrameworksServicesTests:com.android.server.devicepolicy.DevicePolicyManagerTest
Bug: 69542817

Change-Id: I824fcb334e0ca3157fb67920f7583b309a14bf85
2017-12-14 11:46:47 +00:00
TreeHugger Robot
895d73105b Merge "Add more IntDef prefixes for auto-documenting." 2017-12-14 07:17:52 +00:00
Joe Onorato
c9f1a9e3dd Merge "Fix how we build the statsd protos." 2017-12-14 05:33:33 +00:00
TreeHugger Robot
4b1557d3a0 Merge "Give SliceManagerService a concept of pinned slices." 2017-12-14 04:09:55 +00:00
Jeff Sharkey
ce8db99114 Add more IntDef prefixes for auto-documenting.
Test: builds, boots
Bug: 70177949
Exempt-From-Owner-Approval: annotation-only changes
Change-Id: I76dde6054e06f52240bd4b1a0f196dcb74623608
2017-12-13 20:05:36 -07:00
Joe Onorato
62c220b20b Fix how we build the statsd protos.
This lets us include frameworks protos, and use the constants
and messages from them.

Change-Id: I609d6e524f780e6a5beea543a68561bede47813e
Test: make
2017-12-13 18:26:45 -08:00
Jason Monk
3706cf9e28 Merge "Add AppComponentFactory API" 2017-12-14 02:21:12 +00:00
Jeff Sharkey
2619e8f011 Merge "Start accepting Executors instead of Handlers." 2017-12-13 22:48:03 +00:00
TreeHugger Robot
9513cbfa28 Merge "Fix deadlock when fetching active voice interaction service component." 2017-12-13 21:38:14 +00:00
TreeHugger Robot
2cea154e52 Merge "Make DevicePolicyManager.isAffiliatedUser public" 2017-12-13 21:12:32 +00:00
Jeff Sharkey
8439ac08b1 Start accepting Executors instead of Handlers.
After discussion in API council, our new best-practices are to have
developers provide an Executor to dispatch callbacks/listeners on,
instead of the previous guidance of using a Handler.

Define Context.getMainExecutor() to easily obtain an Executor
associated with the main thread of application.  This allows new
APIs to require a @NonNull Executor.  Also define a new
@CallbackExecutor auto-doc annotation that explains background and
points developers at new Context method above.

Test: cts-tradefed run commandAndExit cts-dev -m CtsContentTestCases -t android.content.cts.ContextTest#testMainLooper
Test: cts-tradefed run commandAndExit cts-dev -m CtsContentTestCases -t android.content.cts.ContextTest#testMainExecutor
Bug: 70348426
Change-Id: I536892bcd80fcfba1bb1ddf67648c08a26d7ddd2
2017-12-13 13:59:04 -07:00
Jason Monk
a80bfb5d55 Add AppComponentFactory API
API to allow some classloader control over instantiation of
items from application's manifest. Unlike the first attempt
this does not encourage developers to extend Application, it simply
provides a small surface to allow control over the creation of objects
like Activities, Services, Receivers, and Providers.

Test: manual
Bug: 70623879
Change-Id: Idcab7c60f54ce3f4575ac29dcdcae321cf458bf3
2017-12-13 15:36:26 -05:00
Jason Monk
74f5e36f49 Give SliceManagerService a concept of pinned slices.
Allow launcher/assistant to pin slices. Also allow other apps
with access to a slice to pin it dynamically by adding a listener
to it. Dynamic pinnings can expire when the host app dies because
the binder will no longer be alive.

Public docs and unhiding will come in a later CL with CTS tests.

Bug: 68378571
Test: runtest --path frameworks/base/services/tests/uiservicestests
Change-Id: I1dd9a839f547fc949922b766ba4b54e6d50f3125
2017-12-13 14:28:09 -05:00
Winson Chung
bccd4b5b8e Fix deadlock when fetching active voice interaction service component.
- Notify AM whenever the active voice interaction service changes and
  dependency on VoiceInteractionManagerService from AM.

Bug: 70616466
Test: android.server.am.ActivityManagerAssistantStackTests
Change-Id: Ifd3dcbf0b6afc7b3e8a1d9d29bacd5b04af2a15d
2017-12-13 11:08:39 -08:00
Alex Chau
443b6431dd Make DevicePolicyManager.isAffiliatedUser public
- Simplified javadoc on device affiliation concept. "affiliated with the
  device" will be used to describe affiliation with device owner user,
  as defined in #isAffiliatedUser javadoc.
- Link to #isAffiliatedUser whenever device affiliation is mentioned

Bug: 67582080
Test: None
Change-Id: I4395ff980aa1626d6ff352d2f16777887784082c
2017-12-13 17:40:36 +00:00
Jeff Sharkey
6cff5c2840 Merge "API that reports first SDK level of the device." 2017-12-13 16:53:55 +00:00
Peter Visontay
1195083c0d Log an App Op when an accessibility service is registered.
Bug: 63907873
Test: manually tested that the app op is being logged for TalkBack when it's being registered as an accessibility service.
Change-Id: I10f36a86067950ef57c7afc7bf2f01efff46689c
2017-12-13 14:59:51 +00:00
TreeHugger Robot
25787529b5 Merge "Allow multiple standby buckets to be set in one IPC" 2017-12-13 04:33:39 +00:00
TreeHugger Robot
05e90071ec Merge "Add getDisallowedSystemApps to DevicePolicyManager" 2017-12-13 03:05:23 +00:00
Jeff Sharkey
28c660f11a API that reports first SDK level of the device.
This is different from SDK_INT, which can change due to OTA
software updates.

Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.cts.BuildTest
Bug: 69270887
Change-Id: Ic3f4b22b25dc08f3fbdbdf7622c953323447ea01
2017-12-12 14:11:14 -07:00
Alex Chau
b6a9f94d67 Add getDisallowedSystemApps to DevicePolicyManager
- The getDisallowedSystemApps is based on OverlayPacakgesProvider which
  is moved from ManagedProvisinoing
- getDisallowedSystemApps will be used by ManagedProvisioning
- createAndManageUser will now use getDisallowedSystemApps to disable
  disallowed system apps when creating users
- LEAVE_ALL_SYSTEM_APPS_ENABLED can be passed to createAndManageUser to
  enable all system apps
- ACTION_MANAGED_USER_CREATED will be broadcasted to ManagedProvisioning
  after managed user is created to take a system app snapshot

Bug: 65842187
Test: OverlayPackagesProviderTest passes
Test: Disallowed system apps does not appear in device owenr, managed
      profile, and managed users
Test: System app snapshot is created after provisinoing device owner,
      managed profile and managed users
Change-Id: I86f870f7814b5700cf5539e889fb6998514d110f
2017-12-12 18:47:29 +00:00
TreeHugger Robot
a22a7c2f97 Merge "Add DevicePolicyManager.isEphemeralUser" 2017-12-12 18:40:04 +00:00
Peter Visontay
ef1a2a4f4c Merge "Define an App Op for REQUEST_DELETE_PACKAGES." 2017-12-12 17:27:46 +00:00
Jason Monk
fed72bf199 Add Slice.Builder#addBundle
Its for support lib expansion in the future, not for dev use.

Bug: 68378561
Test: atest cts/tests/tests/slice
Change-Id: Ifc73e56c391bd4abed3b8db3c597d7dc794c1a3c
2017-12-12 09:30:28 -05:00
TreeHugger Robot
1a6d229e76 Merge "Proper autofill fix to let phone process autofill Settings activity." 2017-12-12 02:21:59 +00:00
Mady Mellor
39bf43519d Adds hint summary to slice
Test: manual -- in support lib with slice demo app, add a summary
      note that it appears when slice is in small format and doesn't
      appear when slice is in large format
Bug: 68378574
Change-Id: Id96e5597311189b0352e1763c678ccf7079d2db1
2017-12-11 17:42:09 -08:00
TreeHugger Robot
efdede0f4a Merge "Cancel alarms & jobs when an app's data is cleared" 2017-12-12 00:48:22 +00:00
Felipe Leme
2a580d18f6 Proper autofill fix to let phone process autofill Settings activity.
Test: adb shell am start com.android.settings/.RadioInfo
Fixes: 70506888

Change-Id: Id29bad2d20b621f7379eb6144c95dcc819949b3d
2017-12-11 16:19:48 -08:00
TreeHugger Robot
8c919fd93c Merge "Introduce API to enable existing packages on shared users" 2017-12-11 22:21:12 +00:00
Jason Monk
740a650dac Change colors to allow transport of more generic ints
This is in preparation for sliders, also add some hints/types that
will be used for sliders.

Test: atest cts/tests/tests/slice
Bug: 68378584
Change-Id: I8f6a8bb7c80854b51c421a437318975f517a2169
2017-12-11 14:44:00 -05:00
Jeff Sharkey
27674aedc0 Merge "Add auto-doc support for @StringDef." 2017-12-11 16:47:13 +00:00
Neil Fuller
7888d2f9eb Merge "Tidy up changes for timezone update code" 2017-12-11 14:35:22 +00:00
Alex Chau
5343fcb77d Introduce API to enable existing packages on shared users
- Also unhide setKeepUninstalledPackages
- installExistingPackage accpets delegation API because all app
  managemnet PIs did the same, including setKeepUninstalledPackages and
  enableSytemApp

Bug: 70017947
Bug: 65842106
Test: Install apps already installed in u0 in shared user should succeed
Test: Install apps in setKeepUninstalledPackages cache in shared user
      should succeed
Test: Install apps via delegated package should succeed
Test: Install apps via unaffiliated profile owner should fail
Test: Install apps not installed in any user or in APK cache shoudl fail
Change-Id: Iba563b2050abd0d1f46bfa06cfc0526b7b476b3b
2017-12-11 14:13:00 +00:00
Alex Chau
8d6e18c879 Add DevicePolicyManager.isEphemeralUser
Bug: 67580550
Test: The AP returns false in primary user.
Test: Create ephemeral user with createAndManageUser, ensure the API return true.
Change-Id: I1e670ca8a8c6171ddb94a1e4b1cb1a958f12919d
2017-12-11 13:44:00 +00:00
TreeHugger Robot
0b62766d27 Merge "API Review: Drop "Button" in is/setLogoutEnabled method" 2017-12-11 06:35:31 +00:00
Amith Yamasani
e878931414 Allow multiple standby buckets to be set in one IPC
SystemApi to pass a map of packagename to bucket mapping.
Reduces the number of IPC calls to be made by bucketing
ML app.

Bug: 63527785
Test: atest CtsAppUsageHostTestCases
Change-Id: I4172fd30cc310092a1f182ae26267de9148009b7
2017-12-10 18:52:20 -08:00
Jeff Sharkey
5db9a91135 Add auto-doc support for @StringDef.
Behaves pretty much the same as @IntDef, but now supports "suffix"
in addition to "prefix" when matching constants.

Test: manual docs output looks sane
Bug: 70406696
Change-Id: I35064b0f9f36f1f13ccdb40302d818a004014f15
2017-12-08 17:33:40 -07:00
Etan Cohen
6df47c6228 Merge "[RTT2] Update RTT service name" 2017-12-08 23:17:28 +00:00
Dianne Hackborn
8474c45b71 Merge "Changes need to implement heavy-weight gaming app tests." 2017-12-08 22:11:47 +00:00
Christopher Tate
1d99c391ec Cancel alarms & jobs when an app's data is cleared
In the same bit of code, fix a system restore issue:  in the
course of setup + restore, we reestablish permission grants and
notification state up front for the to-be-restored app, and
then bring in its data.  However, a data wipe is part of the
prologue for that data delivery -- so we were inadvertently
unwinding the permission grants and notification state restore
that we'd just performed.  Now, we distinguish the restore flow
from other clear-data operations so we don't unwind that operation.

Finally take the opportunity to elide a lot of copypasta code into
a single predicate-driven implementation.

Bug: 67508896
Bug: 69538432
Test: atest android.app.cts.AlarmManagerTest

Change-Id: I15c912c3c99645599ae9bd6fb7337fa86b4e5757
2017-12-08 13:53:42 -08:00