Commit Graph

21233 Commits

Author SHA1 Message Date
TreeHugger Robot
ff6577fd10 Merge "Fix IME shrunk by WindowTokenClient mis-detach" into sc-v2-dev 2022-01-15 04:27:54 +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
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
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
Mariia Sandrikova
3486eacda3 Merge changes from topic "camera-compat" into sc-v2-dev
* changes:
  [3/n] Camera Compat UI: Add a camera compat control.
  [2/n] Camera Compat UI: Add interfaces for client-server communication.
2021-12-18 21:39:13 +00:00
Mariia Sandrikova
24f4d8a952 [2/n] Camera Compat UI: Add interfaces for client-server communication.
Changes:
- Listens to changes from the client coming through IActivityClientController#requestCompatCameraControl to ActivityRecord#updateCameraCompatState
- ActivityRecord#updateCameraCompatState sends updated state via TaskInfo to WM Shell
- ITaskOrganizerController#updateCameraCompatControlState to dispatch the user interactions with the control from WM Shell triggers callback to ActivityRecord#updateCameraCompatStateFromUser
- ActivityRecord#updateCameraCompatStateFromUser remembers the user's choice and asks client to apply treatment through ICompatCameraControlCallback

Feature is guarded with config_isCameraCompatControlForStretchedIssuesEnabled

Test: atest WMShellUnitTests:ShellTaskOrganizerTests, atest WmTests:ActivityRecordTests
Bug: 206602997
Change-Id: I083aa6718bd67456bedd9444e9b78740c041f870
2021-12-17 00:18:57 +00:00
Chilun
77ed8e5724 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: 209744518
Test: build pass
Change-Id: I2ece3b9d85edc1ae43038e6f69b35f59b160a3dd
(cherry picked from commit f8fc1326f7)
2021-12-16 16:04:29 +00:00
Jeff DeCew
3b3e39f627 Fix expanded fully custom view showing wrong chevron state
Fixes: 206045893
Test: post fully custom notification from Notify2-SC and check expanded chevron
Change-Id: I97db4f9a5cb207d03d1370fa267f630f355c1bf4
2021-12-13 15:30:33 +00:00
Riddle Hsu
778c95ce7c Reduce cost of WindowTokenClient config change
The SizeConfigurationBuckets was used to avoid activity relaunch
by insignificant configuration change. Because WindowTokenClient
doesn't have relaunch operation, it is unnecessary to use it.
Especially Resources#getSizeConfigurations() is a heavy invocation,
which may create hundreds of temporal Configuration when calling it
in system server.

Also fix leakage of SystemUiContext if it is detached, e.g. the
associated display is removed.

Bug: 207620458
Test: atest WindowContextControllerTest
Change-Id: I8388a2ab25f3deed2e29eb5636c4b2130f4f1b87
2021-12-13 18:52:54 +08:00
Riddle Hsu
45e4bcf994 Reduce unnecessary overhead of SystemUiContext
- Do not report change when initializing DisplayContent
  (DisplayContent#isReady() is false).
  This reduces boot time by dozen of milliseconds
  (RootWindowContainer#setWindowManager).
- Only create SystemUiContext if needed. Most of processes don't
  use it. This reduces many registrations (e.g. according to the
  number of processes, it maybe from ~60 to ~10), which involve
  binder/listener creation/invocation, especially the extra cost
  of dispatching configuration to the context which no one uses.
- Store token as IWindowToken to avoid object creation every time
  by asInterface.

Bug: 207620458
Test: atest InputMethodMenuControllerTest WindowContextControllerTest
Change-Id: I867e9f81116796c42048195406d74feccf4772d3
2021-12-09 16:51:28 +08:00
Wei Sheng Shih
611d320a39 Merge "Provide default splash screen style for Launcher and SystemUI." into sc-v2-dev 2021-12-08 03:55:35 +00:00
Wu Ahan
f6a946bbcd Decode the input of both setStream and setResource calls first
The size of the input of both setStream and setResource may very big
that system server got oom while handling it, so we try to decode it
first before copying it to the wallpaper path, if the decoding fails, we
treat the input as an invalid input.

Bug: 204087139
Test: Manually set wallpaper, no PDoS observed.
Change-Id: I014cf461954992782b3dfa0dde67c98a572cc770
2021-12-06 02:51:18 +00:00
Jay Aliomer
2eaae4e670 Properly remove local color areas of callback
Refactored to system server to the repository pattern
added locks to the WallpaperManager

Fixes: 206632865
Test: manual
Change-Id: Icc73c18e34042ae48e338b03dc3e94fee5d6939d
2021-12-01 19:25:38 +00:00
Jordan Demeulenaere
c424d4801f Refactor DialogLaunchAnimator and remove host dialog (1/2)
This CL is a refactoring of the DialogLaunchAnimator and a major change
in how it works internally.

Before this CL, when DialogLaunchAnimator.show(originalDialog, ...) was
called, it would create a fullscreen dialog (called hostDialog) to
which we would add the content view stolen from the originalDialog (that
would then be hidden). We would then run the launch animation in the
host dialog and listen for show(), hide() or dismiss() calls to the
originalDialog to know when we should show(), hide() or dismiss() the
hostDialog.

The main reason we did that was because there was no way to override the
dismiss() behavior of the originalDialog, which we need to do given that
we want to animate the dialog into the view that showed the dialog
before actually dismissing it.

This approach had multiple downsides:
 - We were showing the dialog content view inside a different window
   than the one in which it was created, therefore any change made to or
   any listener added to the originalDialog window was lost.
 - Code calling DialogLaunchAnimator.showFromView needed to know that
   their dialog content will be moved to another window, which is
   unexpected and can lead to subtle bugs.
 - We were waiting for 2 dialogs to be shown instead of 1 before being
   able to start the animation.

This CL does what we should have done since the beginning: it adds a
hidden API to Dialog so that we can override what happens when
Dialog.dismiss() is called. This allows the DialogLaunchAnimator to run
the exit animation into the view that triggered the dialog before
actually dismissing it. The only modification that
DialogLaunchAnimator.show(originalDialog, ...) now does to the
originalDialog is making its window fullscreen and inserting two views
between the originalDialog DecorView and its children. The first
inserted view is a fullscreen transparent background used to dismiss the
dialog when the user taps outside the dialog content. The second
inserted view is a View that we size and position the same way that the
DecorView was before we made it fullscreen, and to which we set the
originalDialog background. This view now serves as a "fake window" with
the same size, background and position as the original window
(DecorView).

This CL improves the time to start the launch animation by 20-25%
(measured in a totally unrigorous logcat way).

Bug: 193634619
Test: atest DialogLaunchAnimatorTest
Change-Id: If09eda7b06e83b3ed7714cec97afef08b3d9fd3e
2021-12-01 10:53:23 +01:00
wilsonshih
44f5e52d53 Provide default splash screen style for Launcher and SystemUI.
Previous the splash screen style can either be EMPTY or ICON, and need
to be set by new hidden API #setSplashscreenStyle, so the flag will
always be "EMPTY" for those 3rd party Launcher Apps which may have not
upgrade to targetSDK 31.
To correct the default behaivor for Launcher Apps, create a new
UNDEFINED style as default value for splashScreenStyle, and if the
value is UNDEFINED, determine the style by checking the launch source.

Test: Verify no change when default home is NexusLauncher.
Test: Set 3rd-party Launcher as default home, verify the splash screen
style should be ICON when launch app from Launcher.
Test: atest SplashscreenTests
Bug: 206746601

Change-Id: I105e2fcfc7a6ee8de7f442931cbeb4b6e517850d
Merged-In: I105e2fcfc7a6ee8de7f442931cbeb4b6e517850d
2021-12-01 01:40:11 +00:00
Makoto Onuki
b344d33561 Merge "ForegroundServiceDidNotStartInTimeException now has..." into sc-v2-dev 2021-11-30 16:28:24 +00:00
Felipe Leme
7df16f2d42 Merge "Added AM APIs to get switch from / to user messages." into sc-v2-dev 2021-11-23 00:25:49 +00:00
Felipe Leme
4ce8bf537d Added AM APIs to get switch from / to user messages.
Test: adb shell dumpsys activity users|grep mSwitching
Fixes: 206873264

Change-Id: I1e5e3ab26c31bad8190037f22d4fbad2947d9d22
2021-11-22 22:11:22 +00:00
Charles Chen
83d6490629 Merge "[RESTRICT AUTOMERGE] Associate SystemUiContext with DisplayContent" into sc-v2-dev 2021-11-22 06:29:28 +00:00
TreeHugger Robot
34a0dd0d91 Merge "Javadoc changes for additional DPC-settable extras" into sc-v2-dev 2021-11-19 09:38:28 +00:00
Beth Thibodeau
313b9e923d Merge "Check media session token type" into sc-v2-dev 2021-11-18 23:43:21 +00:00
Makoto Onuki
45f4b4aaa5 ForegroundServiceDidNotStartInTimeException now has...
an inner exception that captures the stacktrace where
Context.startForegroundService() was called last time,
from the same process.

Bug: 124137635
Test: Manual test with a tesapp. 1: when startForegroundService() is called by
the same process:
```
11-17 17:00:12.483 10241  9545  9545 E AndroidRuntime: FATAL EXCEPTION: main
11-17 17:00:12.483 10241  9545  9545 E AndroidRuntime: Process: com.google.omakoto.testapp, PID: 9545
11-17 17:00:12.483 10241  9545  9545 E AndroidRuntime: android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{e7674af u0 com.google.omakoto.testapp/.MyFgs3}
11-17 17:00:12.483 10241  9545  9545 E AndroidRuntime: 	at android.app.ActivityThread.generateForegroundServiceDidNotStartInTimeException(ActivityThread.java:1965)
11-17 17:00:12.483 10241  9545  9545 E AndroidRuntime: 	at android.app.ActivityThread.throwRemoteServiceException(ActivityThread.java:1934)
11-17 17:00:12.483 10241  9545  9545 E AndroidRuntime: 	at android.app.ActivityThread.access$2700(ActivityThread.java:255)
11-17 17:00:12.483 10241  9545  9545 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2190)
11-17 17:00:12.483 10241  9545  9545 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:106)
11-17 17:00:12.483 10241  9545  9545 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:201)
11-17 17:00:12.483 10241  9545  9545 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:288)
11-17 17:00:12.483 10241  9545  9545 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7839)
11-17 17:00:12.483 10241  9545  9545 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
11-17 17:00:12.483 10241  9545  9545 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
11-17 17:00:12.483 10241  9545  9545 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
11-17 17:00:12.483 10241  9545  9545 E AndroidRuntime: Caused by: android.app.StackTrace: Last startServiceCommon() call for this service was made here
11-17 17:00:12.483 10241  9545  9545 E AndroidRuntime: 	at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1868)
11-17 17:00:12.483 10241  9545  9545 E AndroidRuntime: 	at android.app.ContextImpl.startForegroundService(ContextImpl.java:1823)
11-17 17:00:12.483 10241  9545  9545 E AndroidRuntime: 	at android.content.ContextWrapper.startForegroundService(ContextWrapper.java:779)
11-17 17:00:12.483 10241  9545  9545 E AndroidRuntime: 	at android.content.ContextWrapper.startForegroundService(ContextWrapper.java:779)
11-17 17:00:12.483 10241  9545  9545 E AndroidRuntime: 	at com.google.omakoto.testapp.MyReceiver.onReceive(MyReceiver.java:53)
11-17 17:00:12.483 10241  9545  9545 E AndroidRuntime: 	at android.app.ActivityThread.handleReceiver(ActivityThread.java:4345)
11-17 17:00:12.483 10241  9545  9545 E AndroidRuntime: 	at android.app.ActivityThread.access$1600(ActivityThread.java:255)
11-17 17:00:12.483 10241  9545  9545 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2102)
11-17 17:00:12.483 10241  9545  9545 E AndroidRuntime: 	... 7 more
```

Test: Manual test with a tesapp. 1: when startForegroundService() is called by
another process:
```
11-17 16:59:34.456 10241  9432  9432 E AndroidRuntime: FATAL EXCEPTION: main
11-17 16:59:34.456 10241  9432  9432 E AndroidRuntime: Process: com.google.omakoto.testapp:second, PID: 9432
11-17 16:59:34.456 10241  9432  9432 E AndroidRuntime: android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{dcaa127 u0 com.google.omakoto.testapp/.MyFgs3}
11-17 16:59:34.456 10241  9432  9432 E AndroidRuntime: 	at android.app.ActivityThread.generateForegroundServiceDidNotStartInTimeException(ActivityThread.java:1965)
11-17 16:59:34.456 10241  9432  9432 E AndroidRuntime: 	at android.app.ActivityThread.throwRemoteServiceException(ActivityThread.java:1934)
11-17 16:59:34.456 10241  9432  9432 E AndroidRuntime: 	at android.app.ActivityThread.access$2700(ActivityThread.java:255)
11-17 16:59:34.456 10241  9432  9432 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2190)
11-17 16:59:34.456 10241  9432  9432 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:106)
11-17 16:59:34.456 10241  9432  9432 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:201)
11-17 16:59:34.456 10241  9432  9432 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:288)
11-17 16:59:34.456 10241  9432  9432 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7839)
11-17 16:59:34.456 10241  9432  9432 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
11-17 16:59:34.456 10241  9432  9432 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
11-17 16:59:34.456 10241  9432  9432 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
```

Change-Id: I2dd8ec76213d53728eaa8fcc3760813d82a328a5
2021-11-18 07:54:26 -08:00
Charles Chen
082403816a [RESTRICT AUTOMERGE] Associate SystemUiContext with DisplayContent
Before this CL, SystemUiContexts were fixed to the Display metrics
when the SystemUiContexts were created. It is the same mechanism
as DisplayContext but applies to SystemUiContexts unexpectedly.
This CL makes SystemUiContexts associate with DisplayContent with
the corresponding display ID. In this way, SystemUiContext would
receive updates when there is a Display property change.

Bug: 194262507
Bug: 191064581
Bug: 205859784
Test: atest InputMethodMenuControllerTest WindowContextControllerTest
Test: atest NexusLauncherTests

Change-Id: I64a1614f32d097785915f6105b1813a929e0fe32
2021-11-18 22:44:59 +08:00
Beth Thibodeau
e91aa6cb7d Check media session token type
When checking whether a notification has a media session, make sure that
the value in the extra is the correct type.

In addition, moves this check inside of
Notification#isMediaNotification for consistency - existing usages either
already checked both or will not be impacted, given that valid MediaStyle
notifications are now shown in the media carousel instead of with other
notifications in the shade.

Fixes: 205570941
Test: atest
Test: manual, repro case in bug
Change-Id: I5d0134d2ce81e9e6a2ed16748f84252bf765a1c9
2021-11-17 11:18:35 -05:00
Makoto Onuki
b20c14d2af Use different exceptions for different crash reasons
Always throwing RemoteServiceException would make it impossible to
tell the cause of a crash without the string message.

Let's use a different exception type so developers can cluster crashes
without the exception message.

Bug: 124137635
Bug: 172001574
Test: Treehugger

Change-Id: If04f8c66efcc32a5200efa70ea20d97e13006039
2021-11-16 14:20:56 -08:00
TreeHugger Robot
b3137b3b86 Merge "New hidden DPM methods: getLogoutUserId() and clearLogoutUser()." into sc-v2-dev 2021-11-13 01:22:24 +00:00
Felipe Leme
670c8895be New hidden DPM methods: getLogoutUserId() and clearLogoutUser().
Also fixed how the logout user was cleared after a successful switch.

They will be used by CarSystemUi to end a session.

Test: Manual verification with CtsVerifier and TestDpc on automotive

Bug: 205185521
Bug: 204483021

Change-Id: Ieda0a22625ef705fcd705aedfc2dbf2cf570bf81
2021-11-11 18:14:28 -08:00
Felipe Leme
1f37c4f7c7 Fixed permisssions on setStopBackgroundUsersOnSwitch().
It was requiring INTERACT_ACROSS_USERS_FULL (instead of
INTERACT_ACROSS_USERS), which cannot be granted by Shell
(and hence cannot be used by CtsVerifier).

Test: m update-api
Test: manual verification
Bug: 203752848

Change-Id: Ie84311e6500cefa055548e309ee6d629c62fb10d
2021-11-11 17:42:24 -08:00
TreeHugger Robot
a6f7644ef0 Merge "Don't allow background apps to change theme" into sc-v2-dev 2021-11-11 19:56:46 +00:00
Lucas Dupin
6fd464985a Don't allow background apps to change theme
A background app that changes the wallpaper, was able to change the
device theme.

This change will apply the theme if the app is on the foreground, like
WallpaperPicker would be, but would defer the event until the next power
button cycles, like we do with Live Wallpapers, to avoid the same type
of DoS.

Test: manual
Test: atest ThemeOverlayControllerTest
Fixes: 205140487
Change-Id: I2086b29ef9bf3bb6fb7d9ebba6e7b8db9392e459
Merged-In: I2086b29ef9bf3bb6fb7d9ebba6e7b8db9392e459
2021-11-11 17:53:06 +00:00
TreeHugger Robot
60422ba05a Merge "Revert "[RESTRICT AUTOMERGE] Associate SystemUiContext with DisplayContent"" into sc-v2-dev 2021-11-11 14:13:01 +00:00
Alex Chau
930739c45a Revert "[RESTRICT AUTOMERGE] Associate SystemUiContext with DisplayContent"
This reverts commit 71b2172abc.

Reason for revert: See b/205859784, breaks launcher tests
Bug: 205859784
Bug: 194262507
Bug: 191064581

Change-Id: Iaac32bd4142c0539300725dc2f6e4255fefc8b2f
2021-11-11 10:09:10 +00:00
TreeHugger Robot
5908bbe04d Merge "Renamed setStopBackgroundUsersOnSwitch to setStopUserOnSwitch()" into sc-v2-dev 2021-11-11 04:51:15 +00:00
Varun Shah
0b0b81f505 Merge "Update deletion conditions for a package's UsageStats." into sc-dev am: 2a14be36ff am: e1a38189da
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16222839

Change-Id: I10b4e4a641752585cc23ef4a08f25517aa4be791
2021-11-11 01:37:54 +00:00
Varun Shah
e1a38189da Merge "Update deletion conditions for a package's UsageStats." into sc-dev am: 2a14be36ff
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16222839

Change-Id: Ic05768dc4213e00f93829ace282fd847dc2e5fed
2021-11-11 01:19:38 +00:00
Varun Shah
157fbcfbe4 Update deletion conditions for a package's UsageStats.
If a profile owner is defined for a specific user, do not delete usage
stats for a package on package deletion.

Bug: 197399948
Test: atest UserUsageStatsServiceTest
Test: atest UsageStatsTest [all]
Change-Id: I94a8e3dfca8ef4c7616f77944d61726e06043b85
Merged-In: I94a8e3dfca8ef4c7616f77944d61726e06043b85
2021-11-10 17:11:32 +00:00
Charles Chen
71b2172abc [RESTRICT AUTOMERGE] Associate SystemUiContext with DisplayContent
Before this CL, SystemUiContexts were fixed to the Display metrics
when the SystemUiContexts were created. It is the same mechanism
as DisplayContext but applies to SystemUiContexts unexpectedly.
This CL makes SystemUiContexts associate with DisplayContent with
the corresponding display ID. In this way, SystemUiContext would
receive updates when there is a Display property change.

Bug: 194262507
Bug: 191064581
Test: atest InputMethodMenuControllerTest WindowContextControllerTest

Change-Id: Idd74da965c18bdbf8912bd45e89be21f652dcf93
2021-11-10 14:19:53 +08:00
Felipe Leme
61292e22ed Renamed setStopBackgroundUsersOnSwitch to setStopUserOnSwitch()
Test: atest NeneTest:UsersTest
Test: m update-api CtsVerifier
Test: adb shell cmd activity set-stop-user-on-switch false
Test: adb shell cmd activity set-stop-user-on-switch
Test: adb shell dumpsys activity users|grep OnSwitch

Bug: 203752848

Merged-In: Iea03164319768abf159bf8ae2ccc539620cb30fe
Change-Id: Iea03164319768abf159bf8ae2ccc539620cb30fe
2021-11-08 16:32:42 -08:00
wilsonshih
966a61366e setTurnScreenOn can only used as wakeup
setTurnScreenOn shouldn't dismiss keyguard automatically even when the
keyguard is insecure.
The keyguard state should only be affected by requestDismissKeyguard
and/or setShowWhenLocked, and for either case setTurnScreenOn can be
used to wakeup device if the activity is going to be resumed and
visible.

Bug: 201103497
Test: atest ActivityVisibilityTests KeyguardTests KeyguardLockedTests
Change-Id: I283dea469a33286fc9cf835e39ee5a3be2444739
(cherry picked from commit f3a1274a38)
2021-11-08 07:18:20 +00:00
arangelov
4bb56865a5 Javadoc changes for additional DPC-settable extras
Bug: 202522103
Test: in the ManagedProvisioning CL
Change-Id: I81bc5400f1f3a277fa9c0734b109148795256db6
2021-11-05 18:37:59 +00:00
Felipe Leme
7c1c6a691c Merge "New TestAPIs on ActivityManager to not stop bg users on switch." into sc-v2-dev 2021-11-05 18:06:02 +00:00
Felipe Leme
502344efe5 Merge "Centralise owners for Enterprise Platform team." into sc-v2-dev 2021-11-05 17:49:30 +00:00
Felipe Leme
ef61167cf4 Merge "Disabled some password-related APIs on automotive." into sc-v2-dev 2021-11-05 16:06:13 +00:00
Felipe Leme
f1f95597f0 Merge "Fixed DPM.logoutUser() for headless system user mode." into sc-v2-dev 2021-11-05 15:45:19 +00:00
Felipe Leme
9cab317f2a New TestAPIs on ActivityManager to not stop bg users on switch.
Test: atest NeneTest:UsersTest
Test: m update-api
Test: adb shell cmd activity set-stop-user-on-switch false
Test: adb shell cmd activity set-stop-user-on-switch
Test: adb shell dumpsys activity users|grep OnSwitch

Bug: 203752848

Change-Id: Ib57989aff323dc1f7d98720d01215e4f7c79ba3a
2021-11-04 12:36:56 -07:00
Felipe Leme
bc671b859a Fixed DPM.logoutUser() for headless system user mode.
On "traditional" devices, this method switches back to the "primary"
user, which is the system user. But on devices running with headless
system user mode, it should switch to the previous user instead.

Test: manual verification (TestDpc/CtsVerifier) on car and phone
Test: atest com.android.cts.devicepolicy.DeviceOwnerTest#testCreateAndManageUser_LogoutUser
Bug: 204483021

Change-Id: I3ccbc1f31f8bcc4dae8fcb71cf5de7a7ad8882fe
2021-11-04 10:54:40 -07:00
Mady Mellor
80a34bc07e Merge "Add locusId as something taskOrganizers care about" into sc-v2-dev 2021-11-03 00:47:12 +00:00
Mady Mellor
5468eedde5 Add locusId as something taskOrganizers care about
This ensures that a locusId change will trigger an
onTaskInfoChange immediately. Previously it would just
be sent with the next info change event which isn't
sufficient.

Test: atest NotificationManagerTest
Bug: 204260661
Change-Id: I2b53f63b6efd6d2c22a877b7c33f5a12832a8e1d
2021-11-02 15:31:41 -07:00
TreeHugger Robot
bae76ba745 Merge "Close ParcelFileDesciptor properly" into sc-v2-dev 2021-11-02 09:38:51 +00:00
Felipe Leme
97e42e2785 Disabled some password-related APIs on automotive.
The APIs are deprecated (in favor of setRequiredPasswordComplexity())
and some automotive OEMs might not even provide the option to
set passwords (just PINs and patterns).

Fixes: 204252236

Test: atest CtsDevicePolicyTestCases:android.devicepolicy.cts.DeprecatedPasswordAPIsTest # on automotive and phone

Change-Id: I6272bdd0e893f6fd8f1d126d384d1b332e61bac2
2021-10-29 16:18:04 -07:00