Commit Graph

16677 Commits

Author SHA1 Message Date
Roshan Pius
3f9ba67fa7 Merge changes from topics "suggestion_no_uid_package", "wifi_key_value_list_parser", "wifi_power_profile", "wifi_service_manager_getService", "wifi_westworld"
* changes:
  statsd: Allow wifi mainline module to log its metrics
  wifi-services-srcs: Stop using KeyValueListParser from android.internal
  WifiNetworkSuggestion: Don't store packageName/uid
  WifiAwareManager: Add requestMacAddresses @hide API
  UserManager: Add StringDef for all restrictionKey values
  WifiActivityEnergyInfo: Use time values for energy calculation
2019-12-09 17:08:30 +00:00
Alex Johnston
b6bcf30de9 Merge "Call setCameraDisabled and getCameraDisabled on the parent profile" 2019-12-09 15:37:01 +00:00
Alex Johnston
755e377c4a Call setCameraDisabled and getCameraDisabled on the parent profile
Previously, these APIs did not support explicitly querying the parent profile.
This CL allows the WP DPC to now call these methods, which means the WP DPC
can disable the camera device-wide and not just for the WP.

Bug: 138709470
Test: manual testing using Personal and WP TestDPC and Camera
      atest com.android.cts.devicepolicy.ManagedProfileTest
      atest com.android.server.devicepolicy.DevicePolicyManagerTest

Change-Id: I7e7ce7be766850c6e2f58c72a0a44990817e9b73
2019-12-09 14:08:03 +00:00
Rubin Xu
feeeb6538e Merge "Kill off untrusted password reset" 2019-12-09 10:29:24 +00:00
Rubin Xu
d952240979 Kill off untrusted password reset
Time has come that we can finally ditch untrusted password reset i.e.
changing lockscreen password without providing the existing password or
an activiated password reset token. In this change, we are:

1. Preventing any DPC / legacy device admin from invoking
DPM.resetPassword(), the primary route to invoke untrusted password
reset. Depending on their target SDK level, resetPassword() will either
throw SecurityException, or fail silently.
2. Still allowing privilleged app holding RESET_PASSWORD permission to
call this API, but it's limited to setting a new passowrd on an
unsecured device.
3. Removing synthetic password caching mechanism in LockSettingsService,
whose sole purpose was to support untrusted password reset.

Bug: 137939224
Test: atest com.android.server.locksettings
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
Change-Id: Ie3e5e277984b6fc2f1d378880363028752bad775
2019-12-08 22:01:01 +00:00
Roshan Pius
3eac0b9158 UserManager: Add StringDef for all restrictionKey values
Based on API council feedback for the recently added
hasUserRestrictionForUser API.

Bug: 144924593
Test: Compiles
Change-Id: Ib78c334d48a57c2e97f8f1b29d7d663d3eb2f1c1
2019-12-06 15:34:26 -08:00
Ruchir Rastogi
cd9dd94fb1 StatsEventParcel impl.; move AIDL files
This implementation continue to uses libbinder, as opposed to
libbinder_ndk.

We also move many (but not all) statsd aidl files from
frameworks/base/core into the apex.

Test: m -j128 && bit statsd_test:*
Change-Id: I95f06e937e50c1e2a638163b13587682402956a7
2019-12-06 14:08:27 -08:00
Jeffrey Huang
77db950964 Merge "Rename writeToProto to be dumpDebug" 2019-12-06 18:53:15 +00:00
Neil Fuller
ba5a0dfa5b Merge "TimeDetector improvements" am: 6e3020490d am: c72f796176
am: c186f60e8c

Change-Id: I544b8e79ae31a478e3a8bad171db6e2bde63afff
2019-12-06 04:14:27 -08:00
Neil Fuller
c186f60e8c Merge "TimeDetector improvements" am: 6e3020490d
am: c72f796176

Change-Id: I76a5726953cd6dc7998e298c9d41e86a3b4f7c00
2019-12-06 04:08:26 -08:00
Neil Fuller
6e3020490d Merge "TimeDetector improvements" 2019-12-06 11:53:14 +00:00
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
Jeffrey Huang
cb78285b81 Rename writeToProto to be dumpDebug
We want to eventually migrate some of these APIs to be @SystemApi for mainline modules.
The #dumpDebug name is more appropriate than #writeToProto.

Bug: 142279786
Test: Manual
Change-Id: I60793e91cedf6b720d4ecef6a8484f4fed4ff30f
2019-12-05 11:28:11 -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
0db51fc310 TimeDetector improvements
TimeDetector improvements for production code and tests. Many of these
are based on feedback given for TimeZoneDetector and to improve
consistency across the two.

1) Add a builder for PhoneTimeSuggestion, making it immutable (except
for debug info that doesn't affect behavior).
2) Improve debug logging.
3) Improve comments / annotations.

Test: atest android.app.timedetector
Test: atest com.android.server.timedetector
Bug: 140712361
Change-Id: Ibd0d357c536d512ffe4995c4e6560e483a260ae5
2019-12-03 20:22:05 +00: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