Commit Graph

17922 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
Alan Stokes
f654371d53 Don't include inaccessible data dirs in library paths.
When constructing a classloader for a different app, don't include
it's private data dir in libraryPermittedPath if we don't have access
to it. (Which we often won't, although it depends on target SDK,
whether it has a shared UID, etc.)

This avoids generating SELinux denials at boot and other times,
e.g. when initialising WebView.

Bug: 161356067
Test: Boots, denials not seen, WebView works.
Change-Id: Ib246af979783e80fde3313f8aed6c3b7a886e6b2
2020-07-28 14:31:34 +00:00
Pinyao Ting
d0dd38c4d4 fix app prediction service doesn't clean-up properly.
Currently new app prediction session will be created each time
launcher crashes, this introduces some memory impact since the
existing callbacks are not released after the crash.

The root cause being random UUID was used to create the session,
as a result app prediction service is not able to dedupe it with
against existing sessions.

Bug: 161391868
Test: manual
Change-Id: I937cdaa6081d2b85d27ee0192f6af7f197b8e102
2020-07-27 14:53:32 -07:00
Jing Ji
7249ed0952 Merge "Java docs update: Advise not to include PII in setProcessStateSummary" into rvc-dev am: fcaa94e2dc am: 62b56170ac
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12202766

Change-Id: I2793a40476d8ed6411637dd16b027e1f7bac9806
2020-07-23 22:20:01 +00:00
Jing Ji
3bda3bf8c6 Java docs update: Advise not to include PII in setProcessStateSummary
Bug: 161812603
Test: m -j offline-sdk-docs & manual verify the javadoc
Change-Id: I741bbf7b83badcd7f1610f31bbd41a49b8b975fb
2020-07-22 11:03:30 -07:00
Jing Ji
0f1b2c45bc Merge "Fix javadoc error in ApplicationExitInfo#getDefiningUid()" into rvc-dev am: 42ef19d57c am: 6cca58b722
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12118644

Change-Id: I7fb03437a0897b7be93b7cd38040713aa99259f3
2020-07-09 18:18:25 +00:00
Jing Ji
42ef19d57c Merge "Fix javadoc error in ApplicationExitInfo#getDefiningUid()" into rvc-dev 2020-07-09 18:11:00 +00:00
Jing Ji
219da992ad Fix javadoc error in ApplicationExitInfo#getDefiningUid()
Bug: 160875447
Test: m -j offline-sdk-docs & manual verify the javadoc
Change-Id: Iae09584b42990092166be3c9a2bb792fa2d0abef
2020-07-09 09:33:10 -07:00
Charles Chen
f03568fede Merge "Fix NPE when invoking Context#isUiContext" into rvc-dev am: 5c25605da0 am: a91c84fa14
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12105622

Change-Id: I0d013cc5a388ccc050190f739c86363a89e0d682
2020-07-08 18:09:44 +00:00
Charles Chen
3b8e8d7631 Fix NPE when invoking Context#isUiContext
Add null checks in both ContextWrapper and before obtaining
ContextImpl#getOuterContext.

Test: atest ContextTest#testIsUiContext_ContextWrapper
fixes: 160037462
Change-Id: Ic6a71dd9ac4b195d219d6e5431f2f2b199a400fa
2020-07-08 23:58:58 +08:00
Jeff DeCew
43a6de043e Do not hide the bell icon.
Bug: 156887617
Test: Update a notification between 10-30 seconds after the last update, watch bell icon stay visible.
Change-Id: Ib737fd78ac5afa26ee0e456ffbee6c6dc0a5c835
2020-07-06 21:31:37 -04:00
TreeHugger Robot
d70c7dda50 Merge "Fix Bundle#getParcelableArray call" into rvc-dev 2020-07-03 02:22:57 +00:00
Charles Chen
8deb612a14 Merge "Revert "Revert "Enable IMS and its config context to obtain UI component""" into rvc-dev 2020-07-01 23:21:51 +00:00
Tadashi G. Takaoka
c4a13e9b0b Fix Bundle#getParcelableArray call
Because Bundle.getParcelableArray() returns Parcelable[] object,
simply casting a return value to a typed array will cause
ClassCastException.

Bug: 158584842
Bug: 160120833
Test: manually install ArcNotificationTest2 and try inline reply
Change-Id: Idd8eaa412925ac826590d44a0db297aacef806d8
2020-06-30 14:18:49 +09:00
Charles Chen
ba4ffa4a6d Revert "Revert "Enable IMS and its config context to obtain UI component""
Test: atest StrictModeTest
Bug: 157027563
Bug: 159795597
Change-Id: I2a1b3fefa0bd82eeaa507c08fc4a79fc9f4391c5
2020-06-29 14:27:08 +00:00
Stanislav Zholnin
ebe2773f3d Merge "Add testAppOps test to TEST_MAPPING." into rvc-dev 2020-06-26 09:47:32 +00:00
Stanislav Zholnin
2a4f925537 Add testAppOps test to TEST_MAPPING.
Approval are here: ag/11091388.

Test: atest UidAtomTests#testAppOps
Change-Id: I571e549f57968a83b32f5871994ea7b1b74be3d0
2020-06-26 09:44:11 +00:00
TreeHugger Robot
9e7c46190a Merge "Revert "Enable IMS and its config context to obtain UI component"" into rvc-dev 2020-06-25 00:41:07 +00:00
Alistair Delva
71b8a0456c Revert "Enable IMS and its config context to obtain UI component"
Revert "Verify IMS to get display and WM"

Revert submission 11823238-ims_ui_context

Reason for revert:
Broke the following tests:
android.os.cts.StrictModeTest#testIncorrectContextUse_GetDisplay
android.os.cts.StrictModeTest#testIncorrectContextUse_GetSystemService
android.os.cts.StrictModeTest#testIncorrectContextUse_GetViewConfiguration
But was submitted with a bypass.

Reverted Changes:
I688b46a92:Verify IMS to get display and WM
I172ceb2e1:Enable IMS and its config context to obtain UI com...

Bug: 157027563
Bug: 159795597
Change-Id: Id309faac0ac8f60ee0d92c26767a89f450ddc455
2020-06-24 22:31:53 +00:00
Evan Severson
aacd48b0bc Implement permission revoke with reason
The reason is passed to app exit info so a given app can get more
information about why their app was killed in the event of permission
revoke.

Test: atest RevokePermissionTest ActivityManagerAppExitInfoTest#testPermissionChangeWithReason
Fixes: 159659620
Change-Id: Id711667eb2c1579ecb2a1b83a62af3cc7862d5f6
2020-06-24 10:03:54 -07:00
Charles Chen
8655743001 Merge "Enable IMS and its config context to obtain UI component" into rvc-dev 2020-06-24 03:33:53 +00:00
Jeff Sharkey
38a6333ff6 Merge "Override MIME type to match MediaStore behavior." into rvc-dev 2020-06-23 15:56:44 +00:00
Jeff Sharkey
83aaf908a6 Override MIME type to match MediaStore behavior.
Internally, DownloadManager synchronizes its contents with MediaStore,
which relies heavily on using file extensions to determine MIME types.

To prevent these two databases from getting confused, this change
adjusts DownloadManager to force the MIME type of already-completed
downloads based on the file extension, matching what MediaStore does.

Bug: 159594536
Test: atest PublicApiAccessTest#testAddCompletedWithoutExtension
Change-Id: I60c613eafcfe55007dffcac2d7d1fe375b753c19
2020-06-23 07:13:13 -06:00
Issei Suzuki
16868fbef0 Merge "Update virtual display size before turning it on." into rvc-dev 2020-06-23 11:46:16 +00:00
Kweku Adams
6cca001863 Merge "Disable restricted bucket." into rvc-dev 2020-06-23 00:13:41 +00:00
Charles Chen
d2fd037ab3 Enable IMS and its config context to obtain UI component
Test: atest StrictModeTest
Bug: 157027563

Change-Id: I172ceb2e17722a7cba917a6e3a808d7559cad3e0
2020-06-23 03:45:17 +08:00
Michael Groover
2bcb70322c Merge "Update docs for methods that require subscriberId" into rvc-dev 2020-06-22 19:30:10 +00:00
Hongwei Wang
997150ee0a Merge "Updates enterPictureInPicture API doc" into rvc-dev 2020-06-22 18:14:10 +00:00
Stanislav Zholnin
7a65a7a37c Merge "Prevent developer provided strings from being uploaded through statsd." into rvc-dev 2020-06-22 08:10:52 +00:00
TreeHugger Robot
48e9dc67f1 Merge "Revert "Fix transition return issues when more than 1 level depth"" into rvc-dev 2020-06-22 03:04:37 +00:00
Jeff Chang
79f5a49b3c Revert "Fix transition return issues when more than 1 level depth"
This reverts commit 6d834d86fb.

Reason for revert: <http://b/159230864 WhatsApp image is visible after existing a chat>
Bug: 159230864

Change-Id: Ib266cff2e06a82ae9a0e85142ef80ae00328a040
2020-06-20 06:09:04 +00:00
Michael Groover
f4f6a7adac Update docs for methods that require subscriberId
In Android 10 additional restrictions were required to access the
subscriberId. The NetworkStatsManager has several methods that accept
a subscriberId of the mobile network for which usage should be queried.
This commit updates the docs for these methods to reference the new
access restrictions and offer null as an option to obtain the usage
for all mobile networks.

Fixes: 157871064
Test: m docs
Change-Id: I95c730c9418fced6312eb3ba4e0d69e6299f3ded
2020-06-19 19:48:07 -07:00
TreeHugger Robot
7ec25249ab Merge "Save AsyncOps for later forwarding instead of SyncOps." into rvc-dev 2020-06-19 21:29:40 +00:00
Stanislav Zholnin
456b496e4a Save AsyncOps for later forwarding instead of SyncOps.
Fixes: 159082266
Test: atest AppOpsLoggingTest
Change-Id: I3f8da9d7c2925233e5e53cfa7fd5e4cd1c258b29
2020-06-19 19:48:35 +01:00
Stanislav Zholnin
54762b293e Prevent developer provided strings from being uploaded through statsd.
- in situation when developer provides message when op is noted, do not
report it through stack trace collection infrastructure
 - collect only statcktraces for OP_FLAG_SELF and OP_FLAG_TRUSTED_PROXIED to
match collection of appops counts

Test: atest  android.app.appops.cts.RuntimeMessageCollectionTest
Fixes: 159433071
Change-Id: I1ab56a530832873a1f1f68aba5ab6eabc9e8a17a
2020-06-19 19:43:03 +01:00