Commit Graph

12509 Commits

Author SHA1 Message Date
Michal Karpinski
0df62ac206 Deprecate BackupManager#requestRestore()
Turned the method into a no-op.
The rationale behind deprecating discussed in the bug.

Bug: 62650350
Test: make update-api && make -j40
Change-Id: I216a0700e351050836a8a39d7e36539bb84ad1dc
2018-01-24 13:30:18 +00:00
Adam Lesinski
68d10d00a5 Revert "Make idiomatic use of ApkAssets and AssetManager"
This reverts commit c857766ca5.
2018-01-23 03:17:01 -08:00
Adam Lesinski
1f62f7c72e Merge changes from topic "assetmanager-refactor"
* changes:
  libandroidfw: Improve performance of AssetManager2
  libandroidfw: Add ApplyStyle and SetConfiguration benchmark
  Make idiomatic use of ApkAssets and AssetManager
  Replace AssetManager with AssetManager2 implementation
2018-01-23 05:28:11 +00:00
TreeHugger Robot
060ac9bc9f Merge "Fixed Messaging style with empty senders" 2018-01-23 05:23:23 +00:00
Lorenzo Colitti
2899a0ed1b Merge "Support passing a template to NetworkStatsManager queries." 2018-01-23 04:02:58 +00:00
Selim Cinek
2dd3e72ac0 Fixed Messaging style with empty senders
Empty senders were treaded badly before, leading to empty
space and a bad layout. Now the conversation title is taken
as the name of the other sender.

Bug: 63708826
Test: add message with empty senders, observe layout
Change-Id: I6d3ce84c421ddbcd55260f34e8ff5bf46437c2b6
2018-01-22 18:57:14 -08:00
TreeHugger Robot
83178bc099 Merge "Allow Recents in current user to access APIs in its child profile" 2018-01-22 22:09:19 +00:00
TreeHugger Robot
c6f994207d Merge "Add pending system update info system APIs." 2018-01-22 20:12:43 +00:00
TreeHugger Robot
db0e05e576 Merge "Don't use user-tagged Uris in slice callbacks" 2018-01-22 20:00:30 +00:00
Vladislav Kuzkokov
ea4e107ada Merge "Unhide printing policy API." 2018-01-22 19:16:48 +00:00
Jason Monk
74848ae43f Don't use user-tagged Uris in slice callbacks
Test: uiservicestests
Bug: 68751119
Change-Id: I440400b20bb6d89d5e066efab420a6afee0ad123
2018-01-22 11:11:31 -05:00
Tony Mak
e839d709c2 Allow Recents in current user to access APIs in its child profile
At this point, we just need to whitelist Recents for these:
isDeviceLocked
loadTaskDescriptionIcon
getActivityInfo

However, I think in the long run, it may need more than that, so I
modified AMS.handleIncomingUser accordingly. PKMS does not use
handleIncomingUser and hence isRecentsAccessingChildProfiles is
introduced there.

Fix: 71722266

Test: Manual
1. Setup work profile
2. Launch some work and personal apps
3. Swipe up to see the new Recents
3. Can see recent apps are rendered correctly with icons badged
   accordingly.
4. Can switch to the task
5. Can remove task

Change-Id: I56b5f6091c232fc8327e01de472467d630570030
2018-01-22 15:47:41 +00:00
Wale Ogunwale
2632c97c9b Added @NonNull to Instrumentation.startActivitySync
Per API council recommendation.

Change-Id: Ib45381278a2bf7f3d1d2c68b84422a645bd706e3
Fixes: 71584604
Test: N/A
2018-01-22 06:54:48 -08:00
Lorenzo Colitti
e0f6909cba Support passing a template to NetworkStatsManager queries.
Currently, NetworkStatsManager queries and callbacks only allow
selecting network traffic based on network identifiers:
networkType, subscriptionId and networkId.  The code ends up
converting these into a template under the hood.

Now that templates can express more fine-grained queries (e.g.,
select only roaming traffic, or select only traffic that's not
on the default network) add a hidden method to pass in a
template. This should have no security implications, as all the
access controls are performed in NetworkStatsService.

Bug: 35142602
Test: android.app.usage.cts.NetworkUsageStatsTest passes
Change-Id: Iab4afa26b34544299d2a9c501c1b0feb470e90a9
2018-01-22 22:30:27 +09:00
TreeHugger Robot
3c365cb21d Merge "Policy transparency for mandatory backups." 2018-01-22 09:17:50 +00:00
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
Vladislav Kuzkokov
635ea80332 Unhide printing policy API.
Bug: 64140119
Test: cts-tradefed run cts-dev --module CtsDevicePolicyManagerTestCases --test com.android.cts.devicepolicy.MixedDeviceOwnerTest#testPrintingPolicy
Change-Id: Ic3fc78bda168217788111860ce40ad7ba2256d7d
2018-01-19 20:25:47 +01: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
Lenka Trochtova
16a91c0ca7 Policy transparency for mandatory backups.
Bug: 64012357
Test: atest FrameworksServicesTests:com.android.server.devicepolicy.DevicePolicyManagerTest#testCreateAdminSupportIntent

Change-Id: I54140d676285eb78345bda28427aa02339f65e5b
2018-01-19 20:01:24 +01: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
Tao Bao
07342dc175 Add pending system update info system APIs.
This CL adds system APIs in android.os.SystemUpdateManager. The APIs allow
system updater apps (RECOVERY permission required) to publish the pending
system update information, and allow other apps to query the info
accordingly (requiring RECOVERY or READ_SYSTEM_UPDATE_INFO permission).

Design doc in go/pi-ota-platform-api.

Bug: 67437079
Test: Use test apps to call the new APIs to query and set the update info
      respectively.
Change-Id: Id54b4a48d02922d2abd906dd7e2ec80a656fc9b1
2018-01-18 14:41:41 -08: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
Adam Lesinski
c857766ca5 Make idiomatic use of ApkAssets and AssetManager
Move away from using deprecated addAssetPath methods
and cache the instances of ApkAssets created.

Test: CTS passes
Change-Id: I9e7048bcffd6471ed6a42e5175cc678dc4ac3b96
2018-01-18 10:39:58 -08: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