Commit Graph

12261 Commits

Author SHA1 Message Date
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
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
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
TreeHugger Robot
a5db760252 Merge "Fix issue #23820845: Update AlarmManager.setAlarmClock() documentation..." 2017-12-08 21:51:14 +00:00
Andrii Kulian
80059ffc2e Merge "Implement object pool for lifecycler" 2017-12-08 16:29:02 +00:00
Neil Fuller
a7d21f8c32 Tidy up changes for timezone update code
Tidy up changes for timezone update code:
1) Remove some TODOs
2) Fix some logging
3) Remove ClockHelper in favor of java.time.Clock /
SystemClock.elapsedRealtimeClock()

No functional changes intended.

Bug: 31008728
Test: PTS: run pts -m PtsTimeZoneTestCases
Change-Id: Ib1ae04cbadfe71e4e340a0572e82f0bc3f68ef30
2017-12-08 15:41:14 +00:00
Alex Chau
d795827c31 API Review: Drop "Button" in is/setLogoutEnabled method
Bug: 70336452
Test: Logout button can still be controlled

Change-Id: I2ac24c4dec1ce90a77037a6415b4a6f77e959965
2017-12-08 11:32:23 +00:00
TreeHugger Robot
3a1e51ab80 Merge "Remove duplicate bitmaps from Notification parcels" 2017-12-08 11:03:39 +00:00
Tarandeep Singh
89a6c48a8b Add support for VR InputMethod.
This change adds support for VR-only IMEs in InputMethod framework.
In order to set this VR IME, setVrInputMethod(ComponentName) should be
called by VrManager.

When VrManager calls setVrInputMethod(), IMMS changes updates
the selected input method in a transient way i.e. it doesn't
update the Settings or input history. Once VR mode finishes,
it restores last input from settings.

Bug: 63037786
Test: Manually using the sample app in bug.

Change-Id: I1db7981b5198e7e203d4578cae7e5b6d20037d0d
2017-12-08 00:55:11 +00:00
Dianne Hackborn
f4ef6eb5f5 Changes need to implement heavy-weight gaming app tests.
We need to expose the CANT_SAVE_STATE importance for CTS to use.

I also found a serious issue with how instrumentation ApplicationInfo
is set up, where it doesn't have lots of important stuff like the
targetSdkVersion!  This is now fixed...  though ghod knows how this
will impact existing CTS tests, there could certainly be stuff relying
on code thinking it is running as targetSdk 0. :(

Finally delete the CantSaveState tests here, they are going to CTS.

Bug: 63937884
Test: ran new CTS tests
Change-Id: I42a73e0e83d799f8e5ff8ac4d4704a74ab5aab3e
2017-12-07 16:32:06 -08:00
Andrii Kulian
9c5ea9c153 Implement object pool for lifecycler
Lifecycler currently creates a lot of extra objects for transactions
and transaction items. This change adds an object pool, so that all
objects that are used in lifecycler will be reused as soon as a
transaction is scheduled.

This also fixes parcelling/unparcelling of IVoiceInteractor in launch
activity transaction item.

Bug: 64797980
Bug: 69977460
Test: android.app.servertransaction.ObjectPoolTests
Change-Id: I49125e28447f3565338b61dab6de843fcc1ca9cd
2017-12-07 16:16:13 -08:00
Etan Cohen
46efb48100 [RTT2] Update RTT service name
Change to a sensible name which doesn't conflict with legacy RTT
service.

Bug: 65108607
Test: unit test, integration test
Change-Id: I54855635061c09e8d4bd2e97bac049f2893de123
2017-12-07 13:53:44 -08:00
Andrii Kulian
018e216f67 Merge "Add transaction executor" 2017-12-07 20:31:45 +00:00
TreeHugger Robot
b2795710f3 Merge "DevicePolicyManager: Add key generation functionality." 2017-12-07 18:20:45 +00:00
Eran Messeri
852c8f121f DevicePolicyManager: Add key generation functionality.
This is the crux of the Verified Access feature implementation:
Adding the ability to generate KeyChain keys directly by the
secure hardware, rather than installing software-generated keys
into KeyChain.

Add generateKeyPair to the DevicePolicyManager, which delegates key
generation (via the DevicePolicyManagerService) to the KeyChainService.

Design highlights:
* The key generation is delegated via the DevicePolicyManagerService to
  check that only authorized callers request key generation in KeyChain.
* KeyChainService performs the actual key generation so it owns the key
  in Keystore outright.
* DevicePolicyManagerService then grants the calling app access to the
  Keystore key, so it can actually be used.
* Loading the public/private key pair, as well as attestation
  certificate chain, is done in the client code (DevicePolicyManager)
  to save parceling / unparceling those objects across process
  boundaries twice (for no good reason).

NOTE: The key attestation functionality (that includes Device ID) is
missing/untested. Will be added in a follow-up CL as this one is quite
big already.

HIGHLIGHT FOR REVIEWERS:
* API: New API in DevicePolicyManager.

Bug: 63388672
Test: cts-tradefed run commandAndExit cts-dev -a armeabi-v7a -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.DeviceOwnerTest#testKeyManagement -l DEBUG; adb shell am instrument 'android.security.tests/android.support.test.runner.AndroidJUnitRunner' (After building the KeystoreTests target and installing the apk)
Change-Id: I73762c9123f32a94d454ba4f8b533883b55c44cc
2017-12-07 15:12:30 +00:00
Robin Lee
ad7e72acc2 Remove duplicate bitmaps from Notification parcels
Created when the notification is marshalled and then unmarshalled
across process boundaries, since there are multiple references to the
same image from different places and they all get sent as separate
objects.

Fix: 70152868
Test: make FrameworksCoreTests -j30 && adb install -r ${ANDROID_PRODUCT_OUT}/data/app/FrameworksCoreTests/FrameworksCoreTests.apk && adb shell am instrument -e class android.app.NotificationTest -w com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I0a8c95207ab42260d88e5c206a04ab8386376ac4
2017-12-07 15:40:20 +01:00
TreeHugger Robot
dac644cd4a Merge "Deprecate inKeyguardRestrictedInputMode" 2017-12-06 22:27:51 +00:00
TreeHugger Robot
a044c1d27e Merge "Introduce more user management APIs" 2017-12-06 19:10:34 +00:00
Chris Tate
f10f83d507 Merge "Introduce ServiceConnection#onNullBinding()" 2017-12-06 18:47:17 +00:00
TreeHugger Robot
2e24967956 Merge "Add system service for slices" 2017-12-06 15:58:46 +00:00
Alex Chau
af9bb8d99e Introduce more user management APIs
- boolean stopUser(ComponentName admin, UserHandle userHandle)
- boolean logoutUser(ComponentName admin)
- List<UserHandle> getManageableUsers(ComponentName admin)
- Introduced Injector.binderWithCleanCallingIdentity

Bug: 67580550
Test: manually try each added API with a DPC on both primary and non-prijmray user.
Test: CTS tracked in b/67581357
Change-Id: I9789b9b29978d47bc22be6ecad6c5577e0f8eb5b
2017-12-06 14:38:25 +00:00
Andrii Kulian
88e05cb844 Add transaction executor
This adds TransactionExecutor class, that takes care of executing
a multi-stage ActivityManager client transaction in correct order.

First it executes all callbacks, while also making sure to transition
to the right pre- and post-execution state if requested.
In the end it cycles to the final requested lifecycle state.

This also switches activity launch process to use lifecycler - it
initializes activity launch and sets final desired state in the same
transaction.

Bug: 64797980
Test: android.app.servertransaction.TransactionExecutorTests
Change-Id: I306f9396fab263682f580cc8c924a3cedb40ef89
2017-12-05 18:44:50 -08:00
TreeHugger Robot
8cb0cf0aa9 Merge "Allow caller to specify target to start in setQuietModeEnabled" 2017-12-06 01:18:52 +00:00
Dianne Hackborn
a4eb31d55a Fix issue #23820845: Update AlarmManager.setAlarmClock() documentation...
...to note interactions with idle mode / doze

Test: made docs
Bug: 23820845
Change-Id: I2d17fd53bc662e0fc4c597b64bf38f155d197bee
2017-12-05 12:56:29 -08:00
Alex Chau
1beccb0fc2 Merge "Introduce logout button and DevicePolicyManager API to enable it" 2017-12-05 20:16:24 +00:00
Dianne Hackborn
d5b9266f01 Merge "Add major version code to platform." 2017-12-05 20:12:17 +00:00
Calin Juravle
d3392daa3b Merge "Add SystemApis to expose runtime profile information" 2017-12-05 19:10:34 +00:00
Jason Monk
8f5f7ff5fa Add system service for slices
Will be used to manage permissions and possibly pinned state for slices.

Test: manual
Change-Id: Ie53f4988f817ac5b920087567dbac751e2857dbf
2017-12-05 13:37:37 -05:00
Tony Mak
64fd8c0bdd Allow caller to specify target to start in setQuietModeEnabled
So, UMS can start the target once user is unlocked.

Test: No secure lock. Try turn off and on work mode by tapping work app.
Test: Have secure lock. Try turn off and on work mode by tapping work app.
Test: Turn off work mode. Reboot. Try to tap on any work app to turn on work mode.

BUG:69926710

Change-Id: Iaaccd5d763f7e36e5a43bad5261f1eb16060f9d6
2017-12-05 15:55:19 +00:00
Andreas Gampe
a2d0fc0012 Merge "Frameworks: Silently ignore InterruptedException" am: 7e717e09cd am: a6c6c4f5d3
am: d52c7c9206

Change-Id: Ia6588f13809132b705d372ba132ed3f7ef179bad
2017-12-05 02:57:35 +00:00
Andreas Gampe
d52c7c9206 Merge "Frameworks: Silently ignore InterruptedException" am: 7e717e09cd
am: a6c6c4f5d3

Change-Id: I737474738fa688d5bc651390409cbd792ffa7282
2017-12-05 02:43:53 +00:00
Andreas Gampe
a6c6c4f5d3 Merge "Frameworks: Silently ignore InterruptedException"
am: 7e717e09cd

Change-Id: I75da071918e7fc2e547df4e4d75121806c730ca2
2017-12-05 02:34:41 +00:00
Christopher Tate
5d73b6d7a9 Introduce ServiceConnection#onNullBinding()
Historically, if a service returns null from onBind(), the binding app
gets no information about the outcome:  the ServiceConnection is never
invoked.  We now introduce a new connection callback, onNullBinding(),
for apps that need to detect this situation.  When the service rejects
the binding by returning null, the onNullBinding() callback in the
associated ServiceConnection is invoked instead of onServiceConnected().

onNullBinding() has an empty default implementation, so there is no
binary-compatibility impact of this new interface method.

Bug: 67377345
Test: atest android.app.cts.ServiceTest

Change-Id: I224512c118f7d6e5c1c2bb69eca1902882e73594
2017-12-04 17:11:31 -08:00
Wale Ogunwale
36f46a8731 Merge "Don't send userLeaving hint when entering split-screen mode." 2017-12-05 00:21:20 +00:00
Andreas Gampe
c8d5fc8572 Frameworks: Silently ignore InterruptedException
Apps seem to rely on this undocumented behavior so that the
threaded sync adapter doesn't crash an app. That's really
bad on the app side, but we will have to live with it.

Bug: 67986472
Bug: 70122540
Test: m
Test: Device boots
Test: m cts && cts-tradefed run commandAndExit cts-dev --module CtsContentTestCases -c android.content.cts.SharedPreferencesTest
Change-Id: I1ee4dfba4ad29c4f66fa60d3c8f8a99900b3447a
2017-12-04 15:00:24 -08:00
Calin Juravle
45f8b29ce0 Add SystemApis to expose runtime profile information
The API allows a system apps which acquired
{@code android.permission.READ_RUNTIME_PROFILE} to snapshot the runtime
profiles of installed packages.

The API is implemented in a new service class (AndroidRuntimeManager)
accessible from the context using
context().getPackageManager().getAndroidRuntimeManager().

The main functionality is exposed as a one way call into the
AndroidRuntimeManager with the result being posted on a callback. The
profile is available to the caller as a read-only ParcelFileDescriptor.

This CL only adds the API interfaces and validation. It does not fully
implement the functionality.

oneway void snapshotRuntimeProfile(in String packageName,
  in String codePath, in ISnapshotRuntimeProfileCallback callback)

Bug: 30934496
Test: gts-tradefed -m GtsAndroidRuntimeManagerHostTestCases

Change-Id: Iaa6be4715840f24508acba3162ea9c1ab725bd38
2017-12-04 14:26:46 -08:00