Commit Graph

12490 Commits

Author SHA1 Message Date
TreeHugger Robot
2537932fb1 Merge "No camera for idle uids - framework" 2018-01-21 19:27:26 +00:00
Jason Monk
93eb9243e6 Merge "Revert "Revert "Slices permission model""" 2018-01-21 18:53:04 +00:00
Jason Monk
e8f8be7698 Revert "Revert "Slices permission model""
This reverts commit 1214c878a8.

Test: boot device
Bug: 72270082
Bug: 68751119
Change-Id: I7d0e709a04ffeb8b877aef539a978ee251a75742
2018-01-21 11:53:28 -05:00
Lorenzo Colitti
ca74e23b02 Merge changes from topic "multipath-datausage"
* changes:
  Add the defaultNetwork element to the netstats.proto.
  Add getDefaultNetwork to the NetworkStats public API.
2018-01-21 16:07:29 +00:00
Artem Iglikov
1214c878a8 Revert "Slices permission model"
This reverts commit f762496b7f.

Reason for revert: continuous crash, blocks LON from working on master

Test: flashed build from TreeHugger and verified that it boots and doesn't crash anymore
Bug: 72270082
Change-Id: I68d771357488c5c17ab00803d8f51a6c7ed37d01
2018-01-21 13:09:23 +00:00
Svet Ganov
82f09bcf93 No camera for idle uids - framework
If a UID is idle (being in the background for more than
cartain amount of time) it should not be able to use the
camera. If the UID becomes idle we generate an eror and
close the cameras for this UID. If an app in an idle UID
tries to use the camera we immediately generate an error.
Since apps already should handle these errors it is safe
to apply this policy to all apps to protect user privacy.

Test: Pass - cts-tradefed run cts -m CtsCameraTestCases
      Added - CameraTest#testCameraAccessForIdleUid

Change-Id: If6ad1662f2af6592b6aca1aeee4bd481389b5e00
2018-01-21 02:55:49 -08:00
Jason Monk
f762496b7f Slices permission model
- Launcher/assistant get access to all slices
 - Apps with uri access to access a specific slice
 - Apps without access get a permission granting slice
 - If the user authorizes access to the slice for the app
   then the app will be granted access to the app's slices
   (this happens through a temp grant in the service, and a
   full uri grant from the app the next time it binds)
 - Add a hint that apps to add to allow them to return different
   slices depending on the caller, this allows custom permission
   checks.

Test: runtest --path frameworks/base/services/tests/uiservices
Bug: 68751119
Change-Id: I8f8cd0182cfcbfba3f307e2eaba5aae6f6fbe214
2018-01-20 20:35:31 -05:00
Sudheer Shanka
c53c47fa3a Load admin data in DPMS asynchronously during boot.
Bug: 71902030
Bug: 71710099
Test: atest services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
Test: Ran boot tests - go/run-boottest
Test: manual
Change-Id: I34970c6f41877c7e3ece4843d47831374d455067
2018-01-19 11:12:44 -08:00
TreeHugger Robot
8bd6865532 Merge "Notify device owner when user is started / stopped / switched" 2018-01-19 17:56:28 +00:00
Lorenzo Colitti
35c13e5b3a Add getDefaultNetwork to the NetworkStats public API.
This allows an app using the public API to know whether the
traffic in a particular bucket was on the default network
(i.e., the network was selected by the system), or not (i.e.,
the network was selected by the app).

Bug: 35142602
Test: builds, boots
Test: added coverage to NetworkUsageStatsTest CTS test, still passes
Change-Id: I9f6669908fa119743b9c0aa0c31a03e5ebafa7db
2018-01-20 02:26:58 +09:00
Alex Chau
2c082aeeb7 Notify device owner when user is started / stopped / switched
- Similar to onUserAdded / onUserRemoved, notify DPC when user is started / stopped / switched, as these operation is asynchronous.
Use cases:
1. As a asynchronous callback for startUserInBackground / stopUser / logoutUser / switchUser
2. For COMP, can be used to detect work mode turning on or off

Bug: 72092112
Test: com.android.cts.devicepolicy.DeviceOwnerTest#testCreateAndManageUser_StopOnStart
Test: com.android.cts.devicepolicy.DeviceOwnerTest#testCreateAndManageUser_LogoutOnStart
Change-Id: I6fa28711419053694131d7792f3e0d1d2e76ac29
2018-01-19 15:17:00 +00:00
Vladislav Kuzkokov
34bc846497 Merge "Implement Policy to disable printing." 2018-01-19 13:36:09 +00:00
Jeff Sharkey
9252b34065 Use data plans for better job scheduling.
Now that we have data plan information from the carrier, we can start
using it to influence when we schedule jobs.  As a first pass
algorithm:

-- If the network is congested, and a job is less than 50% through
its runnable window, then we'll defer it for awhile.
-- If the network has a surplus of data, we'll consider using some
of it to improve the user experience by running prefetching jobs.

Provider APIs for carrier apps to override their connections to be
temporarily marked as either "unmetered" or "congested", along with
automatic timeouts if desired.

Flag for developers to indicate which jobs will have a material
positive impact on end users.  (We don't want to promote jobs that
are simply doing logs upload; for example.)  Glue code to quickly
return targetSdk of a specific package.

More tweaking to the exact algorithms will come in future CLs.

Test: bit FrameworksServicesTests:com.android.server.job.
Bug: 64133169
Change-Id: Iabb9f90a7a65958ad648b091edec378fc3bf785a
2018-01-19 15:50:12 +09:00
TreeHugger Robot
5ccc664159 Merge "Set ActivityView's rect as tap exclude region" 2018-01-19 00:23:33 +00:00
TreeHugger Robot
940ba0c8fe Merge "Rename CrossProfileApps API as per API council feedback" 2018-01-18 21:10:18 +00:00
Tony Mak
b0d22627e9 Rename CrossProfileApps API as per API council feedback
Three changes:
1. android.content.pm.crossprofile - > android.content.pm
2. getProfileSwitchingIcon -> getProfileSwitchingIconDrawable
3. startMainActivity “user” parameter should be named “targetUser”

Test: atest FrameworksServicesTests:com.android.server.pm.CrossProfileAppsServiceImplTest
Test: atest frameworks/base/core/tests/coretests/src/android/content/pm/CrossProfileAppsTest.java
Test: atest cts/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/CrossProfileAppsHostSideTest.java

FIXES: 71818128

Change-Id: Icf9a6d1f8b6808935ffd79b43185c7b12235f349
2018-01-18 21:07:50 +00:00
Petr Cermak
4fa2aa03ea Merge "Add "results source" parameter to RemoteInput" 2018-01-18 17:39:34 +00:00
TreeHugger Robot
4212de2e74 Merge "Add adb command to get max running users" 2018-01-18 16:50:31 +00:00
Vladislav Kuzkokov
792d58fbce Implement Policy to disable printing.
This adds a new "isPrintingEnabled" policy (true by default)
and hooks it into PrintManagerService.

Bug: 64140119
Test: manual

Change-Id: Ifb0f6772af51e6185135e9dcf5551e9ef0d88af3
2018-01-18 17:18:54 +01:00
Bryce Lee
e6c2b50229 Merge "Disallow starting activities without new task from non-activity context." 2018-01-18 15:49:15 +00:00
Alex Chau
c12189b24c Add adb command to get max running users
Bug: 72033601
Test: New command is working
Change-Id: I38746a2c03a6da35e7d8a149e1fb0b3604234dbc
2018-01-18 15:17:22 +00:00
TreeHugger Robot
e8ffec1661 Merge "Add hint to indicate 'see more' type content" 2018-01-18 14:17:14 +00:00
Andrii Kulian
4b6599e494 Set ActivityView's rect as tap exclude region
Track bounds of an ActivityView and set them as a tap exclude region,
so that taps on this area won't cause a focus switch between
hosting activity and activities inside of ActivityView.

Bug: 63902362
Test: Manual with ActivityView test app
Change-Id: I3cdafe32e0bdf414507fef0d622d9c140eee3188
2018-01-17 17:06:34 -08:00
Jorim Jaggi
1f2acb9a16 Merge "Add ability to register remote animation definitions per activity" 2018-01-18 00:17:26 +00:00
Dake Gu
d4356fdf4b Merge "autofill: support dpad/keyboard" 2018-01-18 00:14:36 +00:00
TreeHugger Robot
1721004ec9 Merge "Customize user switch dialog" 2018-01-17 23:55:47 +00:00
Dake Gu
67decfa7f8 autofill: support dpad/keyboard
To make autofill works on non-touch device such as TV, allow
fill ui window to gain window focus. Fill ui window does not
need IME. When IME and fill ui window are both shown, fill ui
window will intercept keyevent before IME.

Since autofill window will steal window focus from app window,
we no longer uses View.onWindowFocused() for enter/exit event.
Switched to use Activity onResume/onPause. When view
notifyViewEntered or notifyViewExited called when Activity is paused,
it will be ignored. Before Activity goes to pause state,
notifyViewExited() is fired on focus view, after Activity leaves
pause state, notifyViewEntered() is fired on focus view.

In CTS testDatasetAuthTwoFieldsUserCancelsFirstAttempt,  the
authentication activity finishes itself in onCreate() which will not
produce onPause/onResume in app activity, but it will produce window
focus loss/gain event. Since we switch from window focus to activity
onResume/onPause, we will be missing a show fill ui when return from
the never shown authentication activity. To solve this problem,
we added special code when receive ActivityResult from authentication
activity where we check if the authenticate activity never causes
onStop event, where we should issue an extra ACTION_VIEW_ENTERED
event to show fill ui.

Test: passed all existing autofilltest CTS on sailfish
      atest CtsAutoFillServiceTestCases
Bug: 70181616

Change-Id: Iafe4dca3be8f049fa6dfd34bac13ccb030c583b6
2018-01-17 14:42:16 -08:00
Bryce Lee
f9b7201a63 Merge "Add more logging to Activity Lifecycler." 2018-01-17 22:03:04 +00:00
Antoan Angelov
f68bf1a819 Merge "Add metadata to validate incoming administrator during transfer of ownership." 2018-01-17 21:32:15 +00:00
Jorim Jaggi
f84e2f60fe Add ability to register remote animation definitions per activity
This introduces a more stable way of setting a remote animation
than using overridePendingTransition: An activity can register
a set of remote animations which is broke down by transition type.
Whenever the activity is involved into such a transition, the
remote animation will be started.

Remote animations take precedence over regular animations, and
prefixOrderIndex in the hierarchy decides precedence within
multiple apps that set remote animation definitions such that
higher apps override lower apps.

Bug: 64674361
Test: go/wm-smoke
Test: Use with launcher
Change-Id: Id300ff62d9f60966ea2609168f6a02860b3de7af
2018-01-17 22:00:37 +01:00
Craig Donner
022320cb57 Merge "Deprecate android.software.vr.mode" 2018-01-17 20:20:51 +00:00
TreeHugger Robot
3fb6ea960f Merge "Add BackupManager#isBackupServiceActive() system API" 2018-01-17 19:07:21 +00:00
TreeHugger Robot
13e7ad1e1c Merge changes from topics "SliceDesc", "SliceCleanup"
* changes:
  Add SliceManager#getSliceDescendants
  Update slice APIs
2018-01-17 18:58:27 +00:00
Alex Chau
93ae42b04d Customize user switch dialog
- Introduced DevicePolicyManager to set messaging for switching out of and into user 0
- Introduced coressponeding API to get the message

Bug: 71787514
Test: Set start and end session message with TestDPC, change is reflected
Test: Restart the device, switch message is still enforced
Test: Clear the message with TestDPC, reverted back to default
Change-Id: I527eca6f151cee35459abad7ae9dcdeef486148f
2018-01-17 18:51:19 +00:00
TreeHugger Robot
4ba2c3f4ec Merge "Ensure a user's SP does't change." 2018-01-17 18:08:45 +00:00
Bryce Lee
f465ea0d6a Disallow starting activities without new task from non-activity context.
A change to the conditions to allow such behavior when a task id was
specified now allows for all non-activity contexts to start activities
as long as no options bundle is specified.

This changelist corrects the condition.

Change-Id: Ifaff4fc6d875ba74ec532b3e3ce91c6aa3ca3362
Fixes: 32625589
Test: atest CtsActivityManagerDeviceTestCases:StartActivityTests
2018-01-17 10:06:06 -08:00
Petr Cermak
6cb667cb12 Add "results source" parameter to RemoteInput
This CL adds the following methods to RemoteInput:

  * setResultsSource(Intent intent, int source)
  * getResultsSource(Intent intent)

where source can be one of:

  * RemoteInput.SOURCE_FREE_FORM_INPUT
  * RemoteInput.SOURCE_CHOICE

Rationale: This will allow apps to distinguish direct and smart replies
for logging purposes.

Bug: 67765414
Test: atest RemoteInputTest (http://ag/3469835)
Change-Id: Ie30416640df4b2cd0424f9c75b235fc124be87a3
2018-01-17 16:48:28 +00:00
Bryce Lee
d946f86f12 Add more logging to Activity Lifecycler.
This changelist introduces temporary logging targeting an issue
where lifecycle transactions are executing for non-existent client
records. Additional details are retained and exposed in this case
to help better understand what is happening.

Bug: 71506345
Test: manual
Change-Id: Ibfdbbd5ef0c465294709383405403aa0d3508ecb
2018-01-17 08:41:54 -08:00
Jorim Jaggi
7e269fca40 Merge changes from topic "remote_animations"
* changes:
  Remote animations (app-controlled animations)
  Defer hiding clients until animation is done
2018-01-17 15:59:52 +00:00
Michal Karpinski
96e0be0fd8 Add BackupManager#isBackupServiceActive() system API
So that GMSCore can find out and disable restore flow
and Backup UI.

Bug: 33339643
Test: gts-tradefed run gts -m GtsGmscoreHostTestCases -t com.google.android.gts.devicepolicy.DeviceOwnerTest#testBackupServiceActive (new GTS test in companion CL)
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.DeviceOwnerTest#testBackupServiceEnabling
Change-Id: I62c38dec2395d3aa926566d128b0067ce7d62c26
2018-01-17 15:00:45 +00:00
Alex Chau
4f46813ebc Merge "API Review: Put executor argument before the listener argument for clearApplicationUserData" 2018-01-17 14:46:03 +00:00
arangelov
5149d716e5 Add metadata to validate incoming administrator during transfer of ownership.
Bug: 69543092
Test: cts-tradefed run cts-dev --module DevicePolicyManager --test com.android.cts.devicepolicy.MixedDeviceOwnerHostSideTransferTest#testTransfer
Test: cts-tradefed run cts-dev --module DevicePolicyManager --test com.android.cts.devicepolicy.MixedDeviceOwnerHostSideTransferTest#testTransferNoMetadata
Change-Id: Iccefb37836d0f88e9d4f692ecf9aba6d3197ad08
2018-01-17 14:31:19 +00:00
Jorim Jaggi
33a701a55c Remote animations (app-controlled animations)
Adds the ability for another app to control an entire app
transition. It does so by creating an ActivityOptions object that
contains a RemoteAnimationAdapter object that describes how the
animation should be run: Along of some meta-data, this object
contains a callback that gets invoked from WM when the transition
is ready to be started.

Window manager supplies a list of RemoteAnimationApps into the
callback. Each app contains information about the app as well as
the animation leash. The controlling app can modify the leash like
any other surface, including the possibility to synchronize
updating the leash's surface properties with a frame to be drawn
using the Transaction.deferUntil API.

When the animation is done, the app can invoke the finished
callback to get WM out of the animating state, which will also
clean up any closing apps.

We use a timeout of 2000ms such that a buggy controlling app can
not break window manager forever (duration subject to change).

Test: go/wm-smoke
Test: RemoteAnimationControllerTest

Bug: 64674361
Change-Id: I34e0c9a91b28badebac74896f95c6390f1b947ab
2018-01-17 15:12:19 +01:00
Craig Donner
c6f9c85f74 Deprecate android.software.vr.mode
Bug: 71365436
Test: Build
Change-Id: I4e371dfea1823787e2e175206b34c25d872bd411
2018-01-16 16:00:42 -08:00
Makoto Onuki
13ccf0b951 Merge "Log sync stop (== onStopJob) reason in the sync log." 2018-01-16 23:04:15 +00:00
Jason Monk
5f8cc27e14 Add SliceManager#getSliceDescendants
Allows SliceProviders to give consumers a list of slices they might
be interested in.

Test: cts
Bug: 68378569
Change-Id: I2d7d50388055937cabe3378502db56201f051897
2018-01-16 17:57:20 -05:00
Jason Monk
b9e06a8458 Update slice APIs
- Remove deprecated onBindSlice
 - Move bindSlice to SliceManager since it exists.

Test: update-api
Bug: 68378571
Change-Id: I1bfde10b5da5f80d395c69a6408fa5b13cd113f0
2018-01-16 17:12:06 -05:00
Lenka Trochtova
c141d08b70 New management API for making backups mandatory.
Let the device owner make backups with a chosen backup
transport mandatory.

BUG: 64012357
Test: make RunFrameworksServicesRoboTests
Test: manually together with the corresponding GmsCore change.
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases --test
com.android.cts.devicepolicy.DeviceOwnerTest#testGetAndSetMandatoryBackupTransport
Test: cts-tradefed run cts -m CtsBackupHostTestCase --test
android.cts.backup.BackupDeviceOwnerHostSideTest#testMandatoryBackupTransport

Change-Id: I9bfae5799beae3459659e697813b75a9b508ae55
2018-01-16 22:24:11 +01:00
Makoto Onuki
d2bfec6359 Log sync stop (== onStopJob) reason in the sync log.
Bug: 71866667
Test: Manual test

Change-Id: I89e492362759fe6318102b61a28818b642f5bc2f
2018-01-16 20:47:24 +00:00
Andreas Gampe
e8e016838a Merge "ActivityThread: Attempt to attach agent with app's classloader" am: f779d7e3be am: 9f1f950c31
am: 9853a65386

Change-Id: I064033ab86013dd80efa3cb4eb22b89ac143e7b6
2018-01-16 20:08:30 +00:00