Commit Graph

14816 Commits

Author SHA1 Message Date
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
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
Thierry Strudel
3605379546 Merge "BatteryStatsImpl: Add mBatteryTimeToFull to parcel" am: dee14d2d86 am: b88e1801bd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1430103

Change-Id: I70db8c89be99a8098058a67fb1a2a1d8aafb7201
2020-09-25 05:52:45 +00:00
TreeHugger Robot
e68ed78095 Merge "BatteryStatsImpl: Add mBatteryTimeToFull to parcel" into rvc-qpr-dev am: 1c98cc2848
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12680236

Change-Id: I0f1f099086697726bd86f724d257946a8fc096b9
2020-09-25 05:26:13 +00:00
Song Hu
eedf47cbf5 DO NOT MERGE Put parameterized weights on top two sharing shortcuts of each app as per shortcuts native ranking in PeopleService Sharesheet model.
By default weights are 0 which ensures ranking same as what it is now.

Bug: 168212835
Test: atest com.android.server.people.prediction.SharesheetModelScorerTest
Change-Id: I02eaa5b6a448c33b51e5f4c6acaba93e7a2bd995
2020-09-24 22:18:49 -07:00
Jack Yu
24f4fce2df Merge changes from topics "pdcs_builder", "pdcs_cleanup", "refactor_pdcs", "remove_apn_name_types", "transport_type_and_id"
* changes:
  Added hashcode for ApnSetting class
  Refactored precise data connection state
  Added transport type and id in precise data connection state
  Removed APN name and types from PreciseDataConnectionState
  Added builder for PreciseDataConnectionState
  Remove Deprecated-At-Birth APIs from PDCS
2020-09-25 04:18:21 +00:00
vadimt
36b9b0819e Adding CUJ types for Launcher
Test: compilation
Bug: 169220800
Bug: 169220955
Bug: 169221267
Bug: 169220924
Bug: 169220843
Change-Id: I57e70c310e17e860cce679eabd23a5b67bbcf50e
2020-09-24 16:58:00 -07:00
TreeHugger Robot
1c98cc2848 Merge "BatteryStatsImpl: Add mBatteryTimeToFull to parcel" into rvc-qpr-dev 2020-09-24 23:40:57 +00:00
Jack Yu
4f2a849e25 Refactored precise data connection state
Instead of triggering the data connection state changed
event from outside, now the event is triggering from
DataConnection. Whenever detecting data connection
state changes, the event will be triggered. This significantly
reduced the unnecessary redundant events sent to telephony registry,
even though it has a duplicate detection mechanism.

This are also two behavioral changes.

1. Previously if a data connection supports multiple APN types,
there will be multiple data connection state changed event for
each APN type. Now there is only one. The listener should use
PreciseDataConnectionState.getApnSetting().getApnTypeBitmask()
to check which APN types this data connection supports.

2. If setup data call fails before a data connection instance
can be created, there won't be any event with fail cause.

Fix: 161572838
Test: FrameworksTelephonyTests and manual
Merged-In: I9723d5284c2a8fbae9f63179dc30ddc42da1d0fc
Change-Id: I9723d5284c2a8fbae9f63179dc30ddc42da1d0fc
(cherry picked from commit 34a09a4cbd)
2020-09-24 09:57:50 -07:00
Winson Chung
b4431aaf34 Merge "Account for cutouts in system insets (as done previously)" into rvc-qpr-dev am: a03cd95a12
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12656267

Change-Id: Id6c6f022bd57ed103c0f37a9d09eec4a29d84352
2020-09-24 16:49:06 +00:00
Winson Chung
a03cd95a12 Merge "Account for cutouts in system insets (as done previously)" into rvc-qpr-dev 2020-09-24 16:45:18 +00:00
Ming-Shin Lu
9d63d35578 Fix showing keyboard without editor focused in some cases (1-2/2)
As 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: I20e8076acc5fec3c055af0740e2e2a64b1fb6f0d
2020-09-24 23:23:47 +08:00
TreeHugger Robot
87696c9b8e Merge "SystemConfig: Tolerate absent native lib paths." 2020-09-24 13:35:25 +00:00
Alison Cichowlas
208b157b8d Fix handling of bad image previews.
When the image preview fails (eg for permissions or timeout) the entire
system area is removed. This prevents the user from using Nearby.

Instead, when the image preview fails, we should hide only the image
preview and leave the rest of the system area intact.

Bug: 168557188
Test: ChooserActivityTest; manual inspection
Change-Id: I49190c1fbc4e25b3d2e2802a90de355bff297f7e
(cherry picked from commit ba027fad91)
2020-09-24 13:18:25 +00:00
Alison Cichowlas
a0d41416fc Merge "Fix handling of bad image previews." 2020-09-24 13:18:01 +00:00
Tobias Thierer
8f036fd454 SystemConfig: Tolerate absent native lib paths.
SystemConfig.readPublicNativeLibrariesList() has some hard-coded
paths containing public.libraries*.txt files; these are not
present when this code runs outside of an Android device, for
example in a Robolectric test on host.

This CL changes the code to log a warning, rather than crash,
when one of those folders is missing or inaccessible. Note that
this increases the chance that a future breakage will be missed,
but there already was not test coverage for the method behaving
correctly.

Fixes: 169017157
Test: Checked that the following fails before this but passes
      after this CL: atest BackupManagerServiceRoboTest

Change-Id: Id8430ea68901ce60dcc855f7013bafadea823297
2020-09-24 12:07:23 +00:00
Fiona Campbell
1cce0c2f38 Merge "Persist screen brightness setting through upgrade" 2020-09-24 07:24:39 +00:00
Stephane Lee
f2bfb467e9 BatteryStatsImpl: Add mBatteryTimeToFull to parcel
Bug: 163342637
Test: Ensure that both Settings/SystemUI ttf are synchronized
Change-Id: I66121858972bc110c9d7422348ea0217e4e3862d
Merged-In: I844149d4787e3aef7808bb4f85b0f08d179c5c41
(cherry picked from commit 4b967a454e)
2020-09-23 23:34:42 -07:00
Stephane Lee
3d4cba5628 BatteryStatsImpl: Add mBatteryTimeToFull to parcel
Bug: 163342637
Test: Ensure that both Settings/SystemUI ttf are synchronized
Change-Id: I844149d4787e3aef7808bb4f85b0f08d179c5c41
Merged-In: I844149d4787e3aef7808bb4f85b0f08d179c5c41
(cherry picked from commit 4b967a454e)
2020-09-23 23:09:11 -07:00