Commit Graph

16646 Commits

Author SHA1 Message Date
Shashwat Razdan
d775eabbce Merge "Added ACTION_UNPIN = 4 in ActionType" 2019-12-04 20:19:31 +00:00
Eran Messeri
ac767ac5d9 Merge "Device Identifiers access: only on organization-owned devices" 2019-12-04 17:42:56 +00:00
Alex Johnston
e9a5ccd42f Merge "Replace setAutoTimeRequired and getAutoTimeRequired with setAutoTime and getAutoTime" 2019-12-04 16:59:19 +00:00
Eran Messeri
4a96031617 Device Identifiers access: only on organization-owned devices
Deprecate access to device identifiers on non organization-owned
devices.

This is in line with changes to device identifiers access made in
Android Q. Profile owner access to device identifiers on personal
devices was deprecated in Q and is now removed.

However, on an organization-owned device, for asset management
purposes, the profile owner maintains access to device identifiers as
well as the ability to perform device ID attestation.

This is done by adjusting the checkDeviceIdentifierAccess method in the
DevicePolicyManagerService to take into account whether the profile
owner is on organization-owned device.

Bug: 145336515
Test: atest com.android.cts.devicepolicy.DeviceOwnerTest#testDeviceOwnerCanGetDeviceIdentifiers
Test: atest com.android.cts.devicepolicy.ManagedProfileTest#testProfileOwnerCanGetDeviceIdentifiers
Change-Id: I13486509b5af7acb4713adf8cb17fa301e647268
2019-12-04 16:10:28 +00:00
Automerger Merge Worker
026bd122de Merge "Add a manual path for setting time zone" am: 7fcab2dba8 am: 57aaf1d427
Change-Id: I8a7113adfe3d420be6e3a99fb504859fc2f387ed
2019-12-04 15:54:54 +00:00
Neil Fuller
57aaf1d427 Merge "Add a manual path for setting time zone" am: 7fcab2dba8
am: 076cd7aa3a

Change-Id: I03abce9eca7c3fa031a4a0b103cb0063ea4bb85b
2019-12-04 07:42:57 -08:00
Alex Johnston
8c50338cfd Replace setAutoTimeRequired and getAutoTimeRequired with setAutoTime and getAutoTime
* Deprecate setAutoTimeRequired and getAutoTimeRequired.
* Added new API methods setAutoTime and getAutoTime.
* DPCs are recommended to combine these new APIs together with the DISALLOW_CONFIG_DATE_TIME
  restriction to prevent the user from changing auto time settings.
* The new methods can also be called by the WP PO (COPE mode).

Bug: 138709470
Test: Manual testing with testdpc and the set auto time toggle
      atest com.android.server.devicepolicy.DevicePolicyManagerTest
      atest com.android.cts.devicepolicy.MixedProfileOwnerTest#testSetAutoTime

Change-Id: I6f93b2a28e3ef0e1e97c9c414ce65d4e753c1bf3
2019-12-04 14:02:58 +00:00
TreeHugger Robot
315e256a9b Merge "Add comments to bucketing reasons." 2019-12-03 23:14:43 +00:00
Kweku Adams
d18f07301b Add comments to bucketing reasons.
Some of the names weren't fully self-explanatory so adding comments
helps future readers understand what each reason actually represents.

Bug: 145551233
Test: N/A
Change-Id: Ie517590968733e26e5e1b806f44379442a187e9c
2019-12-03 13:39:40 -08:00
Mady Mellor
c66597d520 Merge "Allow Shortcuts to be started on ActivityView" 2019-12-03 21:39:15 +00:00
Neil Fuller
076cd7aa3a Merge "Add a manual path for setting time zone"
am: 7fcab2dba8

Change-Id: I4a77a647a01fb5b274a5bf819b1e22d4ec7d8219
2019-12-03 12:28:24 -08:00
Neil Fuller
f807b4c364 Merge "Add a new time zone detection service" am: 7d8a624085
am: 256f4df4b6

Change-Id: Ie1b28c5cea14a23beac2e70eb7878f7f09461d6c
2019-12-03 08:42:57 -08:00
Neil Fuller
2c6d510e45 Add a manual path for setting time zone
Add a mechanism for suggesting the "manual" time zone setting to the
TimeZoneDetectorStrategy, e.g. for the settings app to use. This
involves various changes / renames to TimeZoneDetectorStrategy to
introduce a distinction between 3 things:
1) General detection code, applicable for anything that changes device
time zone.
2) Phone detection code, applicable for setting the device time zone
from phone signals.
3) Automatic detection code, applicable for setting the device time zone
automatically (of which telephony signals is currently the only example,
but could be joined by new things in future).

Adds tests for the new ManualTimeZoneSuggestion and makes improvements
to the existing tests for PhoneTimeZoneSuggestionTest.

Test: atest android.app.timezonedetector
Test: atest com.android.server.timezonedetector
Bug: 140712361
Change-Id: I9c3a18e47b157cccabda74855e5c91b45fa93b92
2019-12-03 16:38:03 +00:00
Neil Fuller
256f4df4b6 Merge "Add a new time zone detection service"
am: 7d8a624085

Change-Id: Ic30cd636b4863a507dda0bdb05e982ee411d936f
2019-12-03 08:30:50 -08:00
Neil Fuller
7d8a624085 Merge "Add a new time zone detection service" 2019-12-03 08:40:07 +00:00
Daniel Colascione
06e9a4e01b Add property-invalidated cache
The PropertyInvalidatedCache class provides a framework for caching
frequently-read, seldom-written information between processes.

Test: caching CLs
Test: atest FrameworksCoreSystemPropertiesTests
Bug: 140788621
Change-Id: I2d650129389e9567e4982b3a613fb8d1cbc97f4b
2019-12-02 16:49:26 -08:00
Peter Wang
ed6d7e8b6e Merge "[Telephony Mainline] Exposed sendOrderedBroadcast" am: 471b839d02
am: 80a5a3db13

Change-Id: I0726f8853b46571976ae6f634e6a05265105bb3f
2019-12-02 13:54:51 -08:00
Peter Wang
80a5a3db13 Merge "[Telephony Mainline] Exposed sendOrderedBroadcast"
am: 471b839d02

Change-Id: Icd0230b880346a4ec573ccaa8d1adbade336f87a
2019-12-02 13:47:11 -08:00
Peter Wang
471b839d02 Merge "[Telephony Mainline] Exposed sendOrderedBroadcast" 2019-12-02 21:32:33 +00:00
Mady Mellor
1bd16756c6 Allow Shortcuts to be started on ActivityView
We're doing some experiments with using shortcut info to produce bubbles
instead of bubble metadata, shortcuts can only be launched via
LauncherAppsService, not an intent so we need a new method on ActivityView.

Test: manual with sysui CL ag/9617215:
      1) enable shortcut-created bubbles
      2) send a notification with shortcutId attached
      3) expand that bubble

Bug: 143173197
Bug: 138116133
Change-Id: I4d621ce703a40512588b9bd834dece9fe2ba9d8a
2019-12-02 12:43:01 -08:00
Eran Messeri
57b58c7257 Control lock sceen message on organization-owned device
Grant the profile owner of an organization-owned device the ability to
control the owner information shown on the lock screen.

Bug: 138709470
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest
Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testLockScreenInfo
Change-Id: Ie4e3bd421a655c88a311f1378ef3c265b37502f0
2019-11-30 21:14:04 +00:00
Ruslan Tkhakokhov
e794ceea61 Add a System API to block keys in KV restore
BackupManager#excludeKeysFromRestore can be used to pass a
list of keys that will be excluded from restore for the given package.
It is useful in situations when a key being restored can cause bad UX on
certain devices.

Bug: 145126096
Test: atest KeyValueRestoreExclusionHostSideTest
Change-Id: Ibbfd5e9196122c9bc3d31a3f0cc9430e433b9fd8
2019-11-28 20:33:42 +00:00
Ruslan Tkhakokhov
9e111f19df Add BackupManager#excludeKeysFromRestore()
Add the method as a hidden API for now. Move to System API later.

Bug: 145126096
Test: 1. Call BM#excludeKeyFromRestore for a test package
      2. Reboot the device
      3. Run restore for the test package
      4. Verify excluded keys are not restored

Change-Id: Ice57299eaf54cee8428b86e2d4f78de12b8db4fc
2019-11-28 20:33:24 +00:00
Neil Fuller
3352cfce2f Add a new time zone detection service
Add a new time zone detection service. Much of the code is from
frameworks/opt/telephony with some changes for naming, threading and
to modify the interaction with the "Callback" class.

Overall goal:

Implementing the service in the system server means it will be easier to
add new time zone detection logic unrelated to telephony in future.

Bug: 140712361
Test: atest com.android.server.timezonedetector
Test: atest android.app.timezonedetector
Change-Id: I89505fc4fecbd3667b60f8e1479b8f177eaa60ae
Merged-In: I89505fc4fecbd3667b60f8e1479b8f177eaa60ae
(cherry picked from commit 3e3b5405b6)
2019-11-28 13:27:55 +00:00
Neil Fuller
8c6790cc7e Merge "Add a new time zone detection service" 2019-11-28 13:00:28 +00:00
Neil Fuller
3e3b5405b6 Add a new time zone detection service
Add a new time zone detection service. Much of the code is from
frameworks/opt/telephony with some changes for naming, threading and
to modify the interaction with the "Callback" class.

Overall goal:

Implementing the service in the system server means it will be easier to
add new time zone detection logic unrelated to telephony in future.

Bug: 140712361
Test: atest com.android.server.timezonedetector
Test: atest android.app.timezonedetector
Change-Id: I89505fc4fecbd3667b60f8e1479b8f177eaa60ae
2019-11-28 12:58:05 +00:00
Neil Fuller
1d3f41186d Merge "Add a new method to set time" am: 5f01cb6ddc
am: b07f90adb8

Change-Id: Ia70ee27e4817cc1465513eaa7e076c8ccc4aee11
2019-11-28 00:59:51 -08:00
Neil Fuller
b07f90adb8 Merge "Add a new method to set time"
am: 5f01cb6ddc

Change-Id: If92a40f84971a663f99d7d764cd45e8d3510bfda
2019-11-28 00:54:46 -08:00
Peter Wang
cf8bfcc4c2 [Telephony Mainline] Exposed sendOrderedBroadcast
with appOp as String and options as Bundle

Bug: 139077993
Test: Build, GsmInboundSmsHandlerTest, CdmaInboundSmsHandlerTest and WapPushOverSmsTest
Change-Id: I60e21c7202d1bc7c5d28dfad2e2edde902f28a15
Merged-In: I60e21c7202d1bc7c5d28dfad2e2edde902f28a15
2019-11-27 20:10:20 -08:00
Peter Wang
7701f57250 [Telephony Mainline] Exposed sendOrderedBroadcast
with appOp as String and options as Bundle

Bug: 139077993
Test: Build, GsmInboundSmsHandlerTest, CdmaInboundSmsHandlerTest and WapPushOverSmsTest
Change-Id: I60e21c7202d1bc7c5d28dfad2e2edde902f28a15
2019-11-27 15:20:42 -08:00
Neil Fuller
3aedd49238 Add a new method to set time
Before this change there are a various components that set the system
clock by directly calling AlarmManager.setTime(). This change exposes a
new method on TimeDetector to use when setting the device time manually
(e.g. via settings) and modifies some callers to use it.

The intent is to later restrict the number of distinct processes that
can manipulate the device system clock directly so that all time changes
go through the time detector service, which can enforce policy, log
the reasons for changes, and so on.

Bug: 140712361
Test: atest com.android.server.timedetector
Change-Id: I9300dba868ed61249d0848b0dd4b953996161bda
Merged-In: I9300dba868ed61249d0848b0dd4b953996161bda
(cherry picked from commit e376756b0c)
2019-11-27 16:34:53 +00:00
Neil Fuller
e376756b0c Add a new method to set time
Before this change there are a various components that set the system
clock by directly calling AlarmManager.setTime(). This change exposes a
new method on TimeDetector to use when setting the device time manually
(e.g. via settings) and modifies some callers to use it.

The intent is to later restrict the number of distinct processes that
can manipulate the device system clock directly so that all time changes
go through the time detector service, which can enforce policy, log
the reasons for changes, and so on.

Bug: 140712361
Test: atest com.android.server.timedetector
Change-Id: I9300dba868ed61249d0848b0dd4b953996161bda
2019-11-27 10:44:13 +00:00
Neil Fuller
0715e47f92 Merge "Allow for empty time suggestions" am: a241a15ccc am: e02dcaa9d1
am: 4fae9dd7c8

Change-Id: I5ba3b458bce9ef89a998bbc4f9b6b24fe4f65c82
2019-11-27 02:18:17 -08:00
Neil Fuller
4fae9dd7c8 Merge "Allow for empty time suggestions" am: a241a15ccc
am: e02dcaa9d1

Change-Id: I06dd78a0a45df3761c271eb106fc15029989e2bd
2019-11-27 02:11:52 -08:00
Neil Fuller
e02dcaa9d1 Merge "Allow for empty time suggestions"
am: a241a15ccc

Change-Id: Ib6e1ddbba9c474f06475a666d025ab8e0f98189b
2019-11-27 02:04:56 -08:00
Neil Fuller
a241a15ccc Merge "Allow for empty time suggestions" 2019-11-27 09:45:53 +00:00
TreeHugger Robot
c688e6ad8e Merge "Hook up notification history to NMS." 2019-11-27 09:44:12 +00:00
TreeHugger Robot
10fb57adeb Merge "Convert EventLogTags.AM* events log points to EventLogTags.WM" 2019-11-27 01:21:40 +00:00
Makoto Onuki
13cace2cbd Merge "Expose APIs to register service manager wrappers." 2019-11-26 22:10:33 +00:00
TreeHugger Robot
7761845259 Merge "Adding temp whitelist methods to PowerWhitelistManager interface." 2019-11-26 20:56:24 +00:00
Makoto Onuki
0ceb3e0394 Expose APIs to register service manager wrappers.
Bug: 143788029
Test: boot & tree hugger
Change-Id: I6a1ce9d9603ce79d2ddb14f2a946fb51be25a9e4
2019-11-26 12:11:55 -08:00
Julia Reynolds
b317ff7fa2 Hook up notification history to NMS.
All of the lifecycle events for the history are in place now with
the exception of triggering a write when the power button is
long pressed

The new tests interacted with DeviceConfig in such a way that
callbacks were being received after tests were completed, so I
also had to add an unregistration step for the DeviceConfig
listener.

Test: atest
Bug: 137396965
Change-Id: I9ad1197105a5c2434444965a1649485e36e4b692
2019-11-26 14:31:13 -05:00
Kweku Adams
835283f000 Adding temp whitelist methods to PowerWhitelistManager interface.
Migrating temp whitelist APIs to PowerWhitelistManager to allow
telephony to add apps to the temp whitelist.

Bug: 138239060
Bug: 140141678
Bug: 141155196
Bug: 142420609
Bug: 144864180
Test: atest PowerWhitelistTest
Change-Id: Iefd6ecf89aad46de042ef3a1ec0c20d6c35da5a6
2019-11-26 11:07:29 -08:00
Eran Messeri
18d21312ca Rename PO Device IDs access -> Org Owned device
Repurpose the "Profile Owner was granted access to device identifiers"
to "Profile Owner of an Organization-owned device".

The old method now throws an exception, as it should not be called by
anything other than ManagedProvisioning (which is changed in this topic).

The new method now provides the functionality the old method provided,
and there's a new permission associated with it.

No functionality has been added or removed in this CL beyond that.

Bug: 138709470
Test: atest FrameworksServicesTests:DevicePolicyManagerTest
Test: atest com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testDeviceIdAttestationForProfileOwner
Change-Id: I9914e8220213898d0c6b3499af8897e3a6f23819
2019-11-26 14:57:30 +00:00
Eran Messeri
804d53c6f2 Merge "Wiping and relinquishing org-owned devices" 2019-11-26 14:50:38 +00:00
Eran Messeri
b8c46e0862 Wiping and relinquishing org-owned devices
Add the following functionality, on devices with a managed profile
created during provisionining (and as such, considered
organization-owned):

* Let the Profile Owner relinquish a device by calling
  DevicePolicyManager.wipeData. The device then transitions
  to a fully-personal device.
* Let the Profile Owner wipe the entire device by calling
  wipeData on the parent profile DevicePolicyManager instance.

Bug: 138709470
Test: Manual with TestDPC.
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest
Test: atest com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testDeviceIdAttestationForProfileOwner
Change-Id: If3cc9741079592cb07bc1ef5ccca8fb2b57a52e9
2019-11-26 09:33:03 +00:00
Jeff Chang
d136e77a5a Convert EventLogTags.AM* events log points to EventLogTags.WM
Since all activity management is now under the WM package we should also
convert the event log points for activities from EventLogTags.AM* to
EventLogTags.WM*.

Bug: 143461660
Test: Build and run, check event logs.
Change-Id: I62034ee353f65ef95b069e1f36db214ccb3c6d85
2019-11-26 15:18:14 +08:00
Shashwat Razdan
842d4eebda Added ACTION_UNPIN = 4 in ActionType
Bug: 143771613
Test: atest
Change-Id: If6a2d4609ecf5564093c9d9e8fa71219246f4d09
2019-11-26 01:19:07 +00:00
Meng Wang
ec606bd492 Merge "System API: Context#registerReceiverForAllUsers" am: 9e590914cb
am: 5eda192492

Change-Id: Ia177e20dd70a6db34accd01dfa1e4c59f264cbc1
2019-11-25 10:16:28 -08:00
Meng Wang
5eda192492 Merge "System API: Context#registerReceiverForAllUsers"
am: 9e590914cb

Change-Id: I2d98300ad4958d19e69dcdfda83e9d5df086d43a
2019-11-25 10:07:43 -08:00