Commit Graph

2646 Commits

Author SHA1 Message Date
Jeff Sharkey
305ef9e1cf Migrate hot codepaths to formatSimple().
The recently added TextUtils.formatSimple() can efficiently format
simple strings, roughly 6.5x faster than using String.format().

This change starts using this new method in hot codepaths identified
from pprof traces, and this CL alone should reduce system_process CPU
usage by 0.24%.  Linked bug has detailed pprof screenshots.

Bug: 170978902
Test: atest FrameworksCoreTests:android.text.TextUtilsTest
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: Ie5a21a24be6dfcdb29768fe235e20f050fc111c7
2020-10-22 12:48:13 -06:00
Jeff Sharkey
1992cdb4de Merge changes from topic "oct16c"
* changes:
  Apply fixes for EfficientStrings.
  Apply fixes for EfficientStrings.
  Apply fixes for EfficientStringsChecker.
  Apply fixes for EfficientCollections.
  Trivial refactor for consistent naming.
  Expand formatSimple() to support widths.
  Refinement of EfficientStringsChecker.
2020-10-21 15:27:15 +00:00
Tiger Huang
9e2c966d61 Merge "Don't dispatch legacy insets to client" 2020-10-21 15:23:27 +00:00
Tiger Huang
2bf8c796c5 Don't dispatch legacy insets to client
The server won't dispatch the legacy content insets, stable insets, and
visible insets to the client. The insets would be computed from the
insets state by the client.

This CL also fixes the insets scaling issue in compatible mode.

Bug: 149813814
Fix: 169940916
Fix: 165412978
Test: atest WindowAddRemovePerfTest InsetsAnimationControlImplTest
            ActivityRecordTests DisplayPolicyLayoutTests
            InsetsPolicyTest InsetsStateControllerTest
Change-Id: I83570973f587a6abf887752494f750b46e3e484d
2020-10-21 20:20:21 +08:00
Jeff Sharkey
1c08f48253 Apply fixes for EfficientStringsChecker.
The recently-built Error Prone checker has found many instances where
we're always paying the cost of StringBuilder concatenation, even in
the typical cases where preconditions are successfully met.

Benchmarks have shown that even when replacing these with varargs
formatter strings, the default case is 20x faster.

Bug: 170978902
Test: none
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: If8c00bc73467bfb91ec16c162969c9d26ca53646
2020-10-20 22:00:16 -06:00
Anton Hansson
586a3cf229 Remove @TestApi from @SystemApi symbols
I ran these commands:
    cd frameworks/base
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@SystemApi[\s\n]+(\@\w+[\s\n]+)?\@TestApi/\@SystemApi\1/gs'
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@TestApi[\s\n]+(\@\w+[\s\n]+)?\@SystemApi/\1\@SystemApi/gs'

Bug: 171179806
Test: m checkapi
Change-Id: I772790b783b0a8730b8bf680c9e569a886b8d789
2020-10-20 09:04:03 +01:00
Tiger Huang
e1833c6cfd Merge "Make the requested visibility always up-to-date" 2020-10-17 09:18:03 +00:00
Nicholas Ambur
7466c85160 Merge "update AlwaysOnHotwordDetector javadoc" 2020-10-16 17:09:14 +00:00
Tiger Huang
bf015c77b4 Make the requested visibility always up-to-date
The new logic sends the requested visibility to server even when the
client doesn't have a control. This makes the requested visibility
reliable at the server side.

This CL also changes getRequestedState to getRequestedVisibility in
WindowState, because the frames in getRequestedState are not reliable.

Fix: 161247175
Fix: 166819574
Test: atest DisplayPolicyLayoutTests DisplayPolicyTests InsetsPolicyTest
            InsetsSourceProviderTest InsetsStateControllerTest
            WindowStateTests InsetsAnimationControlImplTest
            InsetsControllerTest WindowAddRemovePerfTest
            ActivityRecordTests
Change-Id: I7d32dacaa1302bab61386f5bd69aaa7dde953ebe
2020-10-16 16:38:08 +08:00
TreeHugger Robot
855b94d7d7 Merge "Add the reason why a save dialog was not shown to FillEventHistory." 2020-10-16 03:21:16 +00:00
Roman Kalukiewicz
34573d564a Merge "Add @Nullable annotation to the parameter of Object.equals() methods." 2020-10-16 01:25:15 +00:00
Nicholas Ambur
b1fce32b42 update AlwaysOnHotwordDetector javadoc
Update AlwaysOnHotwordDetector.Callback#onAvailabilityChanged API
documentation to reflect its current behavior.

Test: N/A
Bug: 170681090
Change-Id: I6b16b527a521af66367caaeeb28cc73ae22b0272
2020-10-15 17:41:09 -07:00
TreeHugger Robot
376619a9d9 Merge "Fix dream letterboxed when there is a cutout" 2020-10-15 19:05:55 +00:00
Roman Kalukiewicz
24403f7ef2 Add @Nullable annotation to the parameter of Object.equals() methods.
Those annotations could be inferred by some tools (like Kotlin), but the
https://checkerframework.org/ doesn't check inherited annotations
complaining about all equals() invocations that get nullable argument.

The change was generated by running

find . -name \*.java | xargs sed -i 's/public boolean equals(Object /public boolean equals(@Nullable Object /'

in the frameworks/base directory and by automatically adding and
formatting required imports if needed. No manual edits.

Bug: 170883422
Test: Annotation change only. Should have not impact.
Exempt-From-Owner-Approval: Mechanical change not specific to any component.
Change-Id: I5eedb571c9d78862115dfdc5dae1cf2a35343580
2020-10-15 10:48:01 -07:00
Galia Peycheva
cf0c106c22 Fix dream letterboxed when there is a cutout
Fix: 170167239
Test: m && flash && verify the dream is fullscreen

Change-Id: Id26d3bde207da4168db32dc81a3ad8e001174495
2020-10-15 18:22:03 +02:00
chaviw
4a10b38ad4 Removed separate SurfaceControl for Blast
If Blast was enabled, WindowStateAnimator would create a container layer
and then a blast layer as a child. This caused some issues with
reparentChildren and relative Z, so instead of trying to continously fix
those issues, just use one layer. If blast is enabled, it will create a
single SurfaceControl with type blast. Otherwise, it will create a
BufferQueueLayer.

This means that we have to be careful with setting any properties on
the layer since the blast adapter could also be modifying the layer.
This is in the right direction since we will move all transactions for
the layer to the client, eventually.

Test: YT and Chrome with and without Blast
Change-Id: I43efc37663696ba8e54d341a03531f0048ee6a14
2020-10-13 17:48:57 -07:00
lpeter
5518d64780 Add the reason why a save dialog was not shown to FillEventHistory.
In order to provide a better user experience, it would better know the
reason why a save dialog was not shown and improve the autofill experience.
So it is necessary to add the reason why a save dialog was not shown to
FillEventHistory.

Bug: 158328375
Test: atest FillEventHistoryTest
Test: atest InlineFillEventHistoryTest
Change-Id: I50c1e40334066d3f4844426c4b03294079a967b2
2020-10-14 02:35:10 +08:00
TreeHugger Robot
c7229847fb Merge changes from topic "jr-ranking-convo"
* changes:
  Add flag for pendingintent
  Allow NLSes to see conversation information
2020-10-12 19:21:44 +00:00
Steve Elliott
467b8196aa Fix Ranking#getSmartReplies/Actions methods to actually be @NonNull
Test: atest, manual
Change-Id: I4d4305127c4f0f041c7e9a0d8b50faf5d295ceeb
2020-10-10 05:11:32 +00:00
Julia Reynolds
be75d51708 Allow NLSes to see conversation information
Test: atest
Bug: 167547800
Change-Id: I9b7930951fa7d2550b21c0fa398fc7ff7cc9566f
2020-10-09 14:58:36 -04:00
Tiger Huang
b7d379147e Merge "Remove redundant logic about System UI visibility" 2020-09-28 13:30:22 +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
Ytai Ben-tsvi
189d6050da Merge changes from topic "new-perm"
* changes:
  Demote AlwaysOnHotwordDetector to SystemApi
  Sessionize VoiceInteractionManagerService
  Sessionize the SoundTriggerService layer.
  Use standard API in SoundTriggerTestApp
  Fix bug in dumpsys
  Require identity information in SoundTrigger.java
  Associate an originator identity to sessions
  Extract permission checking as a separate aspect
  Correctly handle HAL death
2020-09-21 19:07:04 +00:00
Beverly
59b7bd2a0a Separate time string into two unique strings
In certain languages, "Until Tue, 9AM" and "Unil 3pm" are formatted
differently, so separate them into two unique strings for better translation.

Test: manual
Fixes: 165796742
Change-Id: Ib7c44714191acca427bcee0a4d88e1cb50a90afc
2020-09-17 18:32:17 +00:00
Ytai Ben-Tsvi
c4d23a482d Demote AlwaysOnHotwordDetector to SystemApi
AlwaysOnHotwordDetector gets demoted from public to SystemApi and
new permissions are enforced on its methods that imply usage of the
microphone via sound trigger.

Bug: 163865561
Change-Id: I113d69e569962b20d9d7dd1c6815daa6fb0650c5
2020-09-16 15:14:17 -07:00
Jeff Sharkey
4b5b0174d0 Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347 am: 741c0a78cc am: da7478b570 am: 487d394296
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: Id01f468b43fd5b2aada78608010625b392c1b647
2020-09-15 21:01:48 +00:00
Jeff Sharkey
487d394296 Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347 am: 741c0a78cc am: da7478b570
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: I79488866c538bf9e76d0a6429e30262978f6fdab
2020-09-15 00:13:08 +00:00
Jeff Sharkey
da7478b570 Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347 am: 741c0a78cc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: I9b79dbf3e9983523db11599d8ae289b05aabf80c
2020-09-14 23:42:34 +00:00
Jeff Sharkey
741c0a78cc Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: I7da537200efe31e803234bd1a0236843064186c8
2020-09-14 23:10:42 +00:00
Jeff Sharkey
a8cec413b6 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Test: none
Bug: 168334533
Exempt-From-Owner-Approval: docs updates
Change-Id: I245b8d9cac722da76ea67983738a3cbb9deb68df
2020-09-14 10:00:07 -06:00
Jeff Sharkey
705f6bec2d Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Test: none
Bug: 168334533
Exempt-From-Owner-Approval: docs updates
Change-Id: I53003332717baf57dc088b2f6b969cdb1863f65e
2020-09-14 09:59:01 -06:00
Ytai Ben-Tsvi
10c9b09f25 Sessionize VoiceInteractionManagerService
This change associates an identity with every
VoiceInteractionManagerService session.

Change-Id: I6c87c2976a4409b8dda4480234d794db91cee374
Bug: 163865561
2020-09-10 13:27:08 -07:00
Riddle Hsu
ccaeffc03f Remove Session#getDisplayFrame
The frame won't be changed if there is no IWindow#resized or
IWindowSession#relayout. So it can be retrieved from these methods
directly instead of another binder transaction.

And because some parameters are usually used together for layout,
the parameters are consolidated into a new ClientWindowFrames.
That reduces changing the interface in the future if the frame
related information needs to be changed.

Also refine the resize handling in ViewRootImpl to make it easier
to read.

There should be no behavior change by this modification.

Bug: 161781274
Test: WmTests, DialogFrameTests

Change-Id: I9f711ad2023442046fa8582944320b98e7c4ecfa
2020-09-10 00:26:11 +08:00
Xin Li
628590d7ec Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I3d92a6de21a938f6b352ec26dc23420c0fe02b27
Change-Id: Ifdb80563ef042738778ebb8a7581a97c4e3d96e2
2020-08-31 21:21:38 -07:00
Treehugger Robot
835ed973ec Merge "Update language to comply with Android's inclusive language guidance" am: 4983d13ccc am: 28a65b8942 am: 92876acc20 am: fdeef2b1ed am: 1a3ff01217
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1403549

Change-Id: I61d6b7591059e1c91d878d3c55d9a84d3bf3c800
2020-08-20 13:29:15 +00:00
Treehugger Robot
1a3ff01217 Merge "Update language to comply with Android's inclusive language guidance" am: 4983d13ccc am: 28a65b8942 am: 92876acc20 am: fdeef2b1ed
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1403549

Change-Id: I80116dde66a0aef45add805eb2e7ba5eeef04c4c
2020-08-20 13:13:48 +00:00
Treehugger Robot
fdeef2b1ed Merge "Update language to comply with Android's inclusive language guidance" am: 4983d13ccc am: 28a65b8942 am: 92876acc20
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1403549

Change-Id: I99915dd0ff99245aad2c31e2d0c0a7daa79f0b92
2020-08-20 13:02:46 +00:00
Treehugger Robot
92876acc20 Merge "Update language to comply with Android's inclusive language guidance" am: 4983d13ccc am: 28a65b8942
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1403549

Change-Id: I7c40c508a60dd793d0ffc3cd01ab0cc17345e759
2020-08-20 12:34:19 +00:00
lpeter
2736db57ff Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Bug: 162536543
Test: Build pass and boot
Change-Id: I0a46d4366948addad629142157c361c7133179af
2020-08-20 18:00:49 +08:00
TreeHugger Robot
c4e8f0ef16 Merge "Update docs to clarify how providers can create style bundles and Slices for inline suggestions." into rvc-dev am: 18cff6082d am: 6128b1ba0f am: ea8b670196 am: 74698fc87a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12265211

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

Change-Id: I38ea717accd07eae665e625eb6f12c0a6be811a3
2020-08-18 00:46:05 +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
Adam He
5277e0781d Update docs to clarify how providers can create style bundles and Slices
for inline suggestions.

Fixes: 162437790
Test: atest android.autofillservice.cts.inline
Change-Id: If02b34ec7978897545c0b7eabfebb8db0b9417c0
2020-08-03 13:06:38 -07:00
Beverly
189d4af721 Add dismissUserStats to NEM#performRemoveNotif
Now both notification pipelines require DismissedByUserStats when
removing a notification.

Also, refactored the DismissRunnable that gets called whenever a
notification is manually swiped away and dismissed from the
NotificationShade. Now, ExpandableNotificationRowController injects a
OnDismissCallback with a #onDismiss method that will get called whenever
a notification is manually swiped by the user OR is clicked with the
AUTO_CANCEL flag. Since it's injected it's easier to switch between the
new and old pipeline's OnDismissCallback (one which interacts with the
old pipeline's NotificationEntryManager, and another with the new
NotifCollection). Now this dismiss runnable doesn't need to be passed
around starting from inflation.

Test: atest SystemUITests
Change-Id: Iec985ce2c502462ee35cf86c1e0332168e578823
2020-07-29 08:41:04 -04:00
TreeHugger Robot
9da727f119 Merge "Prevent bell icon from disappearing on immediate followup notification." into rvc-qpr-dev am: a568597191 am: e35f399130
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12099423

Change-Id: Ief08af5a5d4f46c4cbefc84713b0bf2498e687b0
2020-07-08 13:58:00 +00:00
Jeff DeCew
206e7d747e Prevent bell icon from disappearing on immediate followup notification.
The Ranking object of a notification update has lastAudiblylertedMs of
-1 if the notification did not buzz because a buzz happened within the
last 5s.  This causes the bell icon to disappear on a conversation
where a person posted twice within 5s. This is resolved by copying the
lastAudiblyAlertedMs from the NotificationEntry's existing Ranking when
setting a new one, if the new Ranking's value is -1.

Bug: 156887617
Test: Update an alerting notification within 5s of update which caused an alert; bell should stay even though buzz is skipped.
Change-Id: Ibb72ab27c88cfa57add781e2746fff0eee5de6be
2020-07-07 16:19:03 -04:00
Ahaan Ugale
e76b0ebe27 Merge "Do not replace the authenticated dataset for pinned inline suggestion" into rvc-dev am: 913b610e53 am: 5085f4bbf1 am: cc08dc7716 am: c494c839b1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12001033

Change-Id: Iea6413ea13d288981e0e6c067424fa0b2d856ded
2020-06-30 00:36:37 +00:00
Ahaan Ugale
5085f4bbf1 Merge "Do not replace the authenticated dataset for pinned inline suggestion" into rvc-dev am: 913b610e53
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12001033

Change-Id: Ia62ed8b1f9a1d3af9973588005192bd642a69c99
2020-06-29 23:59:02 +00:00
Feng Cao
32cfac9ed7 Do not replace the authenticated dataset for pinned inline suggestion
* For the case where the pinned inline suggestion triggers an
  pending intent through the auth flow, and it returns a dataset
  to be autofilled, previously we would replace the existing
  dataset with the returned dataset. However, this is causing
  several potential issues:
  1. if the returned dataset doesn't contain inline presentation
     the the pinned icon will not show again
  2. if the returned dataset contains inline presentation but not
     the pending intent, then the pinned icon will show up again
     but tapping on it will not launch the pending intent
  3. if the returned dataset contains the inline presentaion and
     the pending intent, then when we "autofill" it, it'll fire
     the pending intent directly as opposed to filling in the
     value
* We fix the issue by not replacing the old dataset if the dataset
  is a pinned inline suggestion.
* One caveat of the approach is that: a dataset can potentially
  have multiple fields, and it's possible that some of the fields'
  has inline presentation and some don't. It's also possible that
  some of the fields' inline presentation is pinned and some isn't.
  So the concept of whether a Dataset is pinned or not is
  ill-defined. Here we say a dataset is pinned if any of the field
  has a pinned inline presentation in the dataset. It's not ideal
  but hopefully it is sufficient for most of the cases.
* An alternative approach is to have the autofill provider telling
  whether they want to replace the old dataset or not, through
  a new field in the returned Bundle. But that requres an API change
  so is infeasible at this time.

Test: atest android.autofillservice.cts.inline
Test: atest android.autofillservice.cts.augmented
Test: atest android.autofillservice.cts.LoginActivityTest
Test: atest android.autofillservice.cts.AuthenticationTest
Bug: 159367101

Change-Id: I6d162aeb88a4655989c1aa315df8304c0980ac60
2020-06-25 17:39:13 -07:00
TreeHugger Robot
cb5cd90157 Merge "Release remove inline suggestion views when session destroyed" into rvc-dev am: 6e3a4d7625 am: 29c7295caf am: 5918ea65fa am: 57a355a2da
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11972118

Change-Id: Ie186652c28b405696365b8fe2d1a3739e2df2bbe
2020-06-24 06:16:08 +00:00