Commit Graph

12524 Commits

Author SHA1 Message Date
Sudheer Shanka
811c3765be Merge "Add DPM API to block apps from using metered data." 2018-01-23 23:02:40 +00:00
Jason Monk
d71d0fc508 Merge "Remove old slice APIs for color" 2018-01-23 23:01:54 +00:00
Roberto Perez
c4788e1f04 Merge "Adding a new category to mark car-optimized launcher activity" 2018-01-23 18:21:59 +00:00
Neil Fuller
ee33ac4bd2 Merge "Improve dumpsys for installed distros" 2018-01-23 17:54:29 +00:00
Jorim Jaggi
15e76d620a Merge changes I2b6bfca0,I9a854d43
* changes:
  Add option to retrieve pending intent result
  Fix issue with permission check for shortcuts and pendingIntent
2018-01-23 17:14:03 +00:00
TreeHugger Robot
4953824b89 Merge "Fix registerSliceCallback to match api guidelines" 2018-01-23 16:38:16 +00:00
Jason Monk
e0bba99c94 Merge "Remove slice: from SliceProvider docs" 2018-01-23 14:24:35 +00:00
TreeHugger Robot
2c78c181e7 Merge "Track the most recent notifying packages" 2018-01-23 13:56:24 +00:00
Jorim Jaggi
e2ad37f9bc Add option to retrieve pending intent result
Used by SystemUI to check whether an activity start will
actually lead to something animating.

Also fixes an issue where we return MOVED_TO_FRONT instead of
DELIVERED_TO_TOP.

Test: go/wm-smoke
Test: Use PendingIntent.sendAndReturnResult
Change-Id: I2b6bfca0a53125635bc462f32ab7eaae366c0c8a
2018-01-23 14:40:28 +01: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
Sudheer Shanka
04d61ae6c3 Add DPM API to block apps from using metered data.
Bug: 63700027
Test: cts-tradefed run singleCommand cts-dev -m CtsDevicePolicyManagerTestCases -t \
      com.android.cts.devicepolicy.MixedDeviceOwnerTest#testSetMeteredDataDisabled
Test: cts-tradefed run singleCommand cts-dev -m CtsDevicePolicyManagerTestCases -t \
      com.android.cts.devicepolicy.MixedProfileOwnerTest#testSetMeteredDataDisabled
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest#testSetGetMeteredDataDisabled
Change-Id: I147399d316f375c68b415dc6ede837c53cd1aad0
2018-01-22 19:33:09 -08: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
Jason Monk
a9b3d73dd2 Remove slice: from SliceProvider docs
We don't use slice:// uris, all slice uris are standard content uris.

Test: none
Change-Id: Ie31c5eb85482a72bbc7d2b549b232731015e3537
2018-01-22 15:37:00 -05: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
Julia Reynolds
7bcb57b79d Track the most recent notifying packages
Test: runtest systemui-notification
Bug: 63927402
Change-Id: I0d4cfb5399c81a31d1192d7ac5149f33d9804c67
2018-01-22 13:49:11 -05: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
Neil Fuller
ad3e1331f3 Improve dumpsys for installed distros
The RuleManagerService would previously refuse to return
the current distro install status if there was a staging
operation in progress. Since a staging operation only affects
what is staged, not what is actually installed, this
restriction can be relaxed. This should make tests that
were previously getting "Unknown" state more reliable.

Test: PTS: run pts -m PtsTimeZoneTestCases
Test: atest FrameworksServicesTests
Change-Id: I06449bc8dad6d96adf7e9edceee69cfaf24facb0
2018-01-22 15:53:50 +00:00
Jason Monk
4ef50bc2d4 Fix registerSliceCallback to match api guidelines
Deprecate the old ones, they will be removed once supportlib updates.

Test: update-api
Bug: 68378571
Change-Id: I2f91fb05bc0de074c5aee7ca59025bd4d35bf95a
2018-01-22 10:52:23 -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
Jason Monk
888a664ad6 Remove old slice APIs for color
Everyone is using ints now.

Test: update-api
Bug: 68378574
Change-Id: I9b379386fec4979dfe15ea520fc3f8541c2e2a04
2018-01-21 15:31:16 -05: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
Roberto Perez
7ee1a7acc4 Adding a new category to mark car-optimized launcher activity
Test: TBD
Bug: 70681347

Change-Id: I81ea7f9f3021e8a9d25fa980a8687d66765469c5
2018-01-18 14:43:27 -08: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