Commit Graph

16933 Commits

Author SHA1 Message Date
TreeHugger Robot
a98a0c6f46 Merge "Make the method for finding out if a device is org-owned public." 2020-01-16 01:58:08 +00:00
Danning Chen
8f0903ae74 Merge "Add a new method queryEventsForUser() to UsageStatsManagerInternal for People Service to call" 2020-01-15 22:55:15 +00:00
TreeHugger Robot
458fbcba7f Merge "Add conversation-centric inline controls" 2020-01-15 19:09:53 +00:00
TreeHugger Robot
bcc07fc3b9 Merge "Minor fixes for devices without WallpaperService." 2020-01-15 19:04:57 +00:00
Evan Severson
4e49a5d0b3 Merge "Add new api to get the button label for background permission" 2020-01-15 17:59:34 +00:00
Julia Reynolds
12ba4cf7a8 Add conversation-centric inline controls
Round one - needs polish, and actions may be added or removed
in the future, and demote isn't working yet.

Bug: 137397357
Test: atest
Change-Id: Ia52598bec58fc54b8bde29168cd419a24d1e4dab
2020-01-15 10:20:29 -05:00
Eran Messeri
41c2aed9c1 Make the method for finding out if a device is org-owned public.
Make isOrganizationOwnedDeviceWithManagedProfile a public method, as
there is no reason to keep this information hidden from apps.

Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest#testIsDeviceOrganizationOwnedWithManagedProfile
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.MixedProfileOwnerTest#testIsDeviceOrganizationOwnedWithManagedProfile
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.MixedDeviceOwnerTest#testIsDeviceOrganizationOwnedWithManagedProfile
Bug: 143518237
Bug: 144978467
Bug: 147340575
Bug: 146123237
Change-Id: Iab45f20c9150a6b8bd48eea610484f36f199d3d7
2020-01-15 14:26:48 +00:00
Al Sutton
f7f94e34bf Merge "Add "No New Data" flag for Key/Value Backups" 2020-01-15 11:35:07 +00:00
Jacky Kao
873cbc0e14 Merge "Implementing new API : takeScreenshot()" 2020-01-15 08:29:49 +00:00
Jacky Kao
09789e4168 Implementing new API : takeScreenshot()
Implementing the new API for A11y services to take the screenshot
of the specified display.
Bitmap takeScreenshot(int displayId)
1. The main codes is moved from the UiAutomationConnection class and
let the UiAutomation change to use this API.
2. Add a capability at metadata to check whether the A11y services could use this
API or not.
3. This API is a async one for A11y services, but is a sync one for
UiAutomation.

Bug: 10931661
Test: a11y CTS & unit tests
Change-Id: I478bd93c60d4742bef20ae0e423ca9de1bda55d2
2020-01-15 16:23:52 +08:00
Automerger Merge Worker
0dcf43d1fe Merge "DevicePolicyManager: annotate SystemApi" am: d63ebcf807 am: 5016cf0263 am: 14dee43669
Change-Id: I88cb20e9c283993cda6be98d73f0fbfdc3f4ce54
2020-01-15 07:28:57 +00:00
Automerger Merge Worker
14dee43669 Merge "DevicePolicyManager: annotate SystemApi" am: d63ebcf807 am: 5016cf0263
Change-Id: I27c2aa961fce4d7ee19ded54e4e3cc3172bec850
2020-01-15 07:14:27 +00:00
Treehugger Robot
d63ebcf807 Merge "DevicePolicyManager: annotate SystemApi" 2020-01-15 06:37:55 +00:00
TreeHugger Robot
cac0014a95 Merge "Add IActivityManager.stopUserWithDelayedLocking" 2020-01-15 05:40:06 +00:00
Wu Ahan
d5b8f0590d Merge "Make some apis @TestApi and @hide for usage in tests" 2020-01-15 03:33:41 +00:00
Felipe Leme
8ac0d0d54a Minor fixes for devices without WallpaperService.
- Fixed constructors so DisabledWallpaperManager doesn't throw exception
- Fixed SystemServiceRegistry.get(WallpaperManager.class) for instant apps

Bug: 138939803
Test: atest --instant CtsPermissionTestCases:android.permission.cts.ServicesInstantAppsCannotAccessTests#cannotGetWallpaperManager

Change-Id: I7cd6c65e9a693f3f1c4d5232420cc3f881d398c1
2020-01-15 03:32:46 +00:00
TreeHugger Robot
71e50f5199 Merge "Check mIncludeCode before building appComponentFactory" 2020-01-15 00:56:49 +00:00
Danning Chen
6a5982f300 Add a new method queryEventsForUser() to UsageStatsManagerInternal for People Service to call
Change-Id: I4baf755a3dc1af421ea755ed2f4cfe3440741290
Test: Build and run on a test device
Bug: 146522621
2020-01-14 16:21:57 -08:00
Evan Severson
cfae44aeec Add new api to get the button label for background permission
This allows apps to get the string used so they can properly instruct
the user on how to grant a background permission.

Test: Manual, multiple languages
Bug: 147440267
Change-Id: Ibdc6563e85cae930c25a9338513f747440fee8b4
2020-01-14 14:39:12 -08:00
Keun young Park
4cb993318b Add IActivityManager.stopUserWithDelayedLocking
- Only allow delayed locking for the explicit call, stopUserWithDelayedLocking()
  or for implicit user stopping caused by user switching.
- All other explicit user stopping should immediately lock the user. This allows
  immediate locking from component like DevicePolicy.
- Product still should enable delayed locking explicitly and if it is disabled,
  IActivityManager.stopUserWithDelayedLocking will behave the same with
  IActivityManager.stopUser.
- Once user is stopped in delayed locking mode, one of following steps can completely
  lock the user (this is not a complete list):
  1. User is asked to be stopped with IActivityManager.stopUser call.
  2. User is restarted through IActivityManager.restartUserInBackground call.
  3. UserManager.evictCredentialEncryptyionKey (involves restartUserInBackground call)
  4. When user is removed (involves IActivityManager.stopUser call).

Bug: 131757355
Test: run unit tests
      check user locking in car device where delayed locking is enabled.

Change-Id: I663ffde3a5b74738a6f59b4282ff562146f22662
2020-01-14 13:56:28 -08:00
Shuo Qian
8b4325f86c Merge "Introduce system API for ActivityManager.updateMccMncConfiguration for Mainline" 2020-01-14 21:29:08 +00:00
TreeHugger Robot
1a61c8aa9d Merge "Clarify forced reason usage." 2020-01-14 20:51:10 +00:00
Automerger Merge Worker
0b23099611 DO NOT MERGE Don't throw exception in AppOpsManager.checkOp am: 892ded1e8a
Change-Id: I929325ddb54bd6a7ffd256b1b3327c98dc85bc18
2020-01-14 19:56:11 +00:00
Philip P. Moltmann
73e2690ede DO NOT MERGE Remove unnecessary internal APIs.
Test: Built
Bug: 146463528
Bug: 146590200
Bug: 147649036
Change-Id: I5391ac4989d7d5712982f5608f9fc28cf7935b00
2020-01-14 19:42:44 +00:00
Neil Fuller
872d3504ec Merge "Expose time / time zone system apis for telephony" 2020-01-14 15:56:15 +00:00
Al Sutton
4bc966c007 Add "No New Data" flag for Key/Value Backups
Currently we have no method of telling transports that we have
attempted to make a Key/Value backup, but there was no data to
back up. This means that for apps with K/V backups their last
backup timestamp becomes older and older causing confusion for
users about whether the app data hasn't changed or whether the
app is failing to back up.

By introducing this flag we create a signal for the framework
to tell transports that, if there was any changed data, the
data would have been backed up, but the apps has not indicated
any changes have been made. This allows us to provide a UX
based on last non-erroring attempt rather than last data
change.

Bug: 147481066
Test: No code introduced in the CL.
Change-Id: Id832c7173da6341c6dc7b77fb72c289f2e1da624
2020-01-14 10:06:01 +00:00
Eran Messeri
3662019068 Merge "Disable provisioning in COMP mode" 2020-01-14 07:22:57 +00:00
Automerger Merge Worker
995211c840 Merge "Add NETWORK_STACK_SERVICE to SystemServiceRegistry" am: 55962277bf am: c5dfc3ca1b
Change-Id: I230c75de4f9f9f79b3583aace860957c83b0586d
2020-01-14 04:36:00 +00:00
Mark Chien
78231e9282 Merge "Add NETWORK_STACK_SERVICE to SystemServiceRegistry" 2020-01-14 03:06:45 +00:00
Remi NGUYEN VAN
fe1ce1e047 Add NETWORK_STACK_SERVICE to SystemServiceRegistry
The service is already registered in ServiceManager. It needs to be
accessible from SystemServiceRegistry so that other mainline modules
can communicate with it.

Bug: 147255753
Test: Dependent CLs using the service
Change-Id: I940c62064466c3b3b8d2a195b810e90eaade7e6c
Merged-In: I940c62064466c3b3b8d2a195b810e90eaade7e6c
2020-01-14 02:17:54 +00:00
Kweku Adams
c182d5e864 Clarify forced reason usage.
Forced was meant to mean "forced by the user." Renaming the constant and
clarifying the comment so it doesn't get used incorrectly. Also
introducing a "forced by the system" constant and fixing the code so the
correct reason is used.

Bug: 145551233
Test: atest AppIdleHistoryTests
Test: atest AppStandbyControllerTests
Test: atest UsageStatsTest
Change-Id: I0d258d83141670728b758a3ef0056b19fde4a88b
2020-01-13 16:13:25 -08:00
TreeHugger Robot
83a1f6a98c Merge "Add new Factory reset protection policy APIs" 2020-01-13 19:21:11 +00:00
Sarah Chin
6be7ecd54d Merge "Make MmsManager public and @SystemService" 2020-01-13 18:53:31 +00:00
Ryan Mitchell
0252b862de Merge changes from topic "shared-lib-tele-res"
* changes:
  Allow for overlaying dynamic shared libraries
  Assign shared libraries stable package ids
2020-01-13 15:15:57 +00:00
Eran Messeri
6ad0e194d7 Disable provisioning in COMP mode
Restrict adding a managed profile when the device has a device owner.

This mode is no longer supported, in favour of Corporate Owned,
Personally Enabled mode (Organization-Owned device with Managed Profile).

The restriction on adding managed profiles is now added by default when
a device owner is set, and is removed when the device owner is removed,
to avoid other system copoments from creating a managed profile when
there's a device owner.

Additionally, the method for checking whether pre-provisioning
conditions are met has been modified to return an error if the
restriction is set.

Bug: 145271440
Test: atest FrameworksServicesTests:DevicePolicyManagerTest

Change-Id: Ife25f4e2faffe84d85ab7786407c14997b4cf069
2020-01-13 14:56:33 +00:00
Automerger Merge Worker
9930eea1bd [SP03] support registerNetworkStatsProvider API am: 80831d2ff3 am: 358de94645 am: aa1242109c
Change-Id: Iaedbf1f8bbe8128ca2631efff24048b97ce9d909
2020-01-13 14:48:01 +00:00
Automerger Merge Worker
aa1242109c [SP03] support registerNetworkStatsProvider API am: 80831d2ff3 am: 358de94645
Change-Id: I16130e06129e985fab33b5caf904477bf241e1b2
2020-01-13 14:28:05 +00:00
Automerger Merge Worker
f68f1f383d [SP03.1] Replace com.android.internal.util.Preconditions.checkNotNull am: 232b2edcfb am: adf6c4eaff
Change-Id: I872285f988905d6707109ab3c7e6a419df47d39b
2020-01-13 14:28:02 +00:00
Neil Fuller
2be7ac4531 Expose time / time zone system apis for telephony
Expose system apis / permissions needed by the telephony module to
communicate with the system server for time and time zone detection.

There are also small improvements for @Nullable.

Bug: 147012511
Test: build only
Change-Id: I27e5aa4c594d5fbad0b6f043afb9e910dcba4349
2020-01-13 13:56:54 +00:00
Alex Johnston
011f5c6ea5 Add new Factory reset protection policy APIs
Historically, FRP behaviour was built on top of the application restrictions
infrastructure. This CL introduces new behaviour, as the profile owner of an
organization-owned device needs to be able to control FRP behaviour and
cannot set application restrictions on user 0.

- Introduced a new FactoryResetProtectionPolicy object
  - Added it as a field to ActiveAdmin
  - Created a default value
- Added setFactoryResetProtectionPolicy to DPM which is used to set a
  factory reset protection policy. If the policy is null, the current
  policy is cleared and set back to the default value.
- Added getFactoryResetProtectionPolicy to DPM to retrieve the current
  factory reset protection policy. If this is the default value, then
  no policy is set.
- Both these APIs are callable by the device owner or profile owner of
  an organization-owned device.

Bug: 143517230
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
      atest com.android.server.devicepolicy.FactoryResetProtectionPolicyTest
      atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testFactoryResetProtectionPolicy
      atest com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest#testFactoryResetProtectionPolicy

Change-Id: I72c4d06ec8a27741a1956d082969573077937726
2020-01-13 10:55:28 +00:00
Remi NGUYEN VAN
05f7b5c621 Add NETWORK_STACK_SERVICE to SystemServiceRegistry
The service is already registered in ServiceManager. It needs to be
accessible from SystemServiceRegistry so that other mainline modules
can communicate with it.

Bug: 147255753
Test: Dependent CLs using the service
Change-Id: I940c62064466c3b3b8d2a195b810e90eaade7e6c
2020-01-13 14:44:56 +08:00
junyulai
80831d2ff3 [SP03] support registerNetworkStatsProvider API
This change provides an API that allow external modules to
register a custom provider of NetworkStats to merge the
network statistics that cannot be seen by the kernel to system.

Test: atest FrameworksNetTests CtsUsageStatsTestCases
Test: atest NetworkPolicyManagerServiceTest
Test: m doc-comment-check-docs
Bug: 130855321

Change-Id: I265bc637c40666cde505fde5056d2d9bfc5fb204
2020-01-13 14:43:03 +08:00
junyulai
232b2edcfb [SP03.1] Replace com.android.internal.util.Preconditions.checkNotNull
Extracted from ag/9990011 to make NetworkStatsManager sync with internal
line, given that it is missing in aosp/1198084.

Bug: 126528330

Test: Treehugger
Change-Id: I77f50326869799f51d4636cb7c6d7c97daf531e6
Merged-In: I42117ebfb640e3b0b133183e5e146860bed8471a
2020-01-13 14:42:37 +08:00
Yanli Wan
0c581ec46d Merge "Add support to start financed device provisioning" 2020-01-11 05:24:17 +00:00
Sarah Chin
4affb51cc9 Make MmsManager public and @SystemService
Test: manually verify can send/receive MMS
Bug: 144004293
Change-Id: I39cde852252e18f71f98e328354df66611c9db60
2020-01-10 20:02:08 -08:00
Benedict Wong
d6d1c3aa3e Merge "Add new appop for Platform VPNs" 2020-01-11 02:31:14 +00:00
Yanli Wan
01c9255ec4 Add support to start financed device provisioning
* Add intent action used to trigger financed device provisioning
* Add financed device provisioning precondition check

Bug: 135486391
Test: atest DevicePolicyManagerTest
Change-Id: Id0f65816026cd195481022b6b75c3232996ec6e7
2020-01-10 16:14:57 -08:00
Winson
13fb2cac71 Check mIncludeCode before building appComponentFactory
It should be impossible to resolve a custom appComponentFactory
if the LoadedApk doesn't contain any code paths, so just skip
it to avoid logging an incorrect error.

Bug: 146219140

Test: manual force updateApplicationInfo call, verify bunch of
        errors before fix, no logs after fix; rest of device works

Change-Id: Icbb8533c95c9437ec0a946886e00b9c341e21796
2020-01-10 15:23:27 -08:00
Ryan Mitchell
ee4a564d4f Allow for overlaying dynamic shared libraries
Overlays targeting shared libraries should be loaded into the
resources of every target that depends on the shared library.

Static shared libraries are currently not supported because overlays
should override all versions of static shared libraries and there is
not currently support for an overlay targeting multiple APKs.

Also created a test instrumentation and host test suite for testing
overlays and packages on the system image.

Bug: 140790224
Test: atest OverlayRemountedTest
Change-Id: I20a217b6368d6cf92b2b9f46908fd58012933f72
2020-01-10 23:20:19 +00:00
Collin Fijalkovich
88e9459989 Merge "Added verification mode to PropertyInvalidatedCache" 2020-01-10 23:01:56 +00:00