Commit Graph

21099 Commits

Author SHA1 Message Date
Jooyung Han
161105be0a Merge "Revert "AIDL: use typed Map"" am: 01da4566ee am: 16c2faf6e1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1806796

Change-Id: If93a01cbff96ab90c54bc35fdeb2ac298914df33
2021-09-01 00:50:56 +00:00
Jooyung Han
16c2faf6e1 Merge "Revert "AIDL: use typed Map"" am: 01da4566ee
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1806796

Change-Id: Idc267d0189a2efcae7d4e5437e31106aa3a4b3ea
2021-09-01 00:37:33 +00:00
Jooyung Han
01da4566ee Merge "Revert "AIDL: use typed Map"" 2021-09-01 00:20:02 +00:00
Jing Ji
637bdf9b9a Merge "Use ArrayMap instead of SparseArray to manage the ProviderKey" into sc-dev am: d5ea86eaf0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15664720

Change-Id: I93062f5aec80be58bc53118c6a7af8550252d0d1
2021-08-31 06:03:51 +00:00
Jing Ji
d5ea86eaf0 Merge "Use ArrayMap instead of SparseArray to manage the ProviderKey" into sc-dev 2021-08-31 05:48:08 +00:00
Jooyung Han
f306e46365 Revert "AIDL: use typed Map"
This reverts commit 553c027bbf.

Reason for revert: b/197550396

Change-Id: I3c59d132985a3d21a11b55ba1546ed9f46f6e474
2021-08-31 00:49:37 +00:00
Chilun
bb77ce0eaf [RESTRICT AUTOMERGE] Workaround to dump error log instead of exception am: f8fc1326f7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15690060

Change-Id: Ie96d965bbdbc58e111f1907636771263f4b23e41
2021-08-29 16:25:50 +00:00
Chilun
f8fc1326f7 [RESTRICT AUTOMERGE] Workaround to dump error log instead of exception
This is a short-term workaround to dump error log instead of throwing
the exception to unblock the test.

Bug: 197484331
Test: build pass
Change-Id: I2ece3b9d85edc1ae43038e6f69b35f59b160a3dd
2021-08-27 10:41:41 +00:00
Jing Ji
119dd01b49 Use ArrayMap instead of SparseArray to manage the ProviderKey
As the ArrayMap handles the hash code collision properly.

Bug: 197647956
Test: atest CtsContentTestCases:android.content.cts
Change-Id: Ibb57a22c08b0fa5462505d586d5fb0aaf908c80f
2021-08-24 11:42:58 -07:00
Jooyung Han
07db6330cb devicepolicy: use typed List<String> in AIDL
Bug: 192615532
Test: m
Merged-In: I0ea1c35f7ce4dd6f6bde02874e02ed190fa2e904
Change-Id: I0ea1c35f7ce4dd6f6bde02874e02ed190fa2e904
(cherry picked from commit 57fe5105df)
2021-08-24 03:16:54 +00:00
Jooyung Han
4d9fc0aea9 devicepolicy: use typed List<String> in AIDL
Bug: 192615532
Test: m
Merged-In: I0ea1c35f7ce4dd6f6bde02874e02ed190fa2e904
Change-Id: I0ea1c35f7ce4dd6f6bde02874e02ed190fa2e904
2021-08-24 09:11:54 +09:00
TreeHugger Robot
233890d702 Merge "devicepolicy: use typed List<String> in AIDL" into sc-dev-plus-aosp 2021-08-24 00:09:44 +00:00
Makoto Onuki
be46bb90ac Merge "Change Shallow Copy to Deep Copy in UsageStats" am: f4d7116b49
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1796513

Change-Id: If0a979f9b0b39387bdd854859187b8b14ae9e4bd
2021-08-23 19:47:58 +00:00
Makoto Onuki
f4d7116b49 Merge "Change Shallow Copy to Deep Copy in UsageStats" 2021-08-23 19:17:38 +00:00
Jooyung Han
57fe5105df devicepolicy: use typed List<String> in AIDL
Bug: 192615532
Test: m
Change-Id: I0ea1c35f7ce4dd6f6bde02874e02ed190fa2e904
2021-08-20 06:19:42 +09:00
zhuyunyi
afcd22acaa Change Shallow Copy to Deep Copy in UsageStats
There are three reference type members in UsageStats's constructor, when using "new UsageStats(stats)" to copy, it will be a Shallow Copy, which may cause concurrent modify problem.

For example, in UserUsageStatsService.java, the sUsageStatsCombiner is using "new UsageStats(stats.packageStats.valueAt(i)" to copy, and the value is passing to the computeCacheQuotaHints in
CacheQuotaStrategy.java. If we change the UsageStats.mForegroundServices at the same time, IndexOutOfBounds Exception will happen.

Therefore, it is necessary to modify the way of copying of the UsageStats.

Signed-off-by: zhuyunyi <zhuyunyi@xiaomi.com>
Change-Id: I58a54d17aad6ef5213e52658ee3387f3069339af
2021-08-17 14:10:39 +08:00
Xin Li
773a9dfba7 Merge sc-dev-plus-aosp-without-vendor@7634622
Merged-In: I661f5fb6b1f3f6ce4322fab8fa84a7ab364c65b1
Change-Id: I16482b494ff4821016aabbb646e495d616c630ac
2021-08-14 07:23:27 +00:00
Jooyung Han
cde3534eb1 Merge "AIDL: use typed Map" am: 72d5595e0e am: aa0551424c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1793486

Change-Id: I269ec562d6e1441cdbd9ce48e8f9737d6ab3fd21
2021-08-12 23:39:19 +00:00
Jooyung Han
553c027bbf AIDL: use typed Map
AIDL supports typed maps, so use it instead of untyped one.

Bug: 192615532
Test: m, TH presubmit
Change-Id: I0fedf05872cbe2025e04ca07ce6c90bc9067b331
2021-08-12 08:38:10 +00:00
Makoto Onuki
a33d48c48e Merge "Clarify how FGS restriction won't apply STICKY FGS restarts" into sc-dev am: 0c1dc2fc76
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15484572

Change-Id: Ic11bfc07ac3ad19222bcc48dc7e54f46a1af6fe6
2021-08-11 21:35:25 +00:00
Makoto Onuki
0c1dc2fc76 Merge "Clarify how FGS restriction won't apply STICKY FGS restarts" into sc-dev 2021-08-11 21:17:20 +00:00
Ruslan Tkhakokhov
7d77e932b6 Merge "Handle empty <cloud-backup> section in android:dataExtractionRules" into sc-dev am: b72bf2927e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15462078

Change-Id: I2c136b39d1368dc2add5aee0e6d0c42360915fa7
2021-08-06 22:03:27 +00:00
Makoto Onuki
5031c3a4f6 Clarify how FGS restriction won't apply STICKY FGS restarts
Fix: 195780554
Test: build
Change-Id: Ic627a89ac863729d36554070d04c22254747f014
2021-08-06 21:43:31 +00:00
Ruslan Tkhakokhov
21f45cd998 Handle empty <cloud-backup> section in android:dataExtractionRules
Currently the <cloud-backup> section in android:dataExtractionRules is
ignored unless it contains rules. Instead, we should interpret it as
'everything other than cache and no-backup dirs is eligible for cloud
backup'.

Bug: 195095045
Test: 1. atest BackupEligibilityHostSideTest
      2. Use a test app with empty <cloud-backup> section to manually
      test:
          2.1. Empty section - everything is backed up
	  2.2. Empty section but "disableIfNoEncryptionCapabilitites"
	  set to "true" - data only backed up if the transport supports
	  encryption.
Change-Id: Ic8066721a46bda688f9211c51a0f2497e9caf93b
2021-08-06 12:16:05 +00:00
Riddle Hsu
c3b9b6ba95 Fix NPE when calling recreate in onCreate am: 6c675a3a48
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15435289

Change-Id: I22adc2f4d43f4cf9331c677667c414b8f6a127eb
2021-08-04 05:37:56 +00:00
Riddle Hsu
6c675a3a48 Fix NPE when calling recreate in onCreate
ActivityClientRecord#activity is assigned after calling
Activity#onCreate. A use case is that the app uses
support library to set night mode in onCreate.

Bug: 195418295
Test: Invoke Activity#recreate() in Activity#onCreate.
Change-Id: I6319cd6ee94fc2603979da47303963d04168db04
2021-08-04 10:16:41 +08:00
Nate Myren
9d1a9399b8 Merge "Add attribution info to start callbacks" into sc-dev am: 5d97f29218
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15446590

Change-Id: I42bdf188ec74c9d3a7179f717a08c7fec7f33833
2021-08-03 20:06:34 +00:00
Nate Myren
5d97f29218 Merge "Add attribution info to start callbacks" into sc-dev 2021-08-03 19:56:02 +00:00
Nate Myren
f685a342c8 Merge "Revert sync app op chain changes" into sc-dev am: 50ff5ac8b8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15424412

Change-Id: I362a049cc0e3a255796dc3481cbb153c734da76d
2021-08-03 15:33:04 +00:00
Nate Myren
06d07d54db Add attribution info to start callbacks
Add attribution flags and chain IDs to start callbacks, and have the
PermissionUsageHelper listen for starts. This ensures that, if another
start happens while an op is already running, and has chain information,
then this chain information will be recorded.

Test: manual
Bug: 194198234
Change-Id: I0ab1aa0969b70e18001f4a814ea5689f9329a019
2021-08-03 08:25:31 -07:00
Nate Myren
50ff5ac8b8 Merge "Revert sync app op chain changes" into sc-dev 2021-08-03 15:16:35 +00:00
Nate Myren
86c337659a Revert sync app op chain changes
These changes cause some noted app ops to be swallowed due to one-way
app ops.

Fixes: 187721493
Test: atest AppOpsLoggingTest
Change-Id: I3b761b65b2e06138fc1d130bf80587f8885bb1d5
2021-08-02 12:50:44 -07:00
Jeff DeCew
9da83c7285 Merge "Fix bug removing semantic colors of CallStyle notification actions." into sc-dev am: 4203db854f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15405173

Change-Id: I0aab8ac3c1a29c22751f33e7f699db73ff8389e6
2021-07-29 20:37:09 +00:00
Jeff DeCew
4203db854f Merge "Fix bug removing semantic colors of CallStyle notification actions." into sc-dev 2021-07-29 20:24:37 +00:00
Jeff DeCew
5dae211842 Fix bug removing semantic colors of CallStyle notification actions.
* When we changed the default color of emphasized actions to an accent color instead of the notification background color, I didn't split the two into different locals, and this meant the accent color was used to enforce the color contrast of the custom color.  This led to color desaturation in an attempt to meet contrast (when in dark mode) and a failure to ensure sufficient contrast (in light mode).
* A piece of this that applies specifically to colorized notifications is that we used the 'night mode' state as a shortcut for whether the background was light or dark.  This led to 1) different foreground colors for the same background color, depending on dark mode state, and 2) frequently a failure to meet contrast (and/or extreme desaturation) in one of those modes.
* Also adding different night-mode colors for CallStyle actions, to meet spec.

Test: validated sufficient contrast of default and various colorized background/button combos using the accessibility scanner.
Bug: 194935539
Change-Id: I3a69eadc89f1d9d98a816c44a36873c7615a177e
2021-07-29 11:16:52 -04:00
Chalard Jean
c962260ff6 Merge "Fix: ConnectivityManager methods crashing with SecurityException" into sc-dev am: 4e7b1128a4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15401698

Change-Id: I06737e036ff0a320b157929329d031ff036734fc
2021-07-29 06:06:00 +00:00
Chalard Jean
249be21013 Fix: ConnectivityManager methods crashing with SecurityException
Starting in R, some methods in ConnectivityManager like
getNetworkCapabilities started passing the package name from
the context stored in CM to check that the package is really
whom it pretends to be. Unfortunately, in some cases, the
context contains package "android" for an app, and since the
app is not the system, the check fails and crashes the app.

It seems the culprit is updateHttpProxy, which is called by
ProcessList when the PROXY_CHANGE_ACTION broadcast is sent.
If this happens to run between the time the process is created
and the activity thread is "bound", then the mInitialApplication
member is not set, and updateHttpProxy uses a system context.
Since ConnectivityManager caches the context forever in a
static, this leads to subsequent legitimate calls crashing.

Setting the proxy can be deffered until such a time that the
app is bound, as it can't run any code before then. The member
is never reset to null, so it's guaranteed to be non-null at
bind time.

An alternative would be to post a runnable on the handler
thread if the member is null to try again later. This
could however run the lambda a considerable number of times
as binding can be delayed, and risks causing an infinite loop
if some invariants are changed in the future.

See also b/73572062 and ag/4056059

Bug: 155549446
Bug: 189360509
Test: ActivityThreadTest FrameworksNetTests NetworkStackTests
Test: Manually set a proxy, observe the broadcast being sent and
      apps not crashing
Change-Id: I956f76be2e0a1a675576511fb394d7ed4354b28a
Merged-In: I956f76be2e0a1a675576511fb394d7ed4354b28a
2021-07-29 13:18:54 +09:00
Chalard Jean
d90d6457fb Fix: ConnectivityManager methods crashing with SecurityException
Starting in R, some methods in ConnectivityManager like
getNetworkCapabilities started passing the package name from
the context stored in CM to check that the package is really
whom it pretends to be. Unfortunately, in some cases, the
context contains package "android" for an app, and since the
app is not the system, the check fails and crashes the app.

It seems the culprit is updateHttpProxy, which is called by
ProcessList when the PROXY_CHANGE_ACTION broadcast is sent.
If this happens to run between the time the process is created
and the activity thread is "bound", then the mInitialApplication
member is not set, and updateHttpProxy uses a system context.
Since ConnectivityManager caches the context forever in a
static, this leads to subsequent legitimate calls crashing.

Setting the proxy can be deffered until such a time that the
app is bound, as it can't run any code before then. The member
is never reset to null, so it's guaranteed to be non-null at
bind time.

An alternative would be to post a runnable on the handler
thread if the member is null to try again later. This
could however run the lambda a considerable number of times
as binding can be delayed, and risks causing an infinite loop
if some invariants are changed in the future.

See also b/73572062 and ag/4056059

Bug: 155549446
Bug: 189360509
Test: ActivityThreadTest FrameworksNetTests NetworkStackTests
Test: Manually set a proxy, observe the broadcast being sent and
      apps not crashing
Change-Id: I956f76be2e0a1a675576511fb394d7ed4354b28a
(cherry picked from commit b0d13e29515d5b7c82daed7533b78ac57e46bd93)
2021-07-29 11:55:37 +09:00
Rubin Xu
d8c6203bec Merge "Stop managed profile owner granting READ_SMS" into sc-dev am: 28e4c5d57a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15371691

Change-Id: I352548279c31d182ff5bfb8c3fb4da41ddf53fb0
2021-07-27 09:05:46 +00:00
Rubin Xu
28e4c5d57a Merge "Stop managed profile owner granting READ_SMS" into sc-dev 2021-07-27 08:51:15 +00:00
Ahaan Ugale
4f6a71d59f Merge "Copy ContentCaptureOptions into derived Contexts" into sc-dev am: 2db19f5679
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15352571

Change-Id: If8d3b4b95a9cdb345dc3322257e06e7b8bf522ce
2021-07-24 01:24:05 +00:00
Ahaan Ugale
2db19f5679 Merge "Copy ContentCaptureOptions into derived Contexts" into sc-dev 2021-07-24 01:18:17 +00:00
Alex Johnston
7f632dca95 Stop managed profile owner granting READ_SMS
Reason: There is only one telephony stack shared
between the personal and work profile.

Bug: 194382185
Bug: 189942529
Test: atest com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testGrantOfSensorsRelatedPermissions
      atest com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testDenyOfSensorsRelatedPermissions
      atest com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testSensorsRelatedPermissionsNotGrantedViaPolicy
      atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testGrantOfSensorsRelatedPermissions
      atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testDenyOfSensorsRelatedPermissions
      atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testSensorsRelatedPermissionsNotGrantedViaPolicy
Change-Id: I99384d5713bb2d04f5b6fbe20c17bd72a39b57d7
2021-07-23 17:05:21 +01:00
Ahaan Ugale
0cfcde8d5e Copy ContentCaptureOptions into derived Contexts
When a new Context is created from the Activity Context and used to
inflate views, Content Capture is disabled for those views because the
new Context is missing ContentCaptureOptions.

Fix: 194321297
Test: atest CtsContentCaptureServiceTestCases
Test: manual - view appeared events come through
Change-Id: I934d41953c7668e371d5961b66187ecd15408e3e
2021-07-23 03:24:42 +00:00
TreeHugger Robot
2194851f5c Merge changes from topic "native_hint" into sc-dev am: ea52c87596
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15326475

Change-Id: I8dde7d37c30d756108b007dd0cf09de057f4b913
2021-07-22 21:33:26 +00:00
Bo Liu
0b2ad9f70d Implement java PerformanceHintManager on top of native
Note some exceptions became silence errors in this conversion.

Test: None
Bug: 194204196
Change-Id: Ia3cc7f2396f2e307a23b40b3f104a2fa90352196
2021-07-22 11:33:13 -04:00
Evan Severson
7c7767b7f3 Merge "Don't block intent if op is restricted due to toggles" into sc-dev am: 2b11e7f25c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15245178

Change-Id: Ibf7903f07a6ec6930652d97b29397b2648eda6a6
2021-07-21 17:26:04 +00:00
Evan Severson
2b11e7f25c Merge "Don't block intent if op is restricted due to toggles" into sc-dev 2021-07-21 17:10:21 +00:00
Evan Severson
7b6d643171 Don't block intent if op is restricted due to toggles
Test: Create sdk 22 and 30 test apps and use the MEDIASTORE intents
Bug: 192635623
Change-Id: I250a5e398e72919ec8217e87b76273082e781f63
2021-07-21 08:37:00 -07:00
Shuo Qian
5dbbd226ae Merge "Change the doc to reflect the default status of preferential network service" into sc-dev am: c03fb15e29
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15329706

Change-Id: Ia7c2fe2f8b3eaba0bf1445d4edfb29e237770ca0
2021-07-20 16:59:56 +00:00