Commit Graph

20280 Commits

Author SHA1 Message Date
Hui Yu
d117f9ccbf Merge "Specify temp-allowlist reasonCode while calling setPendingIntentAllowlistDuration()." into sc-dev am: edc573f0ac
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13705260

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iba60d9506c2bca90a7388b7064f4a1da831f7df2
2021-02-26 18:17:52 +00:00
Hui Yu
edc573f0ac Merge "Specify temp-allowlist reasonCode while calling setPendingIntentAllowlistDuration()." into sc-dev 2021-02-26 18:07:47 +00:00
Anna Zappone
5b2dc33510 Merge "Migrate from Uid to UserHandle" into sc-dev am: 635114d0e7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13688245

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I36417b0407059d458dcc2769058be68b782e3648
2021-02-26 10:53:38 +00:00
Anna Zappone
635114d0e7 Merge "Migrate from Uid to UserHandle" into sc-dev 2021-02-26 10:19:39 +00:00
Hui Yu
f5e73ef979 Specify temp-allowlist reasonCode while calling setPendingIntentAllowlistDuration().
Delete the overloaded version of setPendingIntentAllowlistDuration() without reasonCode.

Bug: 171305836
Test: atest cts/tests/app/src/android/app/cts/ActivityManagerFgsBgStartTest.java
Reboot device, observe "tempAllowListReason" in logcat.

Change-Id: Ib8bd22eefb5d5f308d2bcca17221499c2a6adc79
2021-02-25 22:33:44 -08:00
Riddle Hsu
9d539f2c33 Merge "Optimize the Parcel read/write of common window data" into sc-dev am: ed46310238
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13674730

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If7facfd0a3bb394cac47e12f1197bac479f2d885
2021-02-26 04:18:11 +00:00
Riddle Hsu
ed46310238 Merge "Optimize the Parcel read/write of common window data" into sc-dev 2021-02-26 04:07:39 +00:00
Hui Yu
88efd76d6a Merge "Log the temp allowlist reason/duration at FGS start." into sc-dev am: 3d96c757a5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13454819

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I93f8836cfb6428cbe2da91edbf706ca4864b3ef3
2021-02-26 02:04:39 +00:00
Todd Kennedy
e83e85ad04 Merge "Revert "Revert "Keep old package manager constructor""" into sc-dev am: fd7bff7f70
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13698261

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4f7c9ae7cc3164deaaaf3b46c5256366342254df
2021-02-26 02:02:45 +00:00
Hui Yu
3d96c757a5 Merge "Log the temp allowlist reason/duration at FGS start." into sc-dev 2021-02-26 01:21:13 +00:00
Todd Kennedy
fd7bff7f70 Merge "Revert "Revert "Keep old package manager constructor""" into sc-dev 2021-02-26 00:55:18 +00:00
Soonil Nagarkar
e02478da84 Merge "Update some Nullable annotations on PendingIntent" into sc-dev am: 8a3d8f79a5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13690718

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iaba6cf21913b4f7d17e1385be06264d8646e25bf
2021-02-25 22:33:19 +00:00
Soonil Nagarkar
8a3d8f79a5 Merge "Update some Nullable annotations on PendingIntent" into sc-dev 2021-02-25 22:05:13 +00:00
Todd Kennedy
534f4d3e9a Revert "Revert "Keep old package manager constructor""
This reverts commit e756211374.

Reason for revert: Apparently this is used; b/179601086

NoNonSdkCheck: The original change erroneously removed the method from the block-list; this reinstates the method
Fixes: 179601086
Test: builds
Change-Id: I383bc0a0e2a319b24e11aa7a07a69603efff706f
2021-02-25 21:17:44 +00:00
Neil Fuller
9250a5d089 Merge "Improve server flags / add more server control" into sc-dev am: fcfe1f1c56
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13690805

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic66d5864573fa4f3cde8e8747eeedd31d1e2e7a6
2021-02-25 18:40:09 +00:00
Neil Fuller
fcfe1f1c56 Merge "Improve server flags / add more server control" into sc-dev 2021-02-25 18:24:54 +00:00
Svetoslav Ganov
dfe1d7a18a Merge "Location provider app ops remapping" into sc-dev am: 3f9a7c0f52
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13527070

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib638e0ff78114b16acf92110a5b308868a94bb3a
2021-02-25 18:24:08 +00:00
Svetoslav Ganov
3f9a7c0f52 Merge "Location provider app ops remapping" into sc-dev 2021-02-25 18:18:42 +00:00
Neil Fuller
2856d9e52f Improve server flags / add more server control
Add more server flags that can be pushed to devices to influence geo
detection service behavior.

This renames DeviceConfig as ServerFlags and introduces an intermediary,
the ServiceConfigAccessor, to hide details and handle changes to config
values that need the location_time_zone_manager to restart.

Simulating server flag changes example:
adb shell cmd device_config put \
    system_time primary_location_time_zone_provider_enabled_override false

Inspecting manager / provider states:
adb shell dump location_time_zone_manager

The following manual tests were conducted to check the plumbing:

Modifying settings behavior:
adb shell cmd device_config put \
    system_time location_time_zone_detection_setting_enabled_override true
<Confirm the settings value cannot be changed by user>

adb shell cmd device_config put \
    system_time location_time_zone_detection_setting_enabled_override false
<Confirm the settings value can be changed by user>

adb shell cmd device_config delete \
    system_time location_time_zone_detection_setting_enabled_override
<Confirm it returns to normal>

Disabling the feature / location_time_zone_manager:
adb shell cmd device_config put \
    system_time location_time_zone_detection_feature_supported false
<Confirm SettingsUI (after restart) doesn't show the geo detection option>
<Confirm manager is not started>

Enabling the feature / location_time_zone_manager:
adb shell cmd device_config put \
    system_time location_time_zone_detection_feature_supported true
<Confirm manager is restarted>

Note: "cmd device_config" doesn't allow multiple config keys to be
changed at once, and any change to service config keys cause the
location_time_zone_manager to restart. When changing multiple, set
"location_time_zone_detection_feature_supported false" to stop the
manager, and "location_time_zone_detection_feature_supported true" when
all changes are done.

Test: Manual testing (see above)
Test: treehugger
Bug: 178107773
Change-Id: I07b57add1ed47197587907b9f0a85f38acc0a76a
2021-02-25 15:24:24 +00:00
Zimuzo Ezeozue
b3ed799a13 Merge "Extend AnrController to improve ANR dialog controls" into sc-dev am: b9f76e103c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13676710

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I01382c005813fdd6a4742e4c681cb59351b878aa
2021-02-25 14:45:27 +00:00
Kholoud Mohamed
a84aac45c3 Merge "Exposed some testAPIs in DPM" into sc-dev am: 3006355655
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13607749

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6eb14386f1cad0b2b1fda3b544a20c046f955c82
2021-02-25 14:41:36 +00:00
Sudheer Shanka
b455116706 Merge "Allow EJs to obtain new network capability." into sc-dev am: 8632838c50
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13526199

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I17dc44c86f41545b859de0afa3f7749e0cfef10e
2021-02-25 14:40:07 +00:00
Louis Chang
3dc3185216 Merge "Rename Stack to Task related terms (7/n)" into sc-dev am: 09f52aa440
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13468207

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I52b3df66c6b6dd517f35fd34ac877264a272c47d
2021-02-25 14:38:13 +00:00
Rajeev Kumar
0fb77424d8 Merge "Add API to set device owner type for a managed device" into sc-dev am: b21d30888b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13524654

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I16ff2d3df0e59ba536b1538c24e7e99c3d07737a
2021-02-25 14:33:23 +00:00
Ruslan Tkhakokhov
498bb8813b Merge "Get OperationType from transport" into sc-dev am: 04501d566e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13641708

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5ed46d43d6bbc7109e89c465ca9428234365e692
2021-02-25 14:33:00 +00:00
Ruslan Tkhakokhov
3c81d288d6 Merge "Parse include / exclude config specified by dataExtractionRules" into sc-dev am: c3bf79a2cd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13606568

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I08b53d417d5211696f1fabfa8c85770259f68063
2021-02-25 14:32:43 +00:00
Zimuzo Ezeozue
b9f76e103c Merge "Extend AnrController to improve ANR dialog controls" into sc-dev 2021-02-25 14:17:15 +00:00
Anna Zappone
aa4aef9968 Migrate from Uid to UserHandle
Fixes WorkProfile storage issues.

Bug: 179810781
Test: PeopleSpaceTileTest, PeopleSpaceUtilsTest
Change-Id: I9baadc1308fcd5725458bf9dd6e4917e79975dab
2021-02-25 10:43:38 +00:00
Kholoud Mohamed
3006355655 Merge "Exposed some testAPIs in DPM" into sc-dev 2021-02-25 10:23:37 +00:00
Sudheer Shanka
8632838c50 Merge "Allow EJs to obtain new network capability." into sc-dev 2021-02-25 09:19:15 +00:00
Louis Chang
09f52aa440 Merge "Rename Stack to Task related terms (7/n)" into sc-dev 2021-02-25 04:58:24 +00:00
Louis Chang
7efc57797c Rename Stack to Task related terms (7/n)
- Renaming PinnedStack to PinnedTask
- Renaming DockedStack to DockedTask

Bug: 157876447
Test: presubmit
Change-Id: I51c10564647ed0d46eddc0c51a1ee06eef897e43
2021-02-25 04:57:26 +00:00
Sudheer Shanka
6831749cb4 Allow EJs to obtain new network capability.
- Introduce new oom_adj score to be used for EJs so that they won't
  be killed before normal jobs but before any FGS. Also, add a new
  bind flag to instruct the OomAdjuster about when to use this
  new oom_adj score.
- Unlike other capabilities, any app (regardless of it's proc_state)
  with network capability will be able to transfer it's capability
  to other app by binding to it.

Bug: 177641226
Test: atest ./tests/app/src/android/app/cts/ActivityManagerProcessStateTest.java
Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Test: atest ./services/tests/mockingservicestests/src/com/android/server/am/MockingOomAdjusterTests.java
Test: atest CtsJobSchedulerTestCases

Change-Id: I888764ff22fba92fe2cccf3d8442ed318a19ad2a
2021-02-24 17:17:55 -08:00
Rajeev Kumar
b21d30888b Merge "Add API to set device owner type for a managed device" into sc-dev 2021-02-25 00:21:51 +00:00
Soonil Nagarkar
e4bd95241a Update some Nullable annotations on PendingIntent
It's possible to statically verify that mTarget can never be null, and
that in every instance where an @NonNull annotation has been added here
it was previously impossible for null to be returned at that location.
The only exception is for getCreatorPackage(), where it is more
difficult to verify that it is impossible for this to be null.
Logically, it doesn't make any sense for a PI to not have a creator
package, and I have gone through every call flow for setting the creator
package I could fine to verify it can never be set to null.

Bug: 175221460
Test: manual sanity checks
Change-Id: Ia9e2c3c4ff8c9082190cd50129cedcbcfd219574
2021-02-24 15:42:23 -08:00
Ruslan Tkhakokhov
a2fdf3f5fb Get OperationType from transport
This CL was merged earlier (ag/13484966) and then reverted due to the
new behaviour breaking D2D transfers.

Merge it again with all changes being controlled by a flag (default
off), see UserBackupManagerService:getOperationTypeFromTransport in this
CL. View the diff between patchsets 1 and 2 to only see what's changed
between the earlier reverted code and the fixed version of it (i.e. with
the flag).

The flag can be changed via adb for now, we will set it to true by
default once other components are ready.

Bug: 174216309
Test: atest UserBackupManagerServiceTest
Change-Id: I7473c9b4f8d0c4d20155be76930279184ffb17c4
2021-02-24 23:21:21 +00:00
Ruslan Tkhakokhov
c3bf79a2cd Merge "Parse include / exclude config specified by dataExtractionRules" into sc-dev 2021-02-24 23:20:54 +00:00
Svet Ganov
4700428b6f Location provider app ops remapping
The platform has the concept of a location provider which could
be a plugin implemented by another package. The implementation
of a location provider plugin can make calls to APIs that require
a location permission, e.g. fusing data from different sources.
However, such accesses are counted in app ops as a location access
but the accessor is in this case the data source. It is also
possible that the package that provides the implementation of a
location provider also hosts other funcionality which may need to
call APIs that require a location permission.

This change allows a location provider to specify app op attribution
tags which which could be used when calling location to singal to the
OS that the access is for the location providing functionality of the
location provider. For location accesses of the provider package that
are not related to providing location to the OS the provider can use
any other non delcared as location attribution tags. Accesses with
the location attribution tags would be counted in app ops but instead
of towards the OP_COARSE_LOCATION/OP_FINE_LOCATION the would be
counted towards dedicated OP_COARSE_LOCATION_PROVIDER/
OP_FINE_LOCATION_PROVIDER ops. This would allow proper classification
while enabling auditability and tracking via the standard app op APIs.

<meta-data
    android:name="android:location_allow_listed_tags"
    android:value="foo;bar;baz"/>

Test: atest android.location.cts.fine.LocationManagerFineTest#testLocationAttributionTagBlaming

Bug:179062648

Change-Id: I36739ab42cedc94e1aa7a3bfd3b9aa213f5b3e97
2021-02-24 23:11:35 +00:00
James O'Leary
2b416cd6c2 Merge "Revert^2 "[framework] Integrate new quantizers"" into sc-dev am: 7edf52d602
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13688547

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5b0263b3b455044636b5a6ff8b322cfc13397760
2021-02-24 22:14:15 +00:00
Hui Yu
bd7619635d Log the temp allowlist reason/duration at FGS start.
There are four ways a package can be temp allowlisted:
1. Calling BroadcastOptions#setTemporaryAppWhitelistDuration() to
allowlist a BroadcastReceiver, this is a SystemApi.
2. Calling ActivityManagerService#setPendingIntentWhitelistDuration()
to allowlist a PendingIntent, this is not an API, it is an internal method.
3. Calling PowerWhitelistManager#whitelistAppTemporarily() to allowlist
a package, this is a SystemApi.
4. DeviceIdleController.addPowerSaveTempWhitelistApp(), this is an
internal method.

Also the package can be permanently allowlsited in
 ActivityManagerService#mDeviceIdleExceptIdleAllowlist.

Move the BG-FGS-launch reasonCode from ActiveService.java to
PowerWhitelistManager.java. Define a list of temp allowlist reasonCode
in addition to the BG-FGS-launch reasonCode. The reasonCode is passed
around in DeviceIdleController and ActivityManagerService, it will be
used in statsd FGS metric.

At FGS start, check all above allowlists and record the reasonCode/reason/duration in
ServiceRecord#mInfoTempAllowListReason field.

If mInfoTempAllowListReason is not null, log the reasonCode/reason/duration in "Background started FGS" log
message, with key "tempAllowListReason".

Bug: 171305836
Test: atest cts/tests/app/src/android/app/cts/ActivityManagerFgsBgStartTest.java
Reboot device, observe all "tempAllowListReason" listed above in logcat.
BYPASS_INCLUSIVE_LANGUAGE_REASON=existing APIs

Change-Id: Ieb52d95aae3258817a67734c093cb12fc78a81fd
CTS-Coverage-Bug: 181160445
2021-02-24 22:02:09 +00:00
James O'Leary
7edf52d602 Merge "Revert^2 "[framework] Integrate new quantizers"" into sc-dev 2021-02-24 21:59:47 +00:00
Soonil Nagarkar
6294f03724 Merge "Proposal: Reduce the number of IPCs in PendingIntent" into sc-dev am: 2409543ce8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13618861

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I72f56ca7d750cf9e9c2b5596dd4dcaef7e6c830f
2021-02-24 21:54:59 +00:00
Ruslan Tkhakokhov
6751d29041 Parse include / exclude config specified by dataExtractionRules
1. Parse the new config and prefer it over the old config specified by
android:fullBackupContent.

2. Add a new parameter to LocalTransportParameters to allow testing this
functionality in CTS.

Bug: 180522596
Test: atest FullBackupRulesHostSideTest
Change-Id: If18edfcdb2b9637d380251f48fdbc56cca6af3ec
2021-02-24 21:49:24 +00:00
Soonil Nagarkar
2409543ce8 Merge "Proposal: Reduce the number of IPCs in PendingIntent" into sc-dev 2021-02-24 21:48:46 +00:00
Jeff DeCew
ed180304c0 Merge "Add API to let apps color CallStyle notifications themselves." into sc-dev am: 5ba00654f4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13676308

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I881b45171d9d5de8f75e6101916cd0b7df8aefda
2021-02-24 21:20:04 +00:00
James O'Leary
9d3ad10eb9 Revert^2 "[framework] Integrate new quantizers"
96169052c4

Change-Id: Idefcf279b9fedeeaa29f75e705adfb60f0ad5c8a
2021-02-24 17:09:06 +00:00
Riddle Hsu
b293d933e0 Optimize the Parcel read/write of common window data
The Parcel read/write speed of MergedConfiguration/InsetsSource
becomes 4x+ faster.

Because writeParcelable sends additional type info which is
unnecessary if the type is known on the reading side, replace
the usages to writeTypedObject and well-written readFromParcel.
That saves the time of class lookup and object creation.

Bug: 181025587
Test: vogar --mode app_process --benchmark \
frameworks/base/core/tests/benchmarks/src/android/os/ParcelableBenchmark.java

Change-Id: I29548ce6c2e5886f0e90a5dc70d8e9ecc0fb25a8
2021-02-24 23:33:16 +08:00
Jeff DeCew
a785a58034 Add API to let apps color CallStyle notifications themselves.
Fixes: 180925557
Test: visual inspection
Test: atest NotificationTemplateTest
Change-Id: I5f580083f1de192985b4764b894730789c2c2583
2021-02-24 09:07:44 -05:00
kholoud mohamed
557355e457 Exposed some testAPIs in DPM
- Exposed the following as testAPIs:
* markProfileOwnerOnOrganizationOwnedDevice with
MANAGE_PROFILE_AND_DEVICE_OWNERS permission
* forceSecurityLogs with FORCE_DEVICE_POLICY_MANAGER_LOGS permission
* forceNetworkLogs with FORCE_DEVICE_POLICY_MANAGER_LOGS permission
* setDeviceOwner
* setActiveAdmin
* forceRemoveActiveAdmin with MANAGE_PROFILE_AND_DEVICE_OWNERS permission
* clearSystemUpdatePolicyFreezePeriodRecord with CLEAR_FREEZE_PERIOD
permission

- Changed getDeviceOwnerComponentOnAnyUser to accept
MANAGE_PROFILE_AND_DEVICE_OWNERS permission

Bug: 180500227
Test: verified that cts tests can call the APIs
Change-Id: I824980d1f408f1e0bf536c9526f1666dead31d82
2021-02-24 12:31:07 +00:00
Zim
465e3b7115 Extend AnrController to improve ANR dialog controls
I5431d22bd8faa75e3deab1960a2f721784f98d42 introduced a basic ANR
controller interface to allow services within the system_server
register to delay the ANR dialog during an ANR.

Some limitations of that interface were:
1. No way to cancel the ANR dialog if the normal function of the app
resumed during the delay
2. The AnrController#getAnrDelay method was serving a dual purpose of
returning the delay and showing an interim UI
3. The interim UI might live within an updatable mainline
module, hence forcing the system_server to block (asynchronously) on
the 'getter' for the binder call.

This cl addresses the problems above with the following new
methods on AnrController: onAnrDelayStarted and onAnrDelayCompleted.

These methods provide a clearer interface for the following reasons:
1. onAnrDelayCompleted will return a boolean value to indicate whether
the ANR dialog should still be shown after the delay
2. onAnrDelayStarted is a more explicit API that can be called
asynchronously without blocking to notify external components to show
an interim UI
3. The existing getAnrDelay can be handled completely within the
system_server without blocking on an external binder call

See design (2a) in go/transcoding-anrs for more details

Test: Manual
Bug: 170486601
Change-Id: Idb9190a0e6014ce64bf1412c26f6ae03f97e922d
2021-02-24 09:34:03 +00:00