Commit Graph

16664 Commits

Author SHA1 Message Date
Peter Wang
5b0ee657e0 Merge "[Telephony Mainline] Refactored grantDefaultPermissionsToActiveLuiApp and revokeDefaultPermissionsFromLuiApps from PermissionManagerService to Permmission Manager" 2019-12-06 05:32:51 +00:00
TreeHugger Robot
14ec7e5938 Merge "StatsManager uses private object for synchronizing" 2019-12-06 04:01:35 +00:00
Tej Singh
2cf3ae3f06 StatsManager uses private object for synchronizing
StatsManager used to synchronize on "this", which is dangerous because
an app can get StatsManager and also sychronize on it, which would block
all calls. We now lock on a private final object.

Test: make
Bug: 144315658
Fixes: 144315658
Change-Id: Ia34b1c586b09a48b244cc16dba77fe54e81f62cf
2019-12-05 18:42:30 -08:00
TreeHugger Robot
cf87cafa19 Merge "Bug report handler app via Bug Report Shortcut" 2019-12-06 01:45:31 +00:00
Paul Chang
c40f578d02 Bug report handler app via Bug Report Shortcut
- Send intent (android.internal.intent.action.BUGREPORT_REQUESTED) to bug report handler app after pressing Bug Report Shortcut
- Add config "config_bugReportHandlerEnabled" to enable this feature
- Add config "config_defaultBugReportHandlerApp" to get the package of default bugreport handler app
- Add settings CUSTOM_BUGREPORT_HANDLER_APP to get the package of custom bugreport handler app
- Add settings CUSTOM_BUGREPORT_HANDLER_USER to get the user id of custom bugreport handler app

BUG:142921485
Test: After pressing Bug Report Shortcut in manual local test:
- the intent can be sent to bugreport handler app.
- the intent can be sent to Shell if the chosen and the default bugreport handler app can't handle it.
- the intent can be sent to system user profile's default bugreport handler app if the custom profile(like work profile) is removed.
Change-Id: Idc33b47f0cc65b90cbf648bda54a1d900fef007a
2019-12-06 05:52:09 +08:00
Peter Wang
56dec3f134 [Telephony Mainline] Refactored grantDefaultPermissionsToActiveLuiApp
and revokeDefaultPermissionsFromLuiApps from PermissionManagerService to
Permmission Manager

Bug: 142019744
Test: Build
Change-Id: Ic39e1a66b650e7969242eb2116f342de488b1ca6
2019-12-05 13:23:02 -08:00
Alan Stokes
f25c755705 Merge "Add PackageManager#getInstallSourceInfo() to the API." 2019-12-05 15:57:02 +00:00
TreeHugger Robot
40067bbcd2 Merge "getWifiMacAddress: Enable for profile owner on org-owned device" 2019-12-05 15:02:19 +00:00
Neil Fuller
6d1e81ee34 Merge "Add suggestManualTimeZoneSuggestion to the client" am: 63d5f12489 am: 2447fe6f69
am: ee036c7535

Change-Id: Ia6481faf3520b01d5d1ee821362d6c739479b42c
2019-12-05 06:45:14 -08:00
Neil Fuller
ee036c7535 Merge "Add suggestManualTimeZoneSuggestion to the client" am: 63d5f12489
am: 2447fe6f69

Change-Id: I2ecb6991ee2fce6b4d79164f4fd7dd568042db4f
2019-12-05 06:09:31 -08:00
Neil Fuller
106f18a666 Add suggestManualTimeZoneSuggestion to the client
Add TimeZoneDetector.suggestManualTimeZone() to set the time zone
"manually" and switch the device policy manager code over to using
it.

Add RequiredPermission annotations to TimeZoneDetector while there.

Bug: 140712361
Test: treehugger only
Test: atest services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
Change-Id: Id247fddfdd793732dd88294ee215eda37cd0be4c
2019-12-05 12:12:14 +00:00
Eran Messeri
6ba10db1e4 getWifiMacAddress: Enable for profile owner on org-owned device
Allow the profile owner on an organization-owned device to call
getWifiMacAddress.

Part of this change is introducing a new DeviceAdminInfo policy,
USES_POLICY_ORGANIZATION_OWNED_PROFILE_OWNER, which can be used
to find out if the admin is either device owner or profile owner
on organization-owned device.

Bug: 138709470
Bug: 145308393
Bug: 145336515
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.MixedDeviceOwnerTest#testWifi
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testWifiMacAddress
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest#testWifi
Change-Id: Id790408a07b9dd19530563bd2aa9216a7333e863
2019-12-05 11:55:17 +00:00
Charles Munger
9d5c54ddbb Merge "Deprecate IntentService" am: 17d1d950ec am: bcdb5c84d3
am: 26bfde20d5

Change-Id: Idaa32d47a1825597f014bd4f46e7e46b94475283
2019-12-05 00:32:14 -08:00
Charles Munger
26bfde20d5 Merge "Deprecate IntentService" am: 17d1d950ec
am: bcdb5c84d3

Change-Id: I74aa58b9d94618b32069460cdbfe7f006c0e2d72
2019-12-04 14:29:38 -08:00
Charles Munger
17d1d950ec Merge "Deprecate IntentService" 2019-12-04 22:17:28 +00:00
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
2b65793cd6 Merge "Merge Android10 QPR1 into AOSP master" 2019-12-03 23:15:02 +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
Alan Stokes
cae316df07 Add PackageManager#getInstallSourceInfo() to the API.
Adds a new parcelable class InstallSourceInfo and a method to retrieve
it for a given package.

Also deprecates getInstallerPackageName(), which is subsumed by the
new method.

Bug: 134746019
Test: atest PackageManagerTests
Test: atest CtsContentTestCases
Change-Id: I9e5be29cac15a6bbe1482a6fdefca595418e6e66
2019-12-03 16:37:55 +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