Commit Graph

22464 Commits

Author SHA1 Message Date
kholoud mohamed
85316ade7d Send broadcast when a device policy resource is updated
Bug: 188410712
Bug: 203548565
Test: manual
Change-Id: Icad44019c3fd2691969eaaf6b518d2ddfb91d133
2022-01-18 11:01:25 +00:00
kholoud mohamed
3b378b1f47 Add APIs to allow updating enterprise related drawables
Add APIs to update and retrieve enterprise-related system drawables,
the APIs are guarded by a new permission that will be granted to the new
device management role holder.

Bug: 203548565
Bug: 188410712
Test: manual
Change-Id: Iab29db23a87e1481ba7e2996a704dcb2702444be
2022-01-18 11:01:13 +00:00
TreeHugger Robot
ea85bfc929 Merge "Fix IME shrunk by WindowTokenClient mis-detach" into sc-v2-dev am: ff6577fd10 am: 4b30a3ee91
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16598426

Change-Id: I7c73497ab7770240e8aadc96c3ef64e5c219cf75
2022-01-15 04:57:51 +00:00
TreeHugger Robot
4b30a3ee91 Merge "Fix IME shrunk by WindowTokenClient mis-detach" into sc-v2-dev am: ff6577fd10
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16598426

Change-Id: I2e7b34abfe7769160c383a0774cf3bb9635c46e2
2022-01-15 04:39:36 +00:00
TreeHugger Robot
ff6577fd10 Merge "Fix IME shrunk by WindowTokenClient mis-detach" into sc-v2-dev 2022-01-15 04:27:54 +00:00
Mady Mellor
877da241b4 Merge "Add hasSentValidBubble to NotificationManagerService" 2022-01-14 17:58:50 +00:00
Felipe Leme
07cf25574b Merge "Creates a generic mechanism to dump app-side information." 2022-01-14 17:43:28 +00:00
Ming-Shin Lu
29de30597b Fix IME shrunk by WindowTokenClient mis-detach
As CL[1] introduced WindowTokenClient for WindowProviderService (aka the
parent class of InputMethodService starts from CL[2]) as a token that
IME context can associate with the windowContainer of
the InputMethod window in server side. Like the activity context,
IME context can adopt configuration/resources update when the IME
window changed by display/window changes.

And, the IME context caller can also create another type of context
with wrapping IME context (i.e. calling createDisplayContext to create
a display context), that makes this context can be mixed the window
token of WindowProviderService since it's the base context.

However, the finalization of the context mixed WindowTokenClient
will detach the token when the attached context type is non-window
context, this action will mis-detach the token when it managed by
WindowProviderService.

So like SoftKeyboard previously using
createDisplayContext in CL[3] to workaround context resources issues,
will in-directly expose this mis-detach token issue as the above.

Beside, the handling of WindowTokenClient#{onConfigurationChange,
onWindowTokenRemoved} does not thread-safe since this is called from
IPC.

As the result, the fix is to ignore the check in ContextImpl#finalize
to not detach the token when it managed by WindowProviderService,
also make sure to post to the main handler when received
onConfigurationChanged/onWindowTokenRemoved in WindowTokenClient.

Note that this fix could help to resolve "The Window Context should
have been attached to a DisplayArea." exception if the token has been
detached as the above case that happens before the next
WindowProviderService#attachToWindowToken invoked.

[1]: I64a1614f32d097785915f6105b1813a929e0fe32
[2]: Ie565e30ed5dd3f2cfe27355a6dded76dc3adc14b
[3]: Ic592a1d2fb2da149220c8b503b522b3e864bcc77

Bug: 213118079
Bug: 211062619
Test: manual as steps:
1) adb install -r EditTextVariations.apk
2) adb install -r SoftKeyboard.apk
3) adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard
4) adb shell ime set com.example.android.softkeyboard/.SoftKeyboard5
5) Enable screen auto-rotation
6) Launch EditTextVariations from launcher's shortcut
7) Tap the first EditText field to show IME
8) Rotate the device to the landscape mode
9) Expect the IME should not be shrunk

Change-Id: I7beb7a122af93e596239a36db62073233cea0726
2022-01-14 12:49:13 +00:00
Mariia Sandrikova
a274e1a7d4 DO NOT MERGE Revert "[2/n] Camera Compat UI: Add interfaces for client-server..." am: 7617679a61
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16571392

Change-Id: I0adf2bf45c5f7d7349e9c0f180aea9d10f70645d
2022-01-13 22:55:51 +00:00
TreeHugger Robot
48b60587c6 Merge "Add @RequiresPermission for LAUNCH_DEVICE_MANAGER_SETUP" 2022-01-13 22:09:24 +00:00
Felipe Leme
bcafba3a1f Creates a generic mechanism to dump app-side information.
Currently, 'dumpsys activity' can dump the state of some managers:
 - AutofillManager
 - ContentCapturemaanger
 - UiTranslationController

But the support for these custom dumping is hardcoded into
Activity itself, which makes it harder to extend. For example,
automotive builds provide an app-side Car object, which currently
cannot be dumped.

This CL makes the mechanism more flexible by providing a couple new
public / SystemAPIs that let Automotive (or other mainline modules)
extend it.

Examples:

$ adb shell dumpsys activity com.android.car.carlauncher/.CarLauncher --list-dumpables
$ adb shell dumpsys activity com.android.car.carlauncher/.CarLauncher --dump-dumpable CarUserManager
$ adb shell dumpsys activity service com.android.systemui/.SystemUIService CarUserManager

NOTE: this CL only adds the new APIs; a follow-up CL will change the
existing managers to use them.

Test: see above
Test: m update-api

Bug: 149254050
CTS-Coverage-Bug: 149254050

Change-Id: I6920ff3542d3d75edd667c2c7658e9d0a7af534f
2022-01-13 11:43:13 -08:00
Mady Mellor
8646e2c02c Add hasSentValidBubble to NotificationManagerService
If apps have conversations but not bubbles, we still show bubble settings
for them which is confusing for users. This change exposes whether an app
has sent a notification with valid bubble metadata, this allows us to hide
the setting until a bubble is actually sent.

If the app directs the user to bubble settings via the public intent,
they are still available.

Test: atest PreferencesHelper
Bug: 178387292
Change-Id: I7d3d92df49e7f4ed1d2c05cbba5f6f7786789d32
2022-01-13 10:40:48 -08:00
Erin Yan
86f682fd2f Merge "Add weak escrow token APIs" 2022-01-13 18:25:37 +00:00
Mariia Sandrikova
7617679a61 DO NOT MERGE Revert "[2/n] Camera Compat UI: Add interfaces for client-server..."
Revert submission 16468379

Reason for revert: Feature development is moving to T.

Reverted Changes:
Id9b9a8930:[3/n] Camera Compat UI: Add a camera compat contro...
Id6be4a954:Enable a camera app compat control on Large screen...
I083aa6718:[2/n] Camera Compat UI: Add interfaces for client-...

Bug: 206602997

Change-Id: I9ad876043fd61f708a8f468fffd1ef371bfa0866
2022-01-13 15:21:38 +00:00
bsears
6daef580f7 Merge "Add checks to detect wrong conditions when creating Applications" 2022-01-13 06:40:23 +00:00
TreeHugger Robot
0c38295c7a Merge "Address BroadcastOption API feedback" 2022-01-13 03:00:42 +00:00
Ashwini Oruganti
776b439703 Merge "Revert "Migrate unsafe parcel APIs in framework-minus-apex"" 2022-01-12 23:07:08 +00:00
Makoto Onuki
9b9ee9dc4b Add checks to detect wrong conditions when creating Applications
Bug: 185177290
Test: Boot + monitor logcat
Change-Id: Icd9f5e891c7b7fe32ee4144d95dd26139b87d9cf
2022-01-12 14:23:40 -08:00
Erin Yan
459f61152e Add weak escrow token APIs
Bug: 206485383
Test: atest LockPatternUtilsTest WeakEscrowTokenTests
Change-Id: I24cdf9af6c8f29db03ef214a1a0f8effad394264
2022-01-12 21:59:10 +00:00
Thomas Vannet
4c09f45a59 Merge "Add self revocation public API" 2022-01-12 21:44:32 +00:00
Antoan Angelov
5018db2046 Merge "Add intent extra for a custom consent screen intent" 2022-01-12 18:30:41 +00:00
Bernardo Rufino
331be9a643 Revert "Migrate unsafe parcel APIs in framework-minus-apex"
This reverts commit 90bb3709dc.

Reason for revert: b/214053959

Change-Id: Ic271bab1d3eaf677a5989dda9deb944ee2ad6850
2022-01-12 17:44:44 +00:00
TreeHugger Robot
458af9aa66 Merge "Fix NPE in onTrustError method" 2022-01-12 15:06:26 +00:00
xshu
3f964a8d67 Address BroadcastOption API feedback
Clarify that both null and empty list can be used to clear the
previously set value.

Bug: 214105366
Test: compile
Change-Id: Ic6aaedf655b64c78d2d07dc00177911c08a8e7e9
2022-01-11 18:52:03 -08:00
Louis Chang
8ab93641bb Merge "Allow requesting start-activity-permission-token for an activity" 2022-01-12 01:04:34 +00:00
Thomas Vannet
af615e7baf Add self revocation public API
Test: Manual test using a non-privileged app, atest
android.permission.cts.SelfRevokeRuntimePermissionTest

When calling the API, the permission (along with any other permissions
from the same group) for the current package is downgraded to a one-time
permission, and a one-time permission session is started.

Bug: 210387494

Change-Id: I9f061cbc8c3db720127c96200fe94a644246b6d7
2022-01-11 16:32:40 -08:00
Beverly
2094f4d89e Fix NPE in onTrustError method
Test: manual
Fixes: 213630529
Change-Id: I57fb3a4a0e8a90a35534633e233ae374ad69fffa
2022-01-11 14:12:20 -05:00
arangelov
a725709b7e Add @RequiresPermission for LAUNCH_DEVICE_MANAGER_SETUP
Fixes: 208628038
Test: compiled
Change-Id: Ia4a154659482685286140699d22a0d0ad475cc5d
2022-01-11 13:22:34 +00:00
arangelov
e4c8022508 Add intent extra for a custom consent screen intent
Bug: 210004718
Test: compiled
Change-Id: Ibc5e60561923efe0f6f8b3139fc2b9d3aa58737c
2022-01-11 13:08:59 +00:00
Xiaowen Lei
2146a59ccb Merge "Clean up Communal Manager READ_COMMUNAL_STATE APIs." 2022-01-10 19:43:23 +00:00
Wei Sheng Shih
f04fc04111 Merge "Fix transfer splash screen view been called twice from onDraw" into sc-v2-dev am: 0c6450141f am: 494706d9c2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16561482

Change-Id: I509b68c9fb28ec6a0611a87e3667210c0389f9fa
2022-01-10 17:17:42 +00:00
Wei Sheng Shih
494706d9c2 Merge "Fix transfer splash screen view been called twice from onDraw" into sc-v2-dev am: 0c6450141f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16561482

Change-Id: If8a3b2bddc7583da65673258ae2fe1c64ab840a2
2022-01-10 17:02:47 +00:00
wilsonshih
4ee97aa498 Fix transfer splash screen view been called twice from onDraw
postOnAnimation is not robust enough from remove the onDrawListener
before next traversal, add a flag to to ensure that transfer splash
screen view only been called once.

Bug: 204125440
Test: atest SplashscreenTests
Test: verify SplashScreenTests and SplashscreenParametrizedTest pass
Change-Id: Id0e6d57b901b2dae45f5aa77e5571f9cf81b6e29
2022-01-10 18:23:20 +08:00
TreeHugger Robot
c28db7a673 Merge "Do not trigger a disk write violation during dumpsys gfxinfo" 2022-01-07 23:32:16 +00:00
Makoto Onuki
7bea563b87 Do not trigger a disk write violation during dumpsys gfxinfo
Writing to a pipe FD here is okay because it doesn't write to
the physical disk.

Bug: 203682422
Test: dumpsys gfxinfo
Change-Id: Ibb484f0d466d13e55d2c8059a5af964641281110
2022-01-07 10:18:00 -08:00
Minche Li
6c257f32e1 Merge "Notifies window magnifcation changes for AccessibilityService (1/n)" 2022-01-07 01:00:27 +00:00
Xiaowen Lei
8b438be8e4 Clean up Communal Manager READ_COMMUNAL_STATE APIs.
These are not yet used, and are obsolete now because We will no longer
be shipping SLS in T.

Ignore-AOSP-First: tied to launch of new upcoming hardware.

Test: atest FrameworksMockingServicesTests:CommunalManagerServiceTest

Bug: 206054365
Change-Id: I51ffbfe5ddc89008d660fab7cfd5808cb827d300
2022-01-07 00:18:35 +00:00
TreeHugger Robot
496f60250d Merge "Revert "Adding client side logging for receivers."" 2022-01-07 00:08:48 +00:00
Lee Shombert
9a686c07ba Merge "Prepare PropertyInvalidatedCache for SystemApi" 2022-01-06 23:14:05 +00:00
Jacob Hobbie
e9482d775f Revert "Adding client side logging for receivers."
This reverts commit 2c34dcd956.

Reason for revert: Not WAI, logging on user-debug builds (not just eng) and not logging across the binder appropriately

Droidfood blocking bug:213406883

Change-Id: Ifff533d280cce22fbf877dd265e4910ab9230943
2022-01-06 19:36:33 +00:00
TreeHugger Robot
bd4a9f5806 Merge "Cleanup communal mode shared app logic." 2022-01-06 17:36:26 +00:00
Pat Manning
5f66d30856 Merge "Create API to set taskbar to kids mode." 2022-01-06 17:26:05 +00:00
Wei Sheng Shih
82cf9d7a4a Merge "Public API set and get splashscreen style" 2022-01-06 05:25:33 +00:00
Louis Chang
47cf5f22bb Allow requesting start-activity-permission-token for an activity
The permission token was required to be requested from an existing
activity. Since the token is delegated to another activity, the
activity that requested the token had to keep alive and finish itself
until the token is revoked.

Changing the behavior to allow the caller to request the permission
token for a particular component as long as the caller is running in
System uid (which not necessarily to be an Activity).

This also prevents having an additional trampoline activity launched.

Bug: 199743918
Test: locally tested
Change-Id: If3e55032bb99d98a446e4c30220555b0fbc0c6f7
2022-01-06 10:53:45 +08:00
Jacob Hobbie
0bd7594ce8 Merge "Adding client side logging for receivers." 2022-01-05 17:47:53 +00:00
Lucas Silva
70303b058f Cleanup communal mode shared app logic.
We will no longer be shipping shared apps in Android T

Test: atest CommunalManagerServiceTest
Test: locally on device
Bug: 211633044
Change-Id: I96ff51f1e10801722dd74de110f5c2caacf0d8d3
2022-01-05 15:18:52 +00:00
Pat Manning
8ffa58cdea Create API to set taskbar to kids mode.
- Disables recents in taskbar.
- Changes back and home icons and centers them in the taskbar.

Test: manual
Bug: 203749295
Change-Id: I9aa2a213728549509da4cf7f50abceb690ba31cf
2022-01-05 11:35:41 +00:00
Lee Shombert
0cece3898b Prepare PropertyInvalidatedCache for SystemApi
Bug: 152453213
Tag: #refactor

This commit prepares PropertyInvalidatedCache to function as a system
api.  Specifically, the methods recompute() and bypass() which may be
overridden by clients are now public (instead of protected).  This
forces an update to all existing clients, to accommodate the change in
method visibility.

Two small changes have been made as cleanup:

 1. The awkwardly named debugCompareQueryResults() is now
    resultEquals(), which is more or less consistent with how other
    equality tests are named in Android.  This name change affects two
    clients.

 2. PackageManager has changed to use resultEquals() instead of
    maybeCheckConsistency().  This provides a simpler and more
    consistent use of the APIs.  maybeCheckConsistency() has been made
    private.

Test: atest PropertyInvalidatedCacheTests

Change-Id: I4110f8e887a4fd8c784141e8892557a9d1b80a94
2022-01-04 08:13:59 -08:00
wilsonshih
bf666289d7 Public API set and get splashscreen style
Allow developer to control the splash screen style when the option is
used for cold or warm launch an activity.

Bug: 203497083
Test: atest SplashscreenTests#testLaunchFromLauncherWithEmptyIconOptions
Test: atest SplashscreenTests#testLaunchAppWithIconOptions

Change-Id: I9c4ccca2470df5dbac96da2d4a96b616b6670688
2022-01-03 20:44:01 +08:00
mincheli
be41ea676c Notifies window magnifcation changes for AccessibilityService (1/n)
See Design doc:  go/b200769372
To make the behavior consistent on the new platform,
The legcay callback,
  onMagnificationChanged(MagnificationController controller,
  Region region, float scale, float centerX, float centerY)
keep notifying only full-screen magnification change as
before.

To support listening to the magnification changes of all
magnification modes, the service should overide
The new callback proposed in T,
  onMagnificationChanged(MagnificationController controller,
  Region region, MagnificationConfig config).

TODO: Notify magnifcation change when window magnifier turns off

Bug: 203013925
Test: atest AccessibilityMagnificationTest,
    atest MagnificationControllerTest,
    atest WindowMagnificationManagerTest,
    atest WindowMagnificationControllerTest,
    atest FullScreenMagnificationControllerTest,

Change-Id: Ia73195a71f55bb26ef3f2eafce0dc73d8a65583b
2022-01-03 10:31:54 +08:00