Commit Graph

12427 Commits

Author SHA1 Message Date
TreeHugger Robot
23374d63ec Merge "Move startUserInBackground to standalone and avoid user from being stopped unnecessarily" 2018-01-15 13:56:36 +00:00
TreeHugger Robot
82548f4bc3 Merge "Implement DISALLOW_SHARE_INTO_MANAGED_PROFILE" 2018-01-13 16:40:41 +00:00
Lucas Dupin
e1daf52b92 Merge "Allow custom keyguard "prompt reason"" 2018-01-13 01:13:26 +00:00
TreeHugger Robot
bc569cb25c Merge "Fix object pool for lifecycler" 2018-01-12 23:27:55 +00:00
Kodlee Yin
d6ae867fb2 Merge "Create Notification.Action.SemanticAction intdef." 2018-01-12 21:20:54 +00:00
Andrii Kulian
0447068f27 Fix object pool for lifecycler
The original implementation of object pool for lifecycle
transactions tried to always recycle objects after a
transaction was scheduled. In case when a client was running
in the same process this lead to objects being emptied before
it could actually perform the transaction.
Also when checking if object was already in the pool we should
use "==" instead of equality check.

Bug: 70554032
Bug: 71346774
Test: com.android.server.am.ClientLifecycleManagerTests
Test: android.app.servertransaction.ObjectPoolTests
Change-Id: I85fb3dae4589c2390e00a37144da0d285d16d151
2018-01-12 13:08:25 -08:00
Rubin Xu
cc391c2c13 Implement DISALLOW_SHARE_INTO_MANAGED_PROFILE
Add a user restriction to allow profile owners to enforce a stronger
isolation of managed profile by preventing users sharing data into
the profile. This is achieved by disabling a subset of built-in cross
profile intent filters added by ManagedProvisioning during profile
inflation.

Implementation wise, DevicePolicyManagerService listens for the restriction
change and notifies ManagedProvisioning to modify the built-in intent
filters. This is needed since ManagedProvisioning has ground truth of all
built-in intent filters and manages them. It also has the advantage that
ManagedProvisioning only needs to run when a policy change happens.

Test: cts-tradefed run cts-dev -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.ManagedProfileTest#testDisallowSharingIntoProfileFromPersonal
Test: cts-tradefed run cts-dev -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.ManagedProfileTest#testDisallowSharingIntoProfileFromProfile
Bug: 63911046
Change-Id: Ia6d12a5086627d1280325cd19d6e3a0752dae633
2018-01-12 19:01:40 +00:00
Kodlee Yin
c72c44d90d Create Notification.Action.SemanticAction intdef.
Currently, Notification.Action has no indication of what it will do
when the associated PendingIntent is triggered. SemanticAction will
allow app developers to specify what the Action will do. This is
useful, for example, in the case where a user wants to answer an
incoming message in a hands-free manor. As, potentially, the
Notification may contain multiple actions like Reply, Mark as Read,
etc, this hands-free application would need to differentiate the
reply Action from the Mark as Read action. SemanticAction would
provide a means to do so.

Test: runtest -x
core/tests/coretests/src/android/app/NotificationTest.java
Bug: 67717177
Bug: 70859253
Change-Id: I8179afdd5da77be0037a8c03e125d8178cecc568
2018-01-12 10:23:27 -08:00
Alex Chau
b6ef86985d Move startUserInBackground to standalone and avoid user from being stopped unnecessarily
- Removed START_USER_IN_BACKGROUND in createAndMaangeUser
- Added startUserInBackground that can return whether user is started. It checks for whether more users can be started without stopping existing users.
- Added canStartMoreUsers in UserController and ActivityManagerService
- Updated javadoc of a few user management API in DevicePolicyManager
- In UserController.startUser, return false if maximum running user limit is reached when starting user in background
- Only stop guest or ephemeral user that is being switched out in stopGuestOrEphemeralUserIfBackground

Bug: 71694116
Test: Create 3 ephemeral users, can startUserInBackground for first two but failed for the third.
Test: Switch to first user, second user is not affected.
Test: Switch out first user, second and third user is not affected. Can startUserInBackground for third user at this point.
Change-Id: I46aa1d8788851b10b5b169ac656cb982791de479
2018-01-12 15:07:22 +00:00
Andreas Gampe
4b5a9ce6b3 Merge "Frameworks: Move SharedPreferencesImpl to tristate" am: 5edae415b0 am: 75dc3e9cf4
am: 07903b8ded

Change-Id: Idbfd80b32c27cfd2d24b37b5b868820e6ed7a283
2018-01-12 02:58:14 +00:00
Andreas Gampe
07903b8ded Merge "Frameworks: Move SharedPreferencesImpl to tristate" am: 5edae415b0
am: 75dc3e9cf4

Change-Id: Ifbe406bda739b3689ca9ed95493a8eca7a9276ae
2018-01-12 02:42:43 +00:00
Andreas Gampe
75dc3e9cf4 Merge "Frameworks: Move SharedPreferencesImpl to tristate"
am: 5edae415b0

Change-Id: Idef313e1a0c1a69434783da2441a84aa6e12409e
2018-01-12 02:32:15 +00:00
Treehugger Robot
5edae415b0 Merge "Frameworks: Move SharedPreferencesImpl to tristate" 2018-01-11 23:52:46 +00:00
Jerry Zhang
68ad3d119c Merge "DO NOT MERGE: Add ScreenObserver" 2018-01-11 23:50:34 +00:00
Holly Jiuyu Sun
613e01227b Merge "Add EuiccCardManager and EuiccCardController." am: ec25ea1520
am: edc14bd3c4

Change-Id: I5ac16981ac7ca4d492387a340f10a34b8ab1d804
2018-01-11 23:11:05 +00:00
TreeHugger Robot
0b2249786f Merge "Move A11y events throttling away from View(RootImpl)" 2018-01-11 22:57:35 +00:00
Ben Gruver
c4a5b5010f Merge "Implement harmful app warning at activity launch" 2018-01-11 22:20:38 +00:00
Lucas Dupin
c80c67e7bc Allow custom keyguard "prompt reason"
Adds the possibility of presenting a custom message on
the keyboard if you're trying to dismiss the keyguard.

This is particularly useful when you're showing the
bouncer because custom authentication (SmarLock)
failed.

Test: launch FLAG_SHOW_WHEN_LOCKED activity and
      call KeyguardManager#requestDismissKeyguard
Fixes: 63940122
Change-Id: I0d88c0e59521887efa56d74874062b2b14970e4e
2018-01-11 13:15:31 -08:00
Ben Gruver
1ab3d6e56b Implement harmful app warning at activity launch
Bug: 63909431
Test: manual

Change-Id: I8a5497421cb8130af8cdd5129b0f6e1707a01e36
2018-01-11 12:13:29 -08:00
Jerry Zhang
1b4b3c4e9b DO NOT MERGE: Add ScreenObserver
ScreenObserver allows system components to
monitor the screen lock state.

Bug: 68054513
Test: manual
Change-Id: I50f4690f68443f676d17e93efb1b7cb0857abd9e
2018-01-11 19:38:27 +00:00
Sudheer Shanka
5b9f065754 Merge "Update DPMS to push active admins info to UsageStatsService." 2018-01-11 18:45:15 +00:00
Holly Jiuyu Sun
3d6b53c075 Add EuiccCardManager and EuiccCardController.
EuiccCardManager is in the same path with EuiccManager.
EuiccCardController is in the same path with EuiccController.
Use getAllProfiles() as an example interface.
The implementation of EuiccCard and its content will be added in a
follow up CL.
The new API is marked as @hide and TODO for @SystemApi.

Bug: 38206971
Test: test on phone
Change-Id: I153937c0f79bdd1a00b06b234a6e254a3f43072c
Merged-In: I153937c0f79bdd1a00b06b234a6e254a3f43072c
2018-01-11 10:30:43 -08:00
Jiuyu Sun
9e7bf9e304 Merge "Add EuiccCardManager and EuiccCardController." 2018-01-11 18:09:40 +00:00
Lucas Dupin
606c532dca Merge "Allow custom keyguard transient message" 2018-01-11 17:23:59 +00:00
Bryce Lee
609e37b35b Merge "Pause activity when making visible from stopped state." 2018-01-11 15:27:10 +00:00
Antoan Angelov
f79af5e4a1 Merge "Call PROFILE/DEVICE_OWNER_CHANGED broadcast and onTransferCompleted callback upon a successful transfer." 2018-01-11 11:18:05 +00:00
TreeHugger Robot
e6050a4a0f Merge changes from topic "messaging_people"
* changes:
  Clipping to the top roundness when scrolling
  Made the notification side paddings consistent
  Changing messaging style and overall visual adoption
  Improved the MessagingStyle API with Person
  Added People to the Notification API
2018-01-11 03:07:09 +00:00
Holly Jiuyu Sun
5c11024d13 Add EuiccCardManager and EuiccCardController.
EuiccCardManager is in the same path with EuiccManager.
EuiccCardController is in the same path with EuiccController.
Use getAllProfiles() as an example interface.
The implementation of EuiccCard and its content will be added in a
follow up CL.
The new API is marked as @hide and TODO for @SystemApi.

Bug: 38206971
Test: test on phone
Change-Id: I153937c0f79bdd1a00b06b234a6e254a3f43072c
2018-01-10 18:59:50 -08:00
Sudheer Shanka
101c353a7d Update DPMS to push active admins info to UsageStatsService.
Bug: 71710099
Test: atest services/tests/servicestests/src/com/android/server/usage/AppStandbyControllerTests.java
Test: atest services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
Change-Id: Ia46be9008470b0228978306b9992560fc4f2c586
2018-01-10 17:19:55 -08:00
TreeHugger Robot
c66fd4a421 Merge "FRP: Make SystemAPI" 2018-01-10 23:09:19 +00:00
Lucas Dupin
ef88654459 Allow custom keyguard transient message
TrustAgentServices can now present a transient
message on the lock screen or AoD.

Bug: 63940122
Test: call TrustAgentService#showKeyguardErrorMessage via service,
      lock device, wait for message to show up.
Change-Id: I222118787a1afb526ce7c90d46c41d0f20d8d912
2018-01-10 14:07:56 -08:00
Dianne Hackborn
84c699a4b9 Merge "Swap "foreground service" and "bound foreground service" proc states." 2018-01-10 21:14:31 +00:00
arangelov
8bae4eaa4d Call PROFILE/DEVICE_OWNER_CHANGED broadcast and onTransferCompleted callback upon a successful transfer.
Test: cts-tradefed run cts-dev --module DevicePolicyManager --test com.android.cts.devicepolicy.MixedProfileOwnerHostSideTransferTest#testTransferOwnerChangedBroadcast
Test: cts-tradefed run cts-dev --module DevicePolicyManager --test com.android.cts.devicepolicy.MixedProfileOwnerHostSideTransferTest#testTransferCompleteCallback
Test: cts-tradefed run cts-dev --module DevicePolicyManager --test com.android.cts.devicepolicy.MixedDeviceOwnerHostSideTransferTest#testTransferOwnerChangedBroadcast
Test: cts-tradefed run cts-dev --module DevicePolicyManager --test com.android.cts.devicepolicy.MixedDeviceOwnerHostSideTransferTest#testTransferCompleteCallback
Bug: 69542936
Bug: 69543044
Change-Id: Ifbe3ac0029794eba185e538e5a490073d5309f0b
2018-01-10 21:07:44 +00:00
Bryce Lee
0bd8d42c0a Pause activity when making visible from stopped state.
It is possible for an activity to become visible without gaining
focus. For example, if a paused activity in split-screen finishes
itself, the activity below will become visible. Currently this
activity will not exit the stopped state. This changelist
addresses this inconsistency by cycling the activity to paused if
it becomes visible in the stopped state.

Change-Id: I170d586793dadb0d6ff59d1ad68f2d94699f9ca6
Bug: 71582913
Test: atest ActivityRecordTests#testPausingWhenVisibleFromStopped
2018-01-10 13:04:16 -08:00
Selim Cinek
afeed29bdc Changing messaging style and overall visual adoption
The messaging style is changed to a bubble-less design.
In addition are we also updating a few spacings in
order for it to look nicer / more balanced.

Test: manual
Change-Id: I43326bd8a23cd1f1d5964d2d6740fde99d29c7e4
2018-01-10 20:14:03 +00:00
Peter Visontay
5fdef14b82 Merge "Mark AppOpsManager.setMode() @TestApi." 2018-01-10 12:54:40 +00:00
Amith Yamasani
a0ee7c35e2 Merge "Track last job run time" 2018-01-10 00:05:22 +00:00
Dianne Hackborn
10fc4fdd13 Swap "foreground service" and "bound foreground service" proc states.
It has become apparent that apps running foreground services is
a much more important (and less common) state than all the various
ways apps run in the foreground because of the system being bound
to them or whatever else.  So push this up about the bound foreground
service state, right after the explicit TOP state.  Then we can
keep these together as "the app is explicitly running in the
foreground for some reason", etc.

Bug: 70808931
Test: CtsAppTestCases
Change-Id: Icfc1905b8e3eb60ddf26118c61ec1ef095659436
2018-01-09 15:55:55 -08:00
Eugene Susla
e4d31b3c10 Move A11y events throttling away from View(RootImpl)
..and also extract common code into a common superclass

This also preserves the order of the throttled events
(TYPE_VIEW_SCROLLED & TYPE_WINDOW_CONTENT_CHANGED) with regards to the rest
of events by flushing any pending throttled events immediately if another
event is requested to be sent.

Test: ensure no new a11y CTS failures
Change-Id: I948a16716521974393aaa1cf822d0a0324e9ce3a
2018-01-09 13:28:59 -08:00
TreeHugger Robot
47966f8f49 Merge "Update on a few DevicePolicyManager APIs for affiliated PO" 2018-01-09 21:04:29 +00:00
Kodlee Yin
245a749dd6 Merge "Fix compatibility in MessagingStyle." 2018-01-09 18:22:07 +00:00
Alex Chau
7fbe61dc20 Update on a few DevicePolicyManager APIs for affiliated PO
- Disallow managed profile from disabling keyguard and statusBar as it
  has no effect
- Removed the ability for affiliated profile owner to set device owner
  lockscreen message, as the message is not per user but set globally,
  where the original intention is to set a per user lockscreen message
- Updated javadoc accordingly

Bug: 64383519
Test: Invoking setKeyguardDisabled and setStatusBarDisabled with managed profile fails
Change-Id: Ib3fdf44f55a7c5913ea38647c582bc962329c842
2018-01-09 11:13:22 +00:00
Amith Yamasani
53f06eae61 Track last job run time
JobScheduler can store the last job run time
for an app and use it later to help with
throttling.

Also, allow reporting a usage for a temporary
period. This will put the app in ACTIVE for a
minimum specified period during which timeouts
and predictions will not be able to reduce the
bucket level.

Bug: 71536897
Test: atest AppIdleHistoryTests
      atest AppStandbyControllerTests
Change-Id: I2985f7f3766671f15ea641972346c69875f17946
2018-01-08 17:22:15 -08:00
Andreas Gampe
1aa0d01cc8 Frameworks: Move SharedPreferencesImpl to tristate
The code loading shared preferences from disk may throw in other
ways then a missing file, for example during an out-of-memory
situation. Ensure that waiters will be woken up, and propagate
the exception to the getters.

Bug: 67986472
Test: m
Test: Device boots
Test: m cts && cts-tradefed run commandAndExit cts-dev --module CtsContentTestCases -c android.content.cts.SharedPreferencesTest
Change-Id: I56e47342111f1cb53c5817c0429af4a6787475a9
2018-01-05 18:02:30 -08:00
TreeHugger Robot
26db21ba9c Merge "Remove @SystemApi annotation from private or package-private members" 2018-01-06 00:54:32 +00:00
Kodlee Yin
14656423a6 Fix compatibility in MessagingStyle.
The changes introduced to add MessagingStyle#isGroupConversation had
an implementation bug wherein an application that targets SDK < P
can set a non-null MessagingStyle#setConversationTitle which, in that
SDK version, would also denote it being a group conversation. A
listener targetting SDK >= P would be able able to capture this
notification, but incorrectly be given false when calling
MessagingStyle#isGroupConversation. This CL adds back legacy
functionality to #isGroupConversation by checking the
application's SDK version when they call #setConversationTitle
and interally set #isGroupConversation to true.

Test: runtest -x
core/tests/coretests/src/android/app/NotificationTest.java
Bug: 67717177

Change-Id: I2233e3d0b6d4fcf9823e50cd7aa31b76bbaddaed
2018-01-05 10:37:29 -08:00
TreeHugger Robot
a068cd68c0 Merge "Binding on-demand #8: Miscellaneous usages" 2018-01-05 18:21:53 +00:00
Bernardo Rufino
fa51853ae5 Binding on-demand #8: Miscellaneous usages
Migrate usages of the transport binder to binding on-demand:
* getDestinationString()
* isAppEligibleForBackup()
* dump()

For getDestinationString() we'll be introducing an invisible bug for
people that haven't updated GMSCore to include the usage of
updateTransportAttributes() API introduced in earlier CL. The bug is
that that text won't change, it'll remain constant. It's invisible
because currently only place that uses that method is Settings in some
circumstances that depend on the transport, and those circunstances
don't happen with our transports. Check http://ag/1831025.

For isAppEligibleForBackup(), a new filterAppsEligibleForBackup() is
created and there we bind on-demand.

Change-Id: Idc9e31f0e8eda8531e204c05a84fafdaf0247d08
Ref: http://go/br-binding-on-demand
Bug: 17140907
Test: adb shell dumpsys backup, observe destination of transports
Test: adb shell bmgr backupnow --all, observe only eligible apps got backed-up
Test: Force-loaded settings screen and observed destination string
Test: m -j RunFrameworksServicesRoboTests
2018-01-05 16:33:33 +00:00
Peter Visontay
b97fbc8c5f Mark AppOpsManager.setMode() @TestApi.
There's a CTS test that accesses this via reflection, which we want to fix: AppOpsTest.testSetMode().

Test: make CtsPermissionTestCases -j32 && cts-tradefed run singleCommand cts-dev -m CtsPermissionTestCases --test android.permission.cts.AppOpsTest
Change-Id: I8e62d55271caaa730c4233f761145f90cc34111c
Bug: 71626306
2018-01-05 15:09:01 +00:00
Peter Visontay
5a2a1ef74a Define a @SystemApi string ID for each App Op.
Internal numeric op codes may change, but the public string IDs must consistently refer to the same operation.

Bug: 63907873
Test: Ran the tests being added in this this topic: make CtsPermissionTestCases -j32 && cts-tradefed run singleCommand cts-dev -m CtsPermissionTestCases --test android.permission.cts.AppOpsTest
Change-Id: I12bd9e2384d938120a403c4d76be4c1479ffd4ee
2018-01-05 13:09:01 +00:00