Commit Graph

17495 Commits

Author SHA1 Message Date
Rhed Jao
5b39a5111d Merge "Dump overlay configurations to the bugreport" 2021-09-27 02:19:51 +00:00
TreeHugger Robot
cae5560e88 Merge "Create XML parser only once." 2021-09-24 23:22:13 +00:00
TreeHugger Robot
085b3212ed Merge "Show nearby share as normal app target and in first item always" 2021-09-24 14:33:14 +00:00
Zhen Zhang
8077327624 Show nearby share as normal app target and in first item always
Show nearby share as a normal app target instead of action button. And
always put it as the first item in App prediction Row. The change is
gaurded by lowRamDevice flag and experiment flag. by default, there is
no change to current behavior. One needs to run command 'adb shell
device_config put systemui is_nearby_share_first_target_in_ranked_app true' on
Android Go devices to see the effect.

Bug: 197241083
Test: atest ResolverListControllerTest
Test: atest AbstractResolverComparatorTest
Test: atest ResolverActivityTest
Test: atest ChooserActivityTest (no new failure)

Change-Id: I22106e382e0d96fc760e4a9fb94be3ae293c8497
2021-09-24 09:19:49 +00:00
Alex Buynytskyy
0c39dd02f6 Create XML parser only once.
This greatly cuts memory usage: 2.5M -> 0.5M (see bug for traces).

Bug: 200995209
Test: atest SystemConfigTest SystemConfigNamedActorTest
Change-Id: I0b76dc2610afaad3e418ef3115c5e54a05ab334e
2021-09-23 15:36:59 -07:00
Rhed Jao
5487d16c81 Dump overlay configurations to the bugreport
Bug: 200250601
Test: adb bugreport
Change-Id: I912c94a44b0592349324d6f74a8685997b2a7601
2021-09-23 20:52:27 +08:00
Rhed Jao
48004fb004 Merge "Fix an IllegalStateException in the OverlayConfigParser" 2021-09-23 03:26:26 +00:00
Mark Renouf
e86123e6d0 Merge "Clean up and expand long screenshots test coverage" 2021-09-22 19:15:27 +00:00
Mark Renouf
1ad5211818 Clean up and expand long screenshots test coverage
This combines two nearly duplicate sets of tests into a single reusable
base test class and adds test coverage for ListViewCaptureHelper and
WebViewCaptureHelperTest.

The tests cover scrolling, bounds checking and clipping and ensure
the captured region is centered vertically within the visible bounds.

Bug: 195109744
Test: atest ListViewCaptureHelperTest RecyclerViewCaptureHelperTest \
      ScrollViewCaptureHelperTest WebViewCaptureHelperTest
Change-Id: Ia533d38238d2a0e0f44358d2033394ad1d70487f
2021-09-22 12:36:30 -04:00
Rhed Jao
b62f02cb14 Fix an IllegalStateException in the OverlayConfigParser
The issue could be reproduced when the device defined an
overlay configuration file and an overlay package which
was in the configuration file also declared the required
system property in its manifest. The device works fine when
the required system property matches the corresponding
value on the device. But an IllegalStateException was thrown
from the system if it didn't match.

The root cause is that the package parser fails to parse the
overlay package if the required system property in the manifest
does not match the corresponding value on the device. It resulted
in the OverlayConfigParser could not find the package present
in the partition and throws the exception.

To resolve this issue, this CL skips the overlay configuration
if the package not found was caused by the system property
conditionon on the device.

Bug: 193422327
Test: atest OverlayConfigTest
Change-Id: I5650d796d92e3c4825b0d035e8e3b18f36d4cb47
2021-09-22 17:15:35 +08:00
TreeHugger Robot
f8a759f254 Merge "Preserve invocation order in RemoteInputConnection" 2021-09-18 02:49:46 +00:00
Dmitri Plotnikov
0a426db7f0 Merge "Drop per-app measured energy when an OTA changes the set of energy components" 2021-09-17 23:10:03 +00:00
Dmitri Plotnikov
9cb960304e Drop per-app measured energy when an OTA changes the set of energy components
Bug: 200123115
Test: atest BatteryStatsTests
Change-Id: I750a5c9fa3faa9757625b2d2494df1484b68016d
2021-09-17 13:04:13 -07:00
Bernardo Rufino
3cd2231fed Merge "Remove sendCloseSystemDialogs() from PhoneFallbackEventHandler" into sc-qpr1-dev am: d9ba2df119 am: 5a2619c678 am: 2e3c6e5724
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15836011

Change-Id: I49e47a24a5aacc746d9e9e3e67cad42c75a38b16
2021-09-17 15:56:07 +00:00
Bernardo Rufino
2e3c6e5724 Merge "Remove sendCloseSystemDialogs() from PhoneFallbackEventHandler" into sc-qpr1-dev am: d9ba2df119 am: 5a2619c678
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15836011

Change-Id: I0665dc366b5dd14ddacc61ad882770f36ff79456
2021-09-17 15:43:59 +00:00
Bernardo Rufino
5a2619c678 Merge "Remove sendCloseSystemDialogs() from PhoneFallbackEventHandler" into sc-qpr1-dev am: d9ba2df119
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15836011

Change-Id: I9a03f509116603c2286b2c385af4587bd8dd9b09
2021-09-17 15:29:37 +00:00
Bernardo Rufino
d9ba2df119 Merge "Remove sendCloseSystemDialogs() from PhoneFallbackEventHandler" into sc-qpr1-dev 2021-09-17 15:15:48 +00:00
Yohei Yukawa
8821afef81 Preserve invocation order in RemoteInputConnection
This is a follow up CL to our previous CL [1], which introduced
early-exit paths to some RemoteInputConnection methods to protect
innocent IME clients from unexpected process crashes when an IME is
calling InputConnection APIs with invalid parameters.

Although protecting IME clients from crashes still makes much sense,
implementing it as an early-exit style in RemoteInputConnection may
expose observable inconsistency to IME developers in terms of the fact
that InputConnection#getText{Before,After}Cursor() can also work as a
fence operation that would not return until all the previously issued
InputConnection API invocations are handled in the IME client side.

With this CL, the following methods start behaving as a fence
operation even when an invalid parameter is passed, by checking the
parameters in the IME client side.

 * RemoteInputConnection#getTextAfterCursor()
 * RemoteInputConnection#getTextBeforeCursor()
 * RemoteInputConnection#getSurroundingText()

There should be no performance impact for IMEs that do not make such
an invalid (and unnecessary) API calls.

 [1]: I95169735198f8363c981a61e20234dfebfd645b1
      1e72ef2893

Bug: 169114026
Fix: 194110780
Test: atest CtsInputMethodTestCases:InputConnectionEndToEndTest
Change-Id: Ie0c18d0c9b8bf8f02f2fcdca5aac7e580c6bf2cd
2021-09-16 16:17:09 -07:00
Alex Buynytskyy
19f8adfbdf Cache least recently used output buffer.
- reduce memory allocations especially when Xml is serialized inside a
tight inner loop,
- performance slightly improved.

BEFORE:
100 packages:
[2/4] android.util.XmlPerfTest#timeWrite_Binary: PASSED (10.516s)
	timeWrite_Binary_mean: 674979
	threadAllocCount_mean: 59
	timeWrite_Binary_min: 671194
	timeWrite_Binary_median: 674798
	timeWrite_Binary_standardDeviation: 3658
	threadAllocSize_mean: 530176
10 packages:
[2/4] android.util.XmlPerfTest#timeWrite_Binary: PASSED (10.542s)
	timeWrite_Binary_mean: 71113
	threadAllocCount_mean: 56
	timeWrite_Binary_min: 70201
	timeWrite_Binary_median: 71237
	timeWrite_Binary_standardDeviation: 692
	threadAllocSize_mean: 59136
1 package:
[2/4] android.util.XmlPerfTest#timeWrite_Binary: PASSED (10.091s)
	timeWrite_Binary_mean: 15698
	threadAllocCount_mean: 56
	timeWrite_Binary_min: 15072
	timeWrite_Binary_median: 15677
	timeWrite_Binary_standardDeviation: 410
	threadAllocSize_mean: 6439

AFTER:
100 packages:
[1/1] android.util.XmlPerfTest#timeWrite_Binary: PASSED (10.221s)
	timeWrite_Binary_mean: 605862
	threadAllocCount_mean: 53
	timeWrite_Binary_min: 602353
	timeWrite_Binary_median: 604424
	timeWrite_Binary_standardDeviation: 4972
	threadAllocSize_mean: 492748
10 packages:
[1/1] android.util.XmlPerfTest#timeWrite_Binary: PASSED (10.575s)
	timeWrite_Binary_mean: 58710
	threadAllocCount_mean: 50
	timeWrite_Binary_min: 57551
	timeWrite_Binary_median: 57798
	timeWrite_Binary_standardDeviation: 2129
	threadAllocSize_mean: 21696
1 package:
[1/1] android.util.XmlPerfTest#timeWrite_Binary: PASSED (10.151s)
	timeWrite_Binary_mean: 11576
	threadAllocCount_mean: 50
	timeWrite_Binary_min: 11315
	timeWrite_Binary_median: 11381
	timeWrite_Binary_standardDeviation: 431
	threadAllocSize_mean: 4336

Test: atest FastDataPerfTest XmlPerfTest
Bug: 195994150
Fixes: 195994150

Change-Id: Ieedd27a676d718967c2fac30bc48a68ae636a180
2021-09-16 19:06:31 +00:00
Miranda Kephart
cf97f51c3d Merge "Fix direct share badges when sharing on work/personal profiles" into sc-qpr1-dev am: b51d58e6fd am: 0d5e670809 am: 6f87f6c3e6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15839049

Change-Id: I42d1724d8c892e0e9dba196eff6ec21cd3b3f3b5
2021-09-16 14:29:27 +00:00
Miranda Kephart
6f87f6c3e6 Merge "Fix direct share badges when sharing on work/personal profiles" into sc-qpr1-dev am: b51d58e6fd am: 0d5e670809
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15839049

Change-Id: Id5d2b3c70e7422e0040a927f3b778beb54bf297c
2021-09-16 14:14:04 +00:00
Miranda Kephart
0d5e670809 Merge "Fix direct share badges when sharing on work/personal profiles" into sc-qpr1-dev am: b51d58e6fd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15839049

Change-Id: I4ff949f7732fd4915b835e33a466165ab9d3c4f4
2021-09-16 14:03:52 +00:00
Joshua Trask
2e1a507ae7 Merge "Fix (still-disabled) sharesheet "token flow."" 2021-09-16 13:52:19 +00:00
Dmitri Plotnikov
f98c930e7c Merge "Add LongArrayMultiStateCounter.reset() and setEnabled()" 2021-09-16 01:56:16 +00:00
Miranda Kephart
63fe7d7343 Fix direct share badges when sharing on work/personal profiles
Use the passed-in user instead of the current user to determine
whether or not to add the work profile badge to direct share
target app icons, so that personal share targets do not have the
badge (even when sharing something from the work profile) and
work/managed share targets do have it (even when sharing something
from the personal profile).

Test: manual; tested appearance sharing from personal->work and
from work->personal
Bug: 197388251
Fix: 197388251

Change-Id: Ieee50d46e8058a92efa5be8aae9859447531c270
2021-09-15 15:20:14 -04:00
Joshua Trask
2ed0753a2e Fix (still-disabled) sharesheet "token flow."
Per b/132321687, we need to leave the system-side share
activity open (not call finish()) until the SysUI-side
chooser finishes, or else we'll invalidate the start-
activity token that the SysUI (delegate) chooser needs
when it launches the target activity.

Note that the delegated flow is still disabled by the
flag in DisplayResolveInfo.

Bug: 132321687,199743918
Test: Reproduced crash condition & confirmed fix manually.
Change-Id: Ic467dfe4eb417ca846c0ecf2e8a0067bd5275e9f
2021-09-15 13:58:38 -04:00
Yohei Yukawa
e8424ef600 Deprecate MissingMethodFlags to preserve invocation order
This CL effectively replaces my previous CL [1], which made
unimplemented methods in InputConnection not fatal errors, with a
simplified implementation that still gracefully take care of
unimplemented methods without causing app crashes.

Instead of propagating missing method information from the IME client
to the IME process, this CL will simply catch AbstractMethodError in
the IME client process.  Doing so enables us to

 1. preserve the strict invocation order of InputConnection APIs, and
 2. achieve the same goal with fewer lines of code.

The additional cost of throwing (and catching) AbstractMethodError
every time the IME calls an unimplemented InputConnection API can be
justified as it is really an exceptional scenario, and avoiding it
would require extra maintenance cost as seen in
InputConnectionInspector.

The above overhead (and complexity) due to AbstractMethodError can be
avoided by adding default implementations to those InputConnection
APIs, but doing so requires API signature update hence API council
approval to go ahead, which is to be discussed in Bug 199934664.

 [1]: I3c58fadd924fad72cb984f0c23d3099fd0295c64
      19a80a1e80

Bug: 27407234
Bug: 27642734
Bug: 27650039
Bug: 194110780
Test: atest CtsInputMethodTestCases
Change-Id: I9e801e92496a6e16cee37664870c97ed096f1413
2021-09-15 10:03:20 -07:00
Bernardo Rufino
1538b7fda7 Remove sendCloseSystemDialogs() from PhoneFallbackEventHandler
Today's flow of events is like this: key goes to focused app
(ViewRootImpl::processKeyEvent), the view hierarchy does not handle the
event, so ViewRootImpl uses FallbackEventHandler to invoke the fallback
action for this key.

The problem is that for many keys the app itself is closing system
dialogs before taking the appropriate action (often launching an
activity, eg. dialer for KEYCODE_CALL), but this is now prohibited in S
due to abuse of said action.

The long-term plan is to return to InputDispatcher the fact that the key
wasn't handled by the app and have ID call out to the policy, which will
launch the appropriate action and adjust the UI as it sees fit (close
system dialogs).

However, we need to prevent apps from crashing because of this, hence
this change for S still. The unfortunate effect is that system dialogs
won't be hidden in these cases, but this livable with until we properly
implement the infrastructure.

Bug: 199173862
Test: Simulate code-paths with affected keys and make sure apps don't
      crash:
      1. adb shell input keyevent --longpress KEYCODE_CALL
      2. adb shell input keyevent --longpress KEYCODE_CAMERA
Change-Id: I44ad41ac1eac9acc8320298ceb4c1b21bde8af5d
2021-09-15 15:25:47 +01:00
Wu Ahan
7af1589311 Merge "Add latency instrument point for ACTION_TURN_ON_SCREEN" into sc-v2-dev am: d0b1d557e9 am: 2feb569bed
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15271990

Change-Id: I38257099c72fd8941b3901f0bfe3cae8cf9951fe
2021-09-15 03:09:07 +00:00
Wu Ahan
2feb569bed Merge "Add latency instrument point for ACTION_TURN_ON_SCREEN" into sc-v2-dev am: d0b1d557e9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15271990

Change-Id: I41abfb32db86fca9feb39f4b8b5439a6071ea6e2
2021-09-15 02:50:09 +00:00
Wu Ahan
d0b1d557e9 Merge "Add latency instrument point for ACTION_TURN_ON_SCREEN" into sc-v2-dev 2021-09-15 02:33:51 +00:00
Dmitri Plotnikov
b934671543 Add LongArrayMultiStateCounter.reset() and setEnabled()
Bug: 197162116
Test: atest FrameworksCoreTests:LongArrayMultiStateCounterTest
Change-Id: I2f05c2ce56eaa52835fb350ecb0e5e4408f6b879
2021-09-15 01:04:44 +00:00
Dmitri Plotnikov
c1fa3a71f3 Merge "Make LongArrayMultiStateCounter parcelable" 2021-09-15 01:03:18 +00:00
Mark Renouf
9f7e10b7c1 Merge "No longer block the main thread on rendering" 2021-09-14 23:45:18 +00:00
Gaurav Bhola
8b57638362 Merge "Move the NotificationAccessConfirmationActivity component name to resource config so that it can be overlayed." into sc-v2-dev am: 9260cf2831 am: 3cd5455405
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15634240

Change-Id: I6f3ffc1333bee3ba17010b6d32a44c2167350932
2021-09-14 19:53:31 +00:00
Dmitri Plotnikov
e5292b4a24 Make LongArrayMultiStateCounter parcelable
Bug: 197162116
Test: atest FrameworksCoreTests:LongArrayMultiStateCounterTest
      atest CorePerfTests:LongArrayMultiStateCounterPerfTest

Change-Id: Ibc94620f2f106695fa7f17fc0737496f0e32ba48
2021-09-14 12:40:56 -07:00
Gaurav Bhola
3cd5455405 Merge "Move the NotificationAccessConfirmationActivity component name to resource config so that it can be overlayed." into sc-v2-dev am: 9260cf2831
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15634240

Change-Id: I8a97b36fb9e58ba97cab7c96dbe85ec02a969c05
2021-09-14 19:38:05 +00:00
Gaurav Bhola
9260cf2831 Merge "Move the NotificationAccessConfirmationActivity component name to resource config so that it can be overlayed." into sc-v2-dev 2021-09-14 19:25:04 +00:00
TreeHugger Robot
14086099fb Merge "Optimize InputConnection tracing logic a bit" 2021-09-14 18:53:58 +00:00
Daniel Olusakin
686b2cb516 Merge "Add resolved label to identifier when grouping targets for the alphabetical list" 2021-09-14 18:52:31 +00:00
PETER LIANG
cf1882754f Merge "Fix the title of the HW "Edit shortcuts" menu is truncated when the device is folded." into sc-v2-dev am: d596ae37f4 am: d60338ea9e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15746905

Change-Id: I9ed753fdb47b5590992d6d65f8c8d6c894d038f4
2021-09-14 04:24:03 +00:00
PETER LIANG
d60338ea9e Merge "Fix the title of the HW "Edit shortcuts" menu is truncated when the device is folded." into sc-v2-dev am: d596ae37f4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15746905

Change-Id: I2f993d298f539259506d499a242baa4a24ad487b
2021-09-14 04:08:58 +00:00
PETER LIANG
d596ae37f4 Merge "Fix the title of the HW "Edit shortcuts" menu is truncated when the device is folded." into sc-v2-dev 2021-09-14 03:58:38 +00:00
TreeHugger Robot
07589854d1 Merge "Integrate LongArrayMultiStateCounter with eBPF based time-in-state" 2021-09-13 23:11:26 +00:00
Yohei Yukawa
7cbc9bdf31 Optimize InputConnection tracing logic a bit
This CL is a follow up CL to our previous CL [1], which introduced
InputConnection logging as part of IME tracing project.

The goal of this CL is to consolidate RemoteInputConnectionImpl by
separating core business logic from orthogonal concept such as method
tracing, without sacrificing the runtime performance.

With this CL, both code and string resource duplicates will be
actually reduced.  There is no additional object allocation unless the
IME tracing is explicitly enabled.

 [1]: Iabd6af1b858803030848a0ef5e7dd9ecfc562716
      0653b692d1

Bug: 154348613
Bug: 192412909
Test: Manually verified that the IC tracing is still working
Change-Id: I329129241bdae231844dc3170faf9e8d11f49f08
2021-09-13 15:44:01 -07:00
Mark Renouf
72becb3095 No longer block the main thread on rendering
This change removes the use of setWaitForPresent(true)
on the FrameRenderRequest. This allows the method to return
as soon as the request is synced to the RenderThread and
no longer block while the frame is drawn.

Depends on ag/15411889

Bug: 194927650
Test: manual, capture long screenshot
Change-Id: I93795f3aad52067e52d3614982fd871de4f3432e
2021-09-13 21:17:31 +00:00
Daniel Olusakin
876a366043 Add resolved label to identifier when grouping targets for the alphabetical list
Change-Id: I168bd6f69660d401c98c50d450ab2155d3814a8e
2021-09-13 20:11:55 +00:00
Ahan Wu
767bae370b Add latency instrument point for ACTION_TURN_ON_SCREEN
We missed LatencyTracker.ACTION_TURN_ON_SCREEN, add proper instrument
point.

Bug: 188626939
Test: atest
Change-Id: If366a8bcbda41087dd1255110f4f60a8970cca15
2021-09-13 11:57:46 -08:00
TreeHugger Robot
4d16327f62 Merge "Stop lying about MissingMethodFlags.REQUEST_CURSOR_UPDATES" 2021-09-13 17:27:34 +00:00
Pavel Grafov
bc68f7d3df Merge "Respect PASSWORD_QUALITY_MANAGED for biometrics" into sc-qpr1-dev am: a238881ee0 am: d730a09568 am: 58ac1483e5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15778512

Change-Id: Id0dbd193a8bd961451451fcd74756d7a9c2fd7e4
2021-09-13 14:33:14 +00:00