Commit Graph

14833 Commits

Author SHA1 Message Date
Alison Cichowlas
cef37d003a Add a flag for calling old ChooserTargetService API & remove flags for Shortcuts.
This flag is temporary, just want to make sure we like the state of the world without these targets as we continue down this path.

Test: manual via adb: adb shell device_config get systemui share_use_service_targets false
Bug: 170144291
Change-Id: I8f1ef4b98e7068ff5ee7dbe12827ec4ec034e126
2020-10-06 16:58:15 -04:00
TreeHugger Robot
725daaceb9 Merge "Replace List<Integer> with faster IntArray." 2020-10-06 07:45:32 +00:00
Jeff Sharkey
345f5c7bec Replace List<Integer> with faster IntArray.
These were uncovered by the recently added EfficientCollections
Error Prone detector, and several of them are in hot codepaths.

Bug: 155703208
Test: make
Change-Id: I4cff2d6b846edc9a7482d21a803117132cbcdadf
2020-10-05 21:19:33 -06:00
Marcin Oczeretko
ed528d6eba Merge "Set CujType int values correctly" 2020-10-05 16:33:07 +00:00
Marcin Oczeretko
a0f3fd9906 Set CujType int values correctly
Test: run InteractionJankMonitorTest
Change-Id: Ibd5a2580dfd43b7ccfec90724eee73f575824e0a
Bug: 167170986
2020-10-05 14:01:14 +00:00
Zimuzo Ezeozue
2d9b034fdc Merge "Removed unused mount mode constants" 2020-10-05 12:15:34 +00:00
Zim
c8fe3d2acd Removed unused mount mode constants
Since FUSE in R, there are only 4 mount modes that are used
from IVold.aidl:

REMOUNT_MODE_NONE
REMOUNT_MODE_DEFAULT
REMOUNT_MODE_INSTALLER
REMOUNT_MODE_PASS_THROUGH
REMOUNT_MODE_ANDROID_WRITABLE

Bug: 148454884
Test: Manual
Change-Id: I62b66083f2099b429474872b6f9c7cffb9fb906d
2020-10-05 10:26:14 +01:00
TreeHugger Robot
b9ab0176b4 Merge changes I3bc46f80,Ic3126518
* changes:
  Upgrade AndroidFrameworkUid to be fatal error.
  Refine CompatChanges check and enable as error.
2020-10-02 22:13:33 +00:00
Jeff Sharkey
9af4aea0c3 Upgrade AndroidFrameworkUid to be fatal error.
We've fixed the one remaining example of code that accidentally
crosses UID with userId, so this change upgrades the check to become
a fatal build error to prevent future bugs.

Bug: 155703208
Test: atest error_prone_android_framework_test
Change-Id: I3bc46f8039a88b5f3d5f89dc9b5fda785d5c654f
2020-10-02 13:56:44 -06:00
Steven Moreland
25993a64d4 Merge "Move AIDL files to declared packages." am: 1f125fcd66 am: 66f6e3d77e am: 89d60ad686 am: e143e071d1 am: 21b0d25ba8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1445648

Change-Id: I128cd4bb43e648436318a42dbfef1f70930cbf38
2020-10-02 19:00:43 +00:00
Steven Moreland
21b0d25ba8 Merge "Move AIDL files to declared packages." am: 1f125fcd66 am: 66f6e3d77e am: 89d60ad686 am: e143e071d1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1445648

Change-Id: I089b2f50a38e05c785de35b41363b809c823caa7
2020-10-02 18:23:31 +00:00
Steven Moreland
e143e071d1 Merge "Move AIDL files to declared packages." am: 1f125fcd66 am: 66f6e3d77e am: 89d60ad686
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1445648

Change-Id: I7facecc0e6306e4c22d9b9b23d116c982197a38f
2020-10-02 18:03:08 +00:00
Steven Moreland
89d60ad686 Merge "Move AIDL files to declared packages." am: 1f125fcd66 am: 66f6e3d77e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1445648

Change-Id: Ibb810b6c18f3951679092072fc9f587acd7cf660
2020-10-02 17:35:21 +00:00
Diego Vela
b7e3d02925 Merge "Migrate System Logs to ProtoLog" 2020-10-02 16:47:56 +00:00
Steven Moreland
1f125fcd66 Merge "Move AIDL files to declared packages." 2020-10-02 16:37:24 +00:00
Rick Yiu
62b07cad0d Merge "Revert "Implement the ThreadPrioritySetter interface"" am: b01d0fe127 am: f7ac1ee91d am: 05a7df810c am: 149f54eb11 am: 545b3b4465
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1440013

Change-Id: I83d70f9d9b562240c5b1be88ed27ac0e5f6db528
2020-10-02 15:08:43 +00:00
Rick Yiu
545b3b4465 Merge "Revert "Implement the ThreadPrioritySetter interface"" am: b01d0fe127 am: f7ac1ee91d am: 05a7df810c am: 149f54eb11
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1440013

Change-Id: I3cd3845bd538a95676744d0976d963455a2949df
2020-10-02 14:06:22 +00:00
Rick Yiu
149f54eb11 Merge "Revert "Implement the ThreadPrioritySetter interface"" am: b01d0fe127 am: f7ac1ee91d am: 05a7df810c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1440013

Change-Id: I1c8d127cfa36748cc6115414c9887ecaec731a02
2020-10-02 13:46:49 +00:00
Rick Yiu
05a7df810c Merge "Revert "Implement the ThreadPrioritySetter interface"" am: b01d0fe127 am: f7ac1ee91d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1440013

Change-Id: Ic36f19df3a28d502f72a00ac41e25ddfb7011949
2020-10-02 13:15:21 +00:00
Diego Vela
d4411a519e Migrate System Logs to ProtoLog
Migrate logs for States and Tasks
Remove DEBUG_PAUSE flag
Remove DEBUG_SAVES_STATE flag
Remove DEBUG_STATES flag
Remove DEBUG_TASKS flag

Bug: 153162675
Test: n/a
Change-Id: I3811f58ff5c904dab0b1ff61d29d83d78ec1a121
2020-10-01 19:17:10 -07:00
Steven Moreland
844bd1dd1e Move AIDL files to declared packages.
There was a regression in the AIDL compiler recently that removed the
requirement that, like in Java, .aidl unstructured parcelables (these
parcelable declarations) are in directories and files which match their
packages and file names. This CL moves relevant files to the correct
directory required by their type.

Bug: N/A
Test: build
Change-Id: I71f6f714e98e184a02b6bbf3d4f8b0b8c8aee30b
2020-10-01 21:17:52 +00:00
TreeHugger Robot
563c312ecb Merge "Fix bug in ArrayUtils.filter." 2020-10-01 20:12:33 +00:00
Kweku Adams
0dd52ce64b Fix bug in ArrayUtils.filter.
ArrayUtils.filter is only supposed to return elements that satisfed the
predicate but it was incorrectly returning everything if nothing
satisfed the predicate.

Bug: 169854982
Test: Android builds
Change-Id: Ia6bd553922ff5823778e5865b6431c6f07aca334
2020-10-01 10:17:53 -07:00
Evan Rosky
5577b8f591 Merge "Scaffolding for Shell Transitions" 2020-09-30 22:37:20 +00:00
TreeHugger Robot
bf3fcf6ade Merge "Further refactor UidPermissionState and GIDs." 2020-09-30 22:01:01 +00:00
Evan Rosky
0dd1586bf7 Scaffolding for Shell Transitions
Initial rough implementation of Shell Transitions.

Shell Transitions can be enabled by setting ENABLE_SHELL_TRANSITIONS
via `adb shell setprop persist.debug.shell_transit 1`

The main structure behind this is:

- TransitionController in Core responsible for handling the
collection of transition participants and communicating with
the TransitionPlayer in Shell.

- Transitions in Shell responsible for starting transitions
and playing associated animations.

This initial version only supports task open/show/close and does
a simple fade. The flow is:
1. activityStarter calls to Transitions.requestStartTransition
2. Transitions will prepare to start and then call
   WindowOrganizerController.startTransition().
2. Various operations in Core call TransitionController.collect()
   to track participants. This collect() acts as a replacement for
   adding to mOpening/ClosingApps.
3. The legacy executeAppTransition() is wired into
   TransitionController.setReady() for now. This signal
   is used to ready a BLASTSyncEngine.
4. When all participants are done drawing, TransitionController
   will commit any showing visibility changes and then will construct
   a TransitionInfo object summarizing all the changes needed for
   animation. This gets sent to Transitions.onTransitionReady()
5. Transitions then plays the transition animation and on
   completion will call WindowOrganizerController.finishTransition()
   which will tell TransitionController to do any finishing
   work (like commiting deferred hide changes).

Bug: 161980187
Test: enable the flag and try opening/closing tasks. Also added
      TransitionControllerTests
Change-Id: I80c3a241fc12004a894c26523a1e5828e0c533ff
2020-09-30 11:36:35 -07:00
TreeHugger Robot
9920baf440 Merge "Add a command line interface to SystemUI" 2020-09-30 13:56:55 +00:00
Hai Zhang
e3a3105ce3 Further refactor UidPermissionState and GIDs.
The GIDs returned by the original permission state implementation in R
actually was never unique, but simply all GIDs from granted permission
concatenated together, and PERMISSION_OPERATION_SUCCESS_GIDS_CHANGED
was returned when the length of the GIDs changed. This is equivalent
to simply checking whether the permission whose grant state changed
has GIDs or not, and can greatly simplify the
logic. PERMISSION_OPERATION_SUCCESS_GIDS_CHANGED was only used in two
places anyway.

The original permission actually would never return
PERMISSION_OPERATION_FAILURE as well because it checks hasPermission()
beforehand and returns PERMISSION_OPERATION_SUCCESS if there's nothing
to change in grant/revokePermission(). The name
PERMISSION_OPERATION_FAILURE isn't a great name for unchanged anyway,
so grant/revokePermission() is now changed to simply return a boolean
for whether the permission state is changed.

The cache for isPermissionReviewRequired() is removed because it's
broken in subtle cases and iterating over an ArrayMap isn't a terrible
trade-off anyway, in exchange for simpler code and correct behavior.

Made removePermissionState() public so that code that actually wants
to erase the state permission doesn't need to perform a revocation
followed by updating all flags to 0.

Non-null arrays are preferred in APIs, the same as non-null
collections, so the GIDs-related APIs are updated to return non-null
int arrays as well. EmptyArray.INT is used instead of null so there
shouldn't be any performance penalty. Also ensured that the APIs are
returning copies instead of the original array to guard against
accidental mutation.

Bug: 158736025
Test: presubmit
Change-Id: I606210e18e5f8f87b8f8408fe476a72c2b7ed1c1
2020-09-29 15:24:45 -07:00
Ioana Stefan
88cefeb2c9 Merge "Add proto-based client side dumping for IME tracing" 2020-09-29 15:27:30 +00:00
Anmol Gupta
cf9e5123ce Add proto-based client side dumping for IME tracing
This CL implements a mechanism to dump IME related client states into
a proto file which can later be imported to winscope to allow easy
debugging. A new abstract class ImeTracing.java declares the methods
related to scheduling, collecting and dumping logs. Two child class
implement these methods for server and client separately.

The Design Doc for the IME tracing project is: go/ime-tracing

Bug: 154348613
Test: start trace by calling "adb shell ime tracing start"
      end trace by calling "adb shell ime tracing stop"
      pull trace using "adb pull /data/misc/wmtrace/ime_trace.pb ime_trace.pb"
Change-Id: Ia89f11d5ef8a220ea7746191b18769cea5a8359d
2020-09-29 15:05:18 +02:00
TreeHugger Robot
0f3fbe3e9f Merge "Optimize getting time_in_state for threads of system server" 2020-09-28 22:56:24 +00:00
Dmitri Plotnikov
2237efed88 Optimize getting time_in_state for threads of system server
Prior to this change, we would iterate over _all_ UIDs in
the system, select the one for SystemServer and then iterate over
_all_ threads in _all_ processes running under that UID.
This iteration involves reading many directories in /proc and
many files in those directories.

In the new implementation, we only read time_in_state for the
threads in the system server process itself, identifying them by
the PID.  This optimization reduces the cost 5:1 to 8:1 in terms
of CPU time, number of files read and amount of RAM used.

Bug: 167994570
Bug: 163063901

Test: atest FrameworksCoreTests:com.android.internal.os.SystemServerCpuThreadReaderTest
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryStatsTests
Test: atest FrameworksCoreTests:com.android.internal.os.KernelSingleProcessCpuThreadReaderTest
Change-Id: Iaa2eabc9f39999b2867bbffbac93b282cde74165
2020-09-28 15:32:42 -07:00
Alison Cichowlas
524de0729c Merge "When logging ranking positions, use the number of displayed targets in calculating offset rather than the total number available." 2020-09-28 17:32:41 +00:00
Ming-Shin Lu
57a7cd005c RESTRICT AUTOMERGE Reland "Fix showing keyboard without editor focused.." am: 44ecc735ec
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12716109

Change-Id: I798957b11099d3425c9219be3690b0f107ea3733
2020-09-28 15:36:12 +00:00
Nikita Dubrovsky
210c931b21 Merge "Update RichContentReceiver API (now OnReceiveContentCallback)" 2020-09-28 14:48:42 +00:00
Tiger Huang
b7d379147e Merge "Remove redundant logic about System UI visibility" 2020-09-28 13:30:22 +00:00
Ming-Shin Lu
44ecc735ec RESTRICT AUTOMERGE Reland "Fix showing keyboard without editor focused.."
Resolve SearchViewTest and InputMethodServiceTest failure when
landing CL[1] in QPR branch.

Also, CL[1] mentioned window focus behavior changes from R,
ignoring STATE_VISIBLE or STATE_ALWAYS_VISIBLE request doesn't enough
to fix unexpected keyboard visible issue when same window focused with
the above softInput flag without editor focus, since there is no
additional unspecified window focus to hide the current soft-input
as prior to R's behavior.

To fix that, we introduced new SoftInputShowHideReason to hide
soft-input when the same window focused without valid editor focus
after screen unlock, in order to align with the behavior prior to R.

[1]: I37ae6e30d1de581ba15131c2a90396b3a522a4d6

Bug: 161506356
Test: atest CtsInputMethodTestCases
Change-Id: Id51863a5b67d5d79d903adf43f19b52bd139e03f
2020-09-28 05:13:09 +00:00
Tiger Huang
a9b8fa272c Remove redundant logic about System UI visibility
This CL removes
- mSeq
- System UI flags used to communicate between WMS and System UI
- redundant AIDL methods
- redundant fields and methods
- redundant tests
- PolicyControl

This CL also
- refines the format in DisplayPolicy#dump
- sends a boolean to InputManager to indicate if System UI is in a low
  profile mode instead of sending the legacy system UI visibility

Bug: 149813814
Fix: 169105126
Test: presubmit
Test: dumpsys window displays
Test: See if the layout of ImmersiveModeConfirmation is as expected
Change-Id: I8c8df509355bebc9b560af57d5458614557bcd2f
2020-09-28 02:04:21 +08:00
Rick Yiu
e5ae45f7b0 Revert "Implement the ThreadPrioritySetter interface"
Revert submission 1202786-setpriority

Reason for revert: will cause lock contention

Bug: 139521784
Test: build pass
Change-Id: I863fd0c1623ad7fe73a192400389d25bf9e75e90
2020-09-27 03:13:13 +00:00
Alison Cichowlas
b17dbd20c3 When logging ranking positions, use the number of displayed targets
in calculating offset rather than the total number available.

Test: ChooserActivityTest; log inspection
Bug: 169344682
Change-Id: I40c841bf0f3e1cf90b0e4998bde1c9e8009c09c5
2020-09-25 21:58:37 -04:00
Alison Cichowlas
b6ac2afd21 Merge "Fix handling of bad image previews." into rvc-qpr-dev am: a102616d48
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12684870

Change-Id: Id4d3c2c864c512e4d57d6552b0b357a2f3c60cf0
2020-09-25 21:16:39 +00:00
Alison Cichowlas
a102616d48 Merge "Fix handling of bad image previews." into rvc-qpr-dev 2020-09-25 20:55:20 +00:00
Nikita Dubrovsky
dd9869aa4c Update RichContentReceiver API (now OnReceiveContentCallback)
Bug: 163718378
Bug: 165632620
Bug: 152068298
Test: Unit tests
  atest CtsWidgetTestCases:TextViewOnReceiveContentCallbackTest
  atest CtsViewTestCases:ViewTest
  atest FrameworksCoreTests:TextViewProcessTextTest
Change-Id: I3fa65b47c920a9d1ddad88a79e60864dc8109753
2020-09-25 13:46:33 -07:00
TreeHugger Robot
343552e1fc Merge "Fix showing keyboard without editor focused in some cases (1-2/2)" 2020-09-25 13:31:09 +00:00
Song Hu
943c807473 DO NOT MERGE Put parameterized weights on top two sharing shortcuts of each app as per shortcuts native ranking in PeopleService Sharesheet model. am: eedf47cbf5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12684673

Change-Id: I29e0c19f954fc6ce8538a2300279a42120569106
2020-09-25 07:50:55 +00:00
Jack Yu
faed183a3e Refactored precise data connection state am: 4f2a849e25 am: fe0c690850 am: f35a5d5a29 am: 74c958e231
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1436356

Change-Id: Ia5187ba67493581a1c99caebe20edd8c1d9374ad
2020-09-25 07:46:00 +00:00
Jack Yu
74c958e231 Refactored precise data connection state am: 4f2a849e25 am: fe0c690850 am: f35a5d5a29
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1436356

Change-Id: Ic429d239e35c2a9710a76f99e4940852a8e79ebe
2020-09-25 07:20:18 +00:00
Jack Yu
f35a5d5a29 Refactored precise data connection state am: 4f2a849e25 am: fe0c690850
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1436356

Change-Id: I68141d930749f2f787e27c1c6eabb488a76fec0f
2020-09-25 07:09:40 +00:00
Jack Yu
fe0c690850 Refactored precise data connection state am: 4f2a849e25
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1436356

Change-Id: I862dacbe476e5b1150dfbdf14128686683e62914
2020-09-25 06:22:18 +00:00
Thierry Strudel
05eef64cc1 Merge "BatteryStatsImpl: Add mBatteryTimeToFull to parcel" am: dee14d2d86 am: b88e1801bd am: 3605379546
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1430103

Change-Id: I65c570ba130fe451e7cdfaceac7545c42609278c
2020-09-25 06:04:16 +00:00