Commit Graph

116884 Commits

Author SHA1 Message Date
Tiger Huang
e80e94182c Compare with oldSoftInputMode after restoring softInputMode
... of mWindowAttributes. Apps might update LayoutParams with
softInputMode unspecified on applying insets, and this can cause
infinite loop in the previous logic, because we would auto-compute
softInputMode for the unspecified one, which makes app's softInputMode
never be the same as the one in ViewRootImpl.mWindowAttributes.

Fix: 163009478
Test: Print stack trace before calling requestFitSystemWindows() and
      follow the steps in the bug.
Test: Open Messages, go to attachments, reopen IME
Change-Id: I2341121b69209688c2f6fb033f51611b21422a04
2020-09-02 06:48:08 +00:00
Marco Ballesio
7176835583 Merge changes from topic "cgroup v2 freezer frameworks" into rvc-qpr-dev
* changes:
  freezer: reentrant enable/disable method
  freezer: switch to cgroup v2 freezer
2020-08-28 17:49:06 +00:00
Alex Buynytskyy
b1d0a839f1 Fix transfer API.
Transfer API should throw security exception when transfering the
session which is not installing the original installer.
Moving it onto commit stage and still fail the installation.

Fixes: 165775712
Test: atest InstallSessionTransferTest
Test: atest -p frameworks/base/services/core/java/com/android/server/pm
Change-Id: I8511d4357788e70f83bcbd366908b42a691afbcb
Merged-In: I8511d4357788e70f83bcbd366908b42a691afbcb
2020-08-28 05:06:41 +00:00
Marco Ballesio
12f3e8d6d4 freezer: reentrant enable/disable method
the app freezer state can be toggled in multiple situations when a
debugging tool like heapdump is invoked, or when system_server dumps its
binder connections. All these uses are potentially concurrent and a
robust method to handle reentrancy is necessary to avoid leaving the
freezer in a state incompatible with a specific operation.

This patch moves freezer enable and disable operations from Process to
CachedAppOptimizer (ActivityManager), introduces a new ActivityManager API
to centralize all freezer state changes to ActivityManager and modifies
client code accordingly.

Bug: 151225245
Test: manually verified that no regression are introduced on freezer
behavior, verified that concurrent behavior is handled properly

Change-Id: I7d588cc6e0499012dce64ed4e42ff2adb336062d
Merged-In: I7d588cc6e0499012dce64ed4e42ff2adb336062d
2020-08-27 16:05:57 -07:00
Marco Ballesio
6ca459dc17 freezer: switch to cgroup v2 freezer
cgroup v2 freezer has a single hierarchy and is mounted under
/sys/fs/cgroup. Proper v2 freezer support in a system can be checked by
verifying that the file "cgroup.freeze" is present in a freezer subgroup.

Bug: 154548692
Test: manually verified that processes are frozen and unfrozen

Change-Id: Ib966a957490ec986eb14aba6492832c96e147896
Merged-In: Ib966a957490ec986eb14aba6492832c96e147896
2020-08-27 16:05:41 -07:00
Heemin Seog
d9892a1fac Merge "Smooth out IME animation for automotive devices" into rvc-qpr-dev 2020-08-27 17:03:23 +00:00
Charles Chen
b699ff316b Merge "[RESTRICT AUTOMERGE] Make a context dervied from an UI context as an UI context" into rvc-qpr-dev 2020-08-27 16:53:29 +00:00
TreeHugger Robot
0827205ffa Merge "Revoke the uri permission when the file is deleted" into rvc-qpr-dev 2020-08-27 10:57:31 +00:00
Charles Chen
c5ba62307c Merge "Respect UI Context for getDisplay" into rvc-qpr-dev 2020-08-27 02:52:05 +00:00
Hongwei Wang
02c5ea670f Merge "[DO NOT MERGE] Sync app requested orientation on PiP exit" into rvc-qpr-dev 2020-08-27 01:29:35 +00:00
Hongwei Wang
a2673cdfd4 [DO NOT MERGE] Sync app requested orientation on PiP exit
When exiting PiP to fullscreen, SysUI compares the initial rotation
with the screen rotation and skips the animation if they are different,
with the intention that the app should get back to its state prior to PiP.

This generally works well except that app may request
setRequestedOrientation after entering PiP and the initial rotation
SysUI gets in onTaskAppeared would be obsoleted.

This is fixed in this CL by
- Adding a requestedOrientation field in TaskInfo to pass this
  information to SysUI, in both onTaskAppeared and onTaskInfoChanged
  callbacks
- Sync with the requested orientation as well as display rotation on PiP
  exit. Moves also the information we need into PipWindowConfigurationCompact

Video: http://rcll/aaaaaabFQoRHlzixHdtY/gOPXfx5KO9krmzeor49DgG
Bug: 163218295
Test: See video
Change-Id: Idd0b9412dfdfd6fd293a800cded7c7a6b94cafde
2020-08-26 16:06:31 -07:00
Hongwei Wang
5460282793 Remove entry from mLastReportedWindowingMode on destroy
Bug: 166456665
Test: atest ActivityLifecyclePipTests \
            ActivityLifecycleSplitScreenTests \
            ActivityLifecycleTopResumedStateTests \
            PinnedStackTests\
            SplitScreenTests \
            ActivityLifecycleKeyguardTests
Change-Id: If2cf664bdb62ac3082c02d2c6c1ad74b10761f62
2020-08-26 09:52:46 -07:00
Ivan Chiang
5afa764557 Revoke the uri permission when the file is deleted
When the file is deleted, renamed or moved, revoke all uri
permissions with the file

Bug: 157474195
Test: manual test with DocumentsUI
Test: atest DocumentsTest#testAfterMoveDocumentInStorage_revokeUriPermission
Change-Id: I4ffb183630aadb2d87b0965e8cecf88af15f4534
Merged-In: I4ffb183630aadb2d87b0965e8cecf88af15f4534
(cherry picked from commit 9efd606f43)
2020-08-26 06:29:00 +00:00
Charles Chen
b2444cbef5 [RESTRICT AUTOMERGE] Make a context dervied from an UI context as an UI context
fixes: 165833103
Test: atest StrictModeTest ContextAccessTest
Test: atest InputMethodServiceTest InputMethodServiceStrictModeTest

Merged-In: Ia97e1a0cc290be516d2618148600238b3273c54c
Change-Id: Ia97e1a0cc290be516d2618148600238b3273c54c
2020-08-26 11:47:08 +08:00
Narayan Kamath
046d6480cc Merge "AppOpsManager: Add OP_RECORD_AUDIO_HOTWORD" into rvc-qpr-dev 2020-08-25 09:24:11 +00:00
TreeHugger Robot
4cb7d8c878 Merge "fix app prediction service doesn't clean-up properly." into rvc-qpr-dev 2020-08-24 18:27:26 +00:00
Narayan Kamath
68b3c98e14 AppOpsManager: Add OP_RECORD_AUDIO_HOTWORD
Bug: 162547999
Test: make
Change-Id: I1d072d93cb2e2b021b58d37d9340f8298acffa1b
2020-08-24 17:17:52 +01:00
TreeHugger Robot
b0df580193 Merge "Add a SettingsProvider key for Adaptive connectivity" into rvc-qpr-dev 2020-08-24 15:47:38 +00:00
Arc Wang
d631c648b3 Add a SettingsProvider key for Adaptive connectivity
Adaptive connectivity is a feature to manage 5G connectivity
for better battery life.

Bug: 162871294
Test: compile
Change-Id: I719e44a29a54ee886e5d3a7180fd3ad9a7dff599
Merged-In: I719e44a29a54ee886e5d3a7180fd3ad9a7dff599
2020-08-24 20:26:16 +08:00
Charles Chen
a4f73d7f1f Respect UI Context for getDisplay
Before InputMethodService initializes, InputMethodService#getDisplay
will throw UnsupportedOperationException because it doesn't attach to
any display. However, it may make developers confuse about why
throwing exception for an UI context. This CL workarounds to also
check isUiContext flags to make the result of IMS#getDisplay consistent.
It should be considered to remove after IMS migrate to WindowContext
concept.

fixes: 161964893
Test: atest InputMethodServiceTest#testGetDisplayBeforeInitialization

Change-Id: Ie0bda707f0196b45a8851f645da7ecab6814bed6
2020-08-24 14:45:02 +08:00
TreeHugger Robot
6bf25fdfc4 Merge "Handle NPE in LocalImageResolver to avoid crashing systemui" into rvc-qpr-dev 2020-08-24 03:07:11 +00:00
Kevin Hufnagle
8293d8aba7 docs: Fix note about new intent action changes coming with Android 11. am: e69b8a9006 am: 53f6fe0a82
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12418304

Change-Id: I74bc5add5347f1f77d77c54c1c1c7cbf4d85243c
2020-08-21 21:04:04 +00:00
Kevin Hufnagle
53f6fe0a82 docs: Fix note about new intent action changes coming with Android 11. am: e69b8a9006
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12418304

Change-Id: I90566db73bb86ec900ae8246dd8f504ad3adb104
2020-08-21 20:48:04 +00:00
Heemin Seog
b0d0d7c46a Smooth out IME animation for automotive devices
Automotive devices may request the navigation bar to be
hidden when the IME shows up (controlled via
config_automotiveHideNavBarForKeyboard) in order to maximize
the visible screen real estate. When this happens, the IME window
should animate from the bottom of the screen to reduce the jank
that happens from the lack of synchronization between the bottom
system window and the IME window.

Bug: 163418214
Test: manual
Change-Id: I5d7b03d5c829a2679efdd06fa961d1158494e08f
2020-08-21 19:38:44 +00:00
Ahan Wu
1a1c93f964 Handle NPE in LocalImageResolver to avoid crashing systemui
ContentResolver#openInputStream may return null, and may lead to
systemui keeps crashing, handle null to avoid this case.

Bug: 163412636
Test: manually
Change-Id: Ie149b75d4445b37afac82c8351a32cb17442936d
2020-08-21 14:18:08 +08:00
Kevin Hufnagle
e69b8a9006 docs: Fix note about new intent action changes coming with Android 11.
Bug: 155091482
Change-Id: I3dfeb333cbe95880142ed97d0d50fd9f85c52f50
Test: Documentation changes - no test necessary
2020-08-20 18:48:17 +00:00
Philip P. Moltmann
732608a6be Add app-ops for camera/mic use during phone call
Test: Started a phone call, verified app-op was active
Bug: 162547999
Change-Id: I93bf59d24e3cfbeaede442571f09ba97f0990c75
2020-08-19 20:17:29 -07:00
Kweku Adams
1706f9c22f Merge "Allow package verifier to hide specific fgs notifications." into rvc-qpr-dev 2020-08-19 17:14:33 +00:00
Tiger Huang
444e8dc6ce Refine system bar position restoring
The previous logic restores the system bar as long as its insets source
is visible. There can be a timing issue that if the user swipes to show
transient bars while an immersive app just becomes the control target
but the hide-bar info haven't sent to WM yet, WM will re-show the bar
incorrectly.

This CL uses the requested visibility and the behavior to decide if we
should restore the postion and the visibility.

This CL also refines and caches the arguments of showTransient. In this
way, we don't have to create the array every time while invoking that
method.

Fix: 161247175
Test: atest InsetsPolicyTest
Merged-In: Idef314dfe6625399b88b3dacb4c74c7071453497
Change-Id: Idef314dfe6625399b88b3dacb4c74c7071453497
(cherry picked from commit 533682ebb3)
2020-08-19 16:13:25 +00:00
Tiger Huang
23c75281ef Update requested state after applying pending frames
When there is an insets animation, we will stop updating insets source
frames until the animation is done. The previous logic didn't update the
frames within the requested state while the animation is done. And the
frames was relied by InsetsPolicy while playing transient bar animation.
If the frames don't match the display, the insets would be wrong, and
the animation wouldn't be played correctly.

Fix: 161134197
Test: atest InsetsControllerTest
Merged-In: Id8f3c1956fbfe3ad16f167ff76297dde6c634e81
Change-Id: Id8f3c1956fbfe3ad16f167ff76297dde6c634e81
2020-08-19 20:42:39 +08:00
Tiger Huang
1adfc8b85c Merge "Refine system bar position restoring" into rvc-qpr-dev 2020-08-19 11:57:15 +00:00
Tiger Huang
f8175d1a5b Dispatch insets to client if mState is changed
Previous logic in onStateChanged notifies insetsChanged based on the
change of mLastDispatchedState, which can make us dispatch redundant
insets changes to the app.

In this CL, we only notifies insetsChanged if mState is really changed
in onStateChanged -- we use the final mState (after updateState and
applyLocalVisibilityOverride) to compare with the one before changing.

Fix: 161924448
Test: atest InsetsControllerTest WindowInsetsControllerTests
Test: Swipe up to home while IME open and see if there is any jank
Merged-In: Ia536cdf76805caa56ca1b6eaf2b3db83b6ecd94e
Change-Id: Ia536cdf76805caa56ca1b6eaf2b3db83b6ecd94e
2020-08-19 15:32:53 +08:00
Tiger Huang
943589cf45 Merge "Update requested state after applying pending frames" into rvc-qpr-dev 2020-08-19 00:25:22 +00:00
Kweku Adams
e49aa726f0 Allow package verifier to hide specific fgs notifications.
The package verifier performs some system critical work that the user
doesn't need to be explicitly aware of. This adds a mechanism for the
verifier to indicate which foreground service notifications should be
hidden, if possible.

Bug: 164440539
Test: use test app to confirm requested fgs notifications are hidden
Change-Id: Ib3eb0b71cc676c145557ade9def98a363e5abebb
2020-08-18 10:32:58 -07:00
Beth Thibodeau
3743d5526a Merge "Allow user to block individual apps from resuming" into rvc-qpr-dev 2020-08-18 14:29:56 +00:00
Tiger Huang
533682ebb3 Refine system bar position restoring
The previous logic restores the system bar as long as its insets source
is visible. There can be a timing issue that if the user swipes to show
transient bars while an immersive app just becomes the control target
but the hide-bar info haven't sent to WM yet, WM will re-show the bar
incorrectly.

This CL uses the requested visibility and the behavior to decide if we
should restore the postion and the visibility.

This CL also refines and caches the arguments of showTransient. In this
way, we don't have to create the array every time while invoking that
method.

Fix: 161247175
Test: atest InsetsPolicyTest
Merged-In: Idef314dfe6625399b88b3dacb4c74c7071453497
Change-Id: Idef314dfe6625399b88b3dacb4c74c7071453497
2020-08-18 20:53:41 +08:00
TreeHugger Robot
01d9441cec Merge "Update docs to clarify how providers can create style bundles and Slices for inline suggestions." into rvc-dev am: 18cff6082d am: 6128b1ba0f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12265211

Change-Id: I83317ac5a0f2d33ff2403a0b3777f06a15fc347b
2020-08-18 00:35:23 +00:00
TreeHugger Robot
6128b1ba0f Merge "Update docs to clarify how providers can create style bundles and Slices for inline suggestions." into rvc-dev am: 18cff6082d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12265211

Change-Id: Ib0e9657c1d796cfcf9f5aa89709b9ad357d81f23
2020-08-18 00:24:55 +00:00
TreeHugger Robot
18cff6082d Merge "Update docs to clarify how providers can create style bundles and Slices for inline suggestions." into rvc-dev 2020-08-18 00:14:21 +00:00
Beth Thibodeau
70b5235a9d Allow user to block individual apps from resuming
This adds a setting which stores a list of packages that will be
prevented from persisting in QS as resumable media controls, even when
resumption is enabled. If the user adds a new package to this list when
it already has a resume control, that control will be removed.

Bug: 161813143
Test: manual, atest
Change-Id: I8c85bc937aeaf366954f2669eba8f6954640fe4c
Merged-In: I8c85bc937aeaf366954f2669eba8f6954640fe4c
2020-08-17 15:45:47 +00:00
Julia Reynolds
2778b62f1d Remove app ops indicators from notifications
Test: atest
Bug: 163076432
Change-Id: I5b7514f765811ffd3b0aca63d0108591755974ab
Merged-In: I5b7514f765811ffd3b0aca63d0108591755974ab
2020-08-14 15:02:02 +00:00
Tiger Huang
1a53789bc8 Update requested state after applying pending frames
When there is an insets animation, we will stop updating insets source
frames until the animation is done. The previous logic didn't update the
frames within the requested state while the animation is done. And the
frames was relied by InsetsPolicy while playing transient bar animation.
If the frames don't match the display, the insets would be wrong, and
the animation wouldn't be played correctly.

Fix: 161134197
Test: atest InsetsControllerTest
Change-Id: Id8f3c1956fbfe3ad16f167ff76297dde6c634e81
2020-08-13 14:58:06 +00:00
TreeHugger Robot
ca28a90bec Merge "Add changeId to gate R-QPR tests behind" into rvc-qpr-dev 2020-08-12 17:41:39 +00:00
Bradley Allen
803254aaeb Merge "docs: Removed Q preview language and added a link to the Android 10 page on developer.android.com." into rvc-dev am: 6dfedd05a7 am: d015d7299a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12347462

Change-Id: I8d8d9595a7992196255d09aecac3ace195e15374
2020-08-12 16:57:03 +00:00
Bradley Allen
d015d7299a Merge "docs: Removed Q preview language and added a link to the Android 10 page on developer.android.com." into rvc-dev am: 6dfedd05a7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12347462

Change-Id: I7bd9a90e3b66e4a842bdcaa33f62328fd9928af7
2020-08-12 16:46:29 +00:00
junyulai
d56bfed60c Add 5G NSA to collapsed RAT types list am: d75a22bc20
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12355984

Change-Id: I4cead400825ea55098bc15f6ebceb333bfc1afc9
2020-08-12 08:57:52 +00:00
junyulai
d75a22bc20 Add 5G NSA to collapsed RAT types list
Currently, getAllCollapsedRatTypes is used to retrieve
all RAT types which will be recorded into NetworkStatsService.
However, there is a missing part that 5G NSA virtual RAT type
is not added into this list. This makes callers such as statsd
do not aware of 5G NSA RAT type and missed to collect data
usage of it.

Test: atest NetworkStatsSubscriptionsMonitorTest#test5g
Test: adb shell cmd stats pull-source 10082
Test: ./out/host/linux-x86/bin/statsd_testdrive 10082
Test: atest UidAtomTests#testMobileBytesTransfer \
      UidAtomTests#testMobileBytesTransferByFgBg \
      UidAtomTests#testDataUsageBytesTransfer
Bug: 163021464
Change-Id: I0faeda20f0506a48ac1131b234c5fc40d95dfbe0
Merged-In: I0faeda20f0506a48ac1131b234c5fc40d95dfbe0
2020-08-12 05:21:23 +00:00
Nate Myren
070b491882 Add changeId to gate R-QPR tests behind
Bug: 162551686
Test: none
Change-Id: I6df669785db4d4684b8207fa7234d4793d652cb3
2020-08-12 00:21:40 +00:00
Bradley Allen
462481663c docs: Removed Q preview language and added a link to the Android 10 page on developer.android.com.
Test: http://go/forrest-run/L62500000661914456
Bug: 149267624
Change-Id: I73b92cf0af8f78117448db9a89d7685f45bc512d
2020-08-11 18:56:15 +00:00
TreeHugger Robot
178e18a7fc Merge "Migrate PiP logs to UiEvent" into rvc-qpr-dev 2020-08-11 18:49:47 +00:00