Commit Graph

23169 Commits

Author SHA1 Message Date
Julia Reynolds
d6090a038a Make notification getParcelable usages safer
Test: SystemUITests, CtsAppTestCases
Fixes: 198825327
Change-Id: I7a4868a56bc2c9a69d2fb1eae5d53faa3c9dede0
2022-04-15 12:38:27 +00:00
Wu Ahan
2f056bb150 Merge "DO NOT MERGE: Don't do heavy operation while in the synchronized block" into tm-dev 2022-04-15 10:49:21 +00:00
Wei Sheng Shih
2aac68104f Merge "Clear the system bars color when removing the splash screen window." into tm-dev 2022-04-15 02:18:23 +00:00
Rubin Xu
5f50853cfb Merge "devicepolicy: fix javadoc typo" into tm-dev 2022-04-13 20:28:13 +00:00
Julia Reynolds
35a4d73544 Merge "Update FLAG_ONLY_ALERT_ONCE docs" am: e3a1682e0b am: bd0f7d47eb am: cd2f1c2a9c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2062847

Change-Id: I16be1f26ff7eee520901f7ac149232ca2048328b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-13 20:10:12 +00:00
Julia Reynolds
cd2f1c2a9c Merge "Update FLAG_ONLY_ALERT_ONCE docs" am: e3a1682e0b am: bd0f7d47eb
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2062847

Change-Id: I535584d91df8b54026a2af0c78b03a0bfb3da4af
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-13 19:49:54 +00:00
Julia Reynolds
bd0f7d47eb Merge "Update FLAG_ONLY_ALERT_ONCE docs" am: e3a1682e0b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2062847

Change-Id: I46beb5247898976a891faccd62f2464efb7c5b58
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-13 19:34:08 +00:00
Julia Reynolds
e3a1682e0b Merge "Update FLAG_ONLY_ALERT_ONCE docs" 2022-04-13 19:02:02 +00:00
Kholoud Mohamed
a9448a6772 Merge "Respect style when source is also set" into tm-dev 2022-04-13 16:06:46 +00:00
Julia Reynolds
f8e0fd5fe7 Merge "Allow registered call notifications to always appear" into tm-dev 2022-04-13 13:06:47 +00:00
Rubin Xu
f8bcf01a09 devicepolicy: fix javadoc typo
Fix: 229080555
Test: none
Change-Id: I6ce2ed9a067d35436d107181fe732a5bd6b35583
2022-04-13 13:47:13 +01:00
kholoud mohamed
06a85bdb26 Respect style when source is also set
Fixes: 214576716
Test: atest android.devicepolicy.cts.DevicePolicyResourcesTests
Change-Id: I82ac3fa837232c3a6d7d51c8c41e5e851aa2366d
2022-04-13 12:44:54 +00:00
Edward Savage-Jones
1a90fd5998 Update FLAG_ONLY_ALERT_ONCE docs
Update FLAG_ONLY_ALERT_ONCE docs to match implementation
from Android P and onwards.

Bug: 222328375
Test: atest BuzzBeepBlinkTest
Change-Id: Ic058b8265551362b04b9cd0363e43a4c08ecd736
2022-04-13 08:35:38 +00:00
Ahan Wu
52d63e7e4c DO NOT MERGE: Don't do heavy operation while in the synchronized block
We read the wallpaper within the synchronized block, this is a long time
operation, might block the other thread who is going to obtain the lock.
So we have to move the operation beyond the synchronized block.

Bug: 228435216
Test: atest WallpaperManagerTest#testPeekWallpaperNotBlockingOtherThread
Change-Id: Ic2a947b473710ffe68db436586769858950588a4
2022-04-13 04:02:27 +00:00
Sudheer Shanka
86ef571dab Fix the @RequiresPermission annotation.
We initially were using PACKAGE_USAGE_STATS permission to guard
the API BroadcastOptions.recordResponseEventWhileInBackground()
but changed it's implementation to use the new
ACCESS_BROADCAST_RESPONSE_STATS permission later but didn't update
the annotation to specify the new permission.

Bug: 228894230
Test: treehugger
Change-Id: I5142e2d2f754e8014c0c291d56b5ec2254449e77
2022-04-12 15:34:16 +00:00
Jernej Virag
93599ecf92 Merge "Downscale oversized MessagingStyle avatars" into tm-dev 2022-04-12 15:33:38 +00:00
Lee Shombert
ead48cc667 Merge "Helper classes for IpcDataCache clients" into tm-dev 2022-04-12 14:32:31 +00:00
Jernej Virag
3405f17fe4 Downscale oversized MessagingStyle avatars
Notification API downscales oversized icons in all formats except in MessagingStyle. This seems to be an oversight that can cause massive memory usage.
This downscales avatars to a reasonable size if they're too big.

Bug:193720474
Bug:221890932

Test: atest NotificationTest
      Built a test app with 4000x4000 avatar icon.
      Memory usage went from 250MB to ~170KB per notification.
Change-Id: I35377cdb5d61ee6e23fccc2bffb5d3aec6ca2b7d
2022-04-12 10:58:33 +00:00
Julia Reynolds
20a47d5ed0 Allow registered call notifications to always appear
Even if the app's notifications are disabled.

Test: NotificationManagerServiceTest
Test: NotificationInfoTest
Test: manually call device
Fixes: 227456870
Change-Id: Ib218e57d585a6066ddbc713d2d3a8445ac959ad2
2022-04-11 18:01:48 -04:00
Lee Shombert
529a49ee3d Helper classes for IpcDataCache clients
Bug: 227653108

This adds a helper class that can reduce much of the boilerplate in
code that uses IpcDataCache (or the internal-only variant,
PropertyInvalidatedCache).  See the changes to DevicePolicyManager for
example usage.

Two PropertyInvalidatedCaches APIs are exposed for testing.  The
method createPropertyName() is changed so that apis like "Foo" are
converted to "foo", not "_foo".

Unit tests for the new behavior are added to IpcDataCacheTest.

This was manually tested by dumping the cache info from builds with
and without this change.  Special attention is paid to the
DevicePolicyManager caches.  The same caches were found (as identified
by their key and api) and the caches were enabled/disabled the same.

In the course of testing, multiple instances of DevicePolicyManager
caches were observed.  Cache performance is better if the caches are
static; making them static will be addressed in b/228452829.

Test:
 * atest FrameworksCoreTests:IpcDataCacheTest
 * atest FrameworksCoreTests:PropertyInvalidatedCacheTests
 * atest FrameworksServicesTests:DevicePolicyConstantsTest
 * atest FrameworksServicesTests:DevicePolicyEventLoggerTest
 * atest FrameworksServicesTests:DevicePolicyManagerServiceMigrationTest
 * atest FrameworksServicesTests:DevicePolicyManagerTest
 * atest FrameworksServicesTests:EnterpriseSpecificIdCalculatorTest
 * atest FrameworksServicesTests:OverlayPackagesProviderTest
 * atest FrameworksServicesTests:OwnersTest
 * atest FrameworksServicesTests:PolicyVersionUpgraderTest
 * atest FrameworksServicesTests:SecurityEventTest
 * atest FrameworksServicesTests:SystemUpdatePolicyTest
 * atest FrameworksServicesTests:TransferOwnershipMetadataManagerTest
 * atest MixedDeviceOwnerTest#testIsDeviceOrganizationOwnedWithManagedProfile
 * atest MixedDeviceOwnerTest#testSetKeyguardDisabledFeatures
 * atest MixedManagedProfileOwnerTest#testIsDeviceOrganizationOwnedWithManagedProfile
 * atest MixedManagedProfileOwnerTest#testNetworkLoggingDelegate
 * atest MixedManagedProfileOwnerTest#testSetKeyguardDisabledFeatures
 * atest OrgOwnedProfileOwnerTest#testIsDeviceOrganizationOwnedWithManagedProfile
 * atest OrgOwnedProfileOwnerTest#testNetworkLoggingDelegate
 * atest OrgOwnedProfileOwnerTest#testSetKeyguardDisabledFeatures
 * atest android.devicepolicy.cts.DevicePolicyManagerTest
 * atest android.devicepolicy.cts.NetworkLoggingTest
 * atest com.android.cts.devicepolicy.DeviceOwnerTest#testAdminActionBookkeeping

Change-Id: I2f4fe4ed25db5fb3100334b9d2ce748ee928c10d
2022-04-11 07:27:16 -07:00
Ankita Vyas
722c06c14d Merge "Move LocaleManagerTests to presubmit suite." into tm-dev 2022-04-11 12:22:29 +00:00
Sudheer Shanka
ffa1d57dae Inform Application thread to block for network rules to be updated.
Bug: 226299593
Test: atest tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Change-Id: Ie37173d0d3f4034a74b834550920530166cd4201
2022-04-09 22:39:12 +00:00
Sudheer Shanka
6889563b7e Merge "Inform AMS about the uid blocked reasons." into tm-dev 2022-04-09 05:13:36 +00:00
Joanne Chung
5ed1be6c4c Merge "Disable these four test cases of HotwordDetectionServiceBasicTest" into tm-dev 2022-04-09 01:47:43 +00:00
Sudheer Shanka
73380fec52 Inform AMS about the uid blocked reasons.
This will be used to let the application thread
know whether or not to block for network rules to
be updated when coming to the foreground.

Bug: 226299593
Test: atest tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Change-Id: I9bff481a0026fb57af8dbee580e617c8410f9ebe
2022-04-08 13:45:54 -07:00
Prabir Pradhan
6b3c6cae3f Revert "Change input injection security model to require INJECT_..."
Revert "Update WindowInputTests after changing injection permiss..."

Revert "Change input injection security model to require INJECT_..."

Revert submission 17125748-require-inject-events-permission

Reason for revert: b/228203157, b/228194124, b/228583652
Reverted Changes:
Ib0d66eff3:Change input injection security model to require I...
Ief1a2f10c:Update WindowInputTests after changing injection p...
Ie2d8d0c3d:Change input injection security model to require I...

Change-Id: I4e77238f00ccd6379486ba77613430fbf166821c
2022-04-08 17:49:17 +00:00
Joanne Chung
d9e3762e33 Disable these four test cases of HotwordDetectionServiceBasicTest
We disable these four test cases temporarily from presubmit.
We will add back after fixing test fail.

Bug: 225076204
Test: atest CtsVoiceInteractionTestCases

Change-Id: I0cdc92cb37db305df75947502e3569bfc38795a3
2022-04-09 00:05:36 +08:00
Prabir Pradhan
8e03ce9a9d Instrumentation: Wait for finish when injecting pointer events
The input injection mode for pointer events in sendPointerSync() was
accidentally changed to WAIT_FOR_RESULT instead of WAIT_FOR_FINISH in
ag/17506923, causing test failures. Change it back to WAIT_FOR_FINISH.

Bug: 228203157
Bug: 228201593
Test: atest HoverTest
Change-Id: I2d3a77621290509d5be6279ee450e1881bd9d84d
2022-04-08 13:05:12 +00:00
“Ankita
0d0e240533 Move LocaleManagerTests to presubmit suite.
Bug: 225192026
Test: atest CtsLocaleManagerTestCases
Change-Id: Iee7ad378a3d707a2d29100863164e2b9a53ec312
2022-04-08 11:53:10 +00:00
Ricky Wai
417df3f1e9 Merge "Add hidden flag in ActivityOptions to ignore PendingIntent creator foreground state" into tm-dev 2022-04-08 11:13:22 +00:00
Prabir Pradhan
605556d50e Merge "Remove exception for injecting pointer event from sendTrackballEventSync" into tm-dev 2022-04-06 14:36:57 +00:00
Antoan Angelov
42121eea73 Merge "Update javadoc for role holder updater action" into tm-dev 2022-04-05 18:57:50 +00:00
Shivam Agrawal
87550b067a Merge changes from topic "embedding-race-condition" into tm-dev
* changes:
  Send Split Info Callback before Activity#onCreate
  Revert "Removing TaskFragment token from LaunchActivityItem"
2022-04-05 18:36:49 +00:00
Prabir Pradhan
be382c32b3 Remove exception for injecting pointer event from sendTrackballEventSync
Starting from T, a MotionEvent's default source is SOURCE_CLASS_POINTER.
This means injecting a newly obtained MotionEvent into
sendTrackballEventSync would cause the exception to be triggered.

Adding such an exception doesn't make sense in T, since it adds the
additional precondition to sendTrackballEventSync that the MotionEvent's
source must correctly configured. This precondition did not exist before,
so we remove the exception.

Bug: 228194124
Test: atest android.app.cts.DialogTest
Change-Id: I039e30e6c768ce11c64d077d20373da12f27b72f
2022-04-05 18:04:40 +00:00
Jonathan Scott
58bbfc4167 [automerge] [scv2] RESTRICT AUTOMERGE Add finalizeWorkProfileProvisioning. 2p: b157e658a7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17567140

Bug: 210469972
Change-Id: I19e3b76e9289c9b0709c3c1584bbb93f008913f5
2022-04-05 12:55:43 +00:00
Jonathan Scott
b157e658a7 [scv2] RESTRICT AUTOMERGE Add finalizeWorkProfileProvisioning.
Test: atest android.devicepolicy.cts.DevicePolicyManagerTest
Bug: 210469972
Change-Id: I1ea926194992cbce26e2245fec0e563b3010a02f
2022-04-05 12:55:36 +00:00
Jing Ji
e1eb2bf9a3 Merge "Add a parameter to the internal FGS notification listener" into tm-dev 2022-04-05 11:31:12 +00:00
Jing Ji
3d57c22c0e Add a parameter to the internal FGS notification listener
Don't use the notification ID to determine if it's being
canceled or not.

Bug: 203105544
Test: atest FrameworksMockingServicesTests:BackgroundRestrictionTest
Change-Id: I0ddcb7de57800c5f8b69100353ba7f71157a5448
2022-04-04 19:50:51 -07:00
Prabir Pradhan
edff385132 Change input injection security model to require INJECT_EVENTS permission
Previously, any app could inject input events into the system via the
IInputManager#injectInputEvent API. The injection was only allowed if
the input event targeted a window owned by the same UID as that of the
process calling the API. This had drawbacks metioned in the bug.

Here, we change the input injection security model so that the signature
permission INJECT_EVENTS is required to inject events. This permission
is given to the system and the shell, so input injection can still be
done through the 'adb shell input' command. We also allow injection from
instrumeted processes where the instrumentation source has the
permission. For exmaple, running a test from the shell allows for the
test to inject events.

We also add support for a targeted injection mode, where the input
injection succeeds only if the target window for the event is owned by
the provided UID. This allows us to support injection from the
Instrumentation class, which only allows for injection into windows
owned by the same UID. In contrast to this, injection from the
UiAutomation class will target all windows, including system and spy
windows.

Bug: 207667844
Bug: 194952792
Test: atest inputflinger_tests
Test: atest WindowInputTests
Test: manual with test app: app cannot inject navigation gestures
Change-Id: Ib0d66eff3fc2f061e7c0d3b7e139a841a9bcebc7
2022-04-04 19:22:51 +00:00
Sudheer Shanka
ec157586d7 Merge "Inform NPMS about the app coming to the TOP state early." into tm-dev 2022-04-04 09:56:02 +00:00
Shan Huang
69a3984aae Remove OnBackInvokedDispatcherOwner interface.
Test: m -j update-api. Build and flash and test back behavior throughout
the system.
Bug: 227500290

Change-Id: Ibdb13d02e044741d05d99f1cad96e43dc0129fe4
2022-04-01 20:27:34 +00:00
Vadim Caen
d0923a2197 Merge "Split animation methods out of OnBackInvokedCallback" into tm-dev 2022-04-01 20:13:30 +00:00
Vadim Caen
c627777dda Split animation methods out of OnBackInvokedCallback
This makes OnBackInvokedCallback SAM compatible

Bug: 227789359
Test: atest \
        CtsWindowManagerDeviceTestCases:android.server.wm.BackNavigationLegacyTest \
        CtsWindowManagerDeviceTestCases:android.server.wm.BackNavigationTests \
        WmTests:com.android.server.wm.BackNavigationControllerTests \
        FrameworksCoreTests:android.window.BackNavigationTest \
        FrameworksCoreTests:android.window.WindowOnBackInvokedDispatcherTest \
        CtsViewTestCases:android.view.cts.OnBackInvokedDispatcherTest
Change-Id: Iab86b0488f1b3048eb02042191acaeb6a645a0bc
2022-04-01 20:09:26 +00:00
Prabir Pradhan
baf0f20718 Merge "Remove injectInputAfterTransactionsApplied from WMS" into tm-dev 2022-04-01 19:39:15 +00:00
arangelov
7507f95d65 Update javadoc for role holder updater action
Bug: 226414338
Test: none
Change-Id: Ica161a71df9b8ba85bb8c120ca2e614ae21b9820
2022-04-01 19:06:55 +01:00
Ricky Wai
b8a05514f7 Add hidden flag in ActivityOptions to ignore PendingIntent creator foreground state
Bug: 227431919
Test: atest BackgroundActivityLaunchTest
Change-Id: I7192f65e747e6048d3a26ecb203767290fa5406e
2022-04-01 13:57:20 +00:00
Jim Blackler
a4dd0499bd Merge "Add loading boost intervention for games." into tm-dev 2022-04-01 09:39:44 +00:00
wilsonshih
d92645873e Clear the system bars color when removing the splash screen window.
There can reset the system bars color once the splash screen window is
going to be removed, so the real system bars color can be
controlled by app, without waiting for the reveal animation.
Also clear this effect when transfer splash screen to client, so client
can control the color on their own.

Bug: 196550450
Test: verify no status bar color changed when playing reveal animation.
Change-Id: Ibb353d350fa2921188c8c4b54f8e029ee3869c16
2022-04-01 13:39:51 +08:00
Sudheer Shanka
e69f7fdbb6 Inform NPMS about the app coming to the TOP state early.
It's possible for an app to come to the TOP state before
the oomAdj computation is done and we cannot wait for
oomAdj computation to complete and then inform NPMS about
the state change. So, inform NPMS early about the state
change when we know the app is going to the TOP state.

Bug: 226299593
Test: atest tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Change-Id: I5d582618652cead179c419f7fe084283dd89d514
2022-03-31 19:51:55 -07:00
jimblackler
ac10e4a396 Add loading boost intervention for games.
Bug: 207845905
Test: atest com.android.server.app.GameManagerServiceTests
Change-Id: I2d0b4988797fe21bd7aec6d5351273757ae1a3ce
2022-03-31 20:38:29 +00:00