30451 Commits

Author SHA1 Message Date
TreeHugger Robot
6136239d9d Merge "Voice state + transcription in VoiceInteractionSvc" 2019-01-24 10:04:18 +00:00
TreeHugger Robot
b4ef1f88ad Merge "Add notification information to logging for ACTION_NOTE_CONTROLS." 2019-01-24 08:08:31 +00:00
Jackal Guo
a275d99547 Merge "Support A11yInputFilter on multi-display" 2019-01-24 05:43:07 +00:00
TreeHugger Robot
96129fb7bb Merge "Fix another layout casting crash that happens sometimes" 2019-01-24 03:05:12 +00:00
Badhri Jagan Sridharan
7e60f8efe0 Merge changes from topic "117330206"
* changes:
  UsbContaminant dialog
  Add test commands to spoof presence of contaminants
  Contaminant detection notification
  Support USB V1.2 HAL
2019-01-24 02:03:20 +00:00
TreeHugger Robot
e3bee987ca Merge "Fix: Disappearing home button" 2019-01-23 23:52:19 +00:00
TreeHugger Robot
da0d5bda90 Merge "Log smart suggestions becoming visible in HUNs." 2019-01-23 23:12:40 +00:00
TreeHugger Robot
ee8e1ae2db Add notification information to logging for ACTION_NOTE_CONTROLS.
This event occurs when the user clicks through to modify notification
interruptiveness.  Also add test for logging.

Bug: 121380248
Test: atest SystemUITests and manual verification

Change-Id: I5d1876ce79188a457f264eb71f8bd5709944483b
2019-01-23 16:50:24 -05:00
Mady Mellor
ee2239525c Fix another layout casting crash that happens sometimes
Test: tap outside expanded activity view based bubble, doesn't crash
Change-Id: I4e47e96d88c7a89cf159e7fd6bcb9e948f0eeeb0
2019-01-23 13:26:31 -08:00
TreeHugger Robot
5f80ac0c9b Merge "Add NotificationVisibility.NotificationLocation." 2019-01-23 20:24:42 +00:00
Matt Casey
4cff16fda9 Voice state + transcription in VoiceInteractionSvc
Voice state as well as voice transcription can be provided by the
VoiceInteractionService. These get proxied to the AssistManager which
can update the system UI to reflect the state & transcription.

Test: TBD
Bug: 122740752
Bug: 123080754
Change-Id: I79cac1d89fe0123bf25a05d551cb4ef40ae1368e
2019-01-23 20:03:05 +00:00
Fabian Kozynski
38ab96e07a Merge "CellularTile shows Name of data carrier" 2019-01-23 19:21:01 +00:00
Gustav Sennton
c7d0d32b62 Log smart suggestions becoming visible in HUNs.
To measure the CTR of smart suggestions in notifications we need to log
when smart suggestions become visible. With this CL we add a
notification location log tag to know where a notification is displayed.
In this way we know which smart suggestions are shown in a heads-up
notification vs. the notification shade.

Bug: 120767764
Test: atest SystemUITests
Test: manually ensure notification surface is logged when a heads-up or
a notification in the shade is shown (and expanded).
Change-Id: Ia738f17ee6c47147b44639657dd0c1c352b4f314
2019-01-23 19:07:48 +00:00
Badhri Jagan Sridharan
392b747d4b UsbContaminant dialog
Bug: 119642987
Bug: 117330206
Bug: 77606903

Test: Ran the following sequence:
1. Add simulated port: dumpsys usb add-port "matrix" ufp
2. Set contaminant present to true:
   dumpsys usb set-contaminant-status "matrix" true
   Contaminant present notifcation shows up and dialog pops up upon
   clicking the notification.
3. Set contaminant present to false:
   dumpsys usb set-contaminant-status "matrix" false
   Contaminant present notification is dismissed and the safe to use
   notification shows up.

Change-Id: I33d22caafbedb2a21a0f61f663ebddf5c9e3f84b
2019-01-23 10:43:15 -08:00
Fabian Kozynski
704fdc0609 Merge "Increase char limit for translation" 2019-01-23 18:42:57 +00:00
Fabian Kozynski
9d3fd6c898 CellularTile shows Name of data carrier
The tile only controls the default data subscription (this is enforced
by using DataUsageController#setMobileDataEnabled). The secondary text
shows the carrier name when data is enabled.

Bug: 113343186
Test: manual with only one SIM and using DSDS
Change-Id: I1b8f0720618cd5b1679e1185e77d36b0227b663c
2019-01-23 11:41:52 -05:00
Gustav Sennton
f892fe95ad Add NotificationVisibility.NotificationLocation.
To represent the UI location of a Notification we add the class enum
NotificationVisibility.NotificationLocation.

Bug: 120767764
Test: atest SystemUITests
Change-Id: I572c1cb7e585158f29675afd5255898e7f78e820
2019-01-23 16:09:38 +00:00
Yohei Yukawa
438f6799e9 Let RemoteInputView call setTextOperationUser() only once
This is a small follow up to my previous CL [1], which made
RemoteInputView call TextView#setTextOperationUser() so that the text
operation uesr ID can be determined by the notification user ID.

Since the relationship between NotificationEntry and RemoteInputView
is immutable, there is no need to call setTextOperationUser(null) to
reset the target user ID in RemoteInputView#reset(), which may have
some race conditions.

With this CL, RemoteInputView calls setTextOperationUser() only once
immediatelly after inflation.

 [1]: Ibabe13e5b85e5bb91f9f8af6ec07c395c25c4393
      7276946b92fbac928b1d34971b9c4ffd975d95e4

Bug: 120744418
Bug: 123043618
Test: atest SystemUITests
Test: Manually tested Bug 120744418 scenario as follows.
  1. Build and flash an AOSP build
  2. adb root
  3. adb shell setprop persist.debug.per_profile_ime 1
  4. adb reboot
  5. Install Test DPC
  6. Enable managed profile with Test DPC
  7. make -j SoftKeyboard
  8. adb install -r $OUT/system/app/SoftKeyboard/SoftKeyboard.apk
  9. adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard
 10. adb shell ime set com.example.android.softkeyboard/.SoftKeyboard
 11. make -j EditTextVariations
 12. adb install -r $ANDROID_TARGET_OUT_TESTCASES/EditTextVariations/EditTextVariations.apk
 13. adb shell am start --user 0 \
     -n com.android.inputmethod.tools.edittextvariations/.EditTextVariations
 14. Tap the menu icon on the EditTextVariations then click "Direct Reply"
 15. adb shell am start --user 10 \
     -n com.android.inputmethod.tools.edittextvariations/.EditTextVariations
 16. Tap the menu icon on the EditTextVariations then click "Direct Reply"
 17. Open notification shade.
 18. Tap reply icon on "Message from UserHandle{0}".
 19. Make sure that SoftKeyboard Sample IME is shown.
 20. Tap reply icon on "Message from UserHandle{10}".
 21. Make sure that AOSP Keyboard is shown.
 22. Tap reply icon on "Message from UserHandle{0}" again.
 23. Make sure that SoftKeyboard Sample IME is shown again.
Test: Manually tested Bug 123043618 scenario as follows.
  1. Build and flash an AOSP build
  2. Create a secondary user then switch to it.
  3. make -j SoftKeyboard
  4. adb install -r $OUT/system/app/SoftKeyboard/SoftKeyboard.apk
  5. adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard
  6. adb shell ime set com.example.android.softkeyboard/.SoftKeyboard
  7. make -j EditTextVariations
  8. adb install -r $ANDROID_TARGET_OUT_TESTCASES/EditTextVariations/EditTextVariations.apk
  9. adb shell am start \
     -n com.android.inputmethod.tools.edittextvariations/.EditTextVariations
 10. Tap the menu icon on the EditTextVariations then click "Direct Reply"
 11. Tap reply icon on "Message from UserHandle{10}".
 12. Make sure that SoftKeyboard Sample IME is shown.
 13. Type "ggggg" then hit the space key.
 14. Make sure that red underline is drawn under "ggggg"
 15. Make sure that AndroidSpellCheckerService runs as user 10.
Test: Manually tested multi-user scenario with per-profile mode as follows.
  1. Build and flash an AOSP build
  2. adb root
  3. adb shell setprop persist.debug.per_profile_ime 1
  4. adb reboot
  5. Create a secondary user then switch to it.
  6. make -j SoftKeyboard
  7. adb install -r $OUT/system/app/SoftKeyboard/SoftKeyboard.apk
  8. adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard
  9. adb shell ime set com.example.android.softkeyboard/.SoftKeyboard
 10. make -j EditTextVariations
 11. adb install -r $ANDROID_TARGET_OUT_TESTCASES/EditTextVariations/EditTextVariations.apk
 12. adb shell am start \
     -n com.android.inputmethod.tools.edittextvariations/.EditTextVariations
 13. Tap the menu icon on the EditTextVariations then click "Direct Reply"
 14. Tap reply icon on "Message from UserHandle{10}".
 15. Make sure that SoftKeyboard Sample IME is shown.
 16. Type "ggggg" then hit the space key.
 17. Make sure that red underline is drawn under "ggggg"
 18. Make sure that AndroidSpellCheckerService runs as user 10.
Change-Id: I975baa748c821538e5a733bb98a33ac609bf40a7
2019-01-23 07:43:34 -08:00
Gus Prevas
30dc072134 Merge changes I636dbbc4,Idd0711a7
* changes:
  Implements flinging for anchor-based scrolling.
  Implements basic anchor-based scrolling.
2019-01-23 15:00:10 +00:00
TreeHugger Robot
bdba7efd10 Merge "Show only recent accesses" 2019-01-23 13:15:21 +00:00
Jackal Guo
8b729932db Support A11yInputFilter on multi-display
In order to support multi-display, some event handlers need to be
plural. Based on the characteristic of each event handler, only
the event handler that needs to deal with concurrent events from
different display needs multi-instance.

Test: a11y CTS & unit tests
Test: atest SystemUITests
Change-Id: I76379fb82aad09ee20609d81bd5b1dda15931905
2019-01-23 12:53:35 +08:00
Sungsoo Lim
98955b03de Merge "Use MediaSession.Token instead of ISessionController" 2019-01-23 02:32:10 +00:00
TreeHugger Robot
1655f9896f Merge "Fix image wallpaper distortion after rotate." 2019-01-23 02:01:16 +00:00
TreeHugger Robot
4b06dcba98 Merge "Applies friction to non-dismiss drag only after the snap point." 2019-01-23 01:26:10 +00:00
Tetsutoki Shiozawa
e294e49c4e Fix: Disappearing home button
Symptom:
Accidentally, home button was not shown on navigation bar after
unlocking keygaurd.

Root cause:
Home button's visibility is controlled by STATUS_BAR_DISABLE_HOME
flag. Keygaurd requests STATUS_BAR_DISABLE_HOME flag at locking
and removes it at unlocking.
When removing the flag and recreation of NavigationBarFragment
happen simultaneously, NavigationBarFragment fails to remove the
flag and it keeps hiding the home button.

Solution:
CommandQueue has a latest requested "disabled" flags. It's better to
reevaluate the flag and apply it to the recreated NavigationBarFragment.

Test: manual
Fixes: 122999473
Fixes: 113914868
Change-Id: Ic19029aab2e777aeb187963da3ef341291cca490
2019-01-22 17:20:07 -08:00
Nick Kralevich
2280c5d8ae Merge "UsbDebuggingActivity.java: OK -> Allow" am: f9718dbe17 am: 56ed214f67
am: 889ff4966b

Change-Id: I54ce67321abe0d058920c96298d97e6cc2834b09
2019-01-22 15:38:34 -08:00
Nick Kralevich
889ff4966b Merge "UsbDebuggingActivity.java: OK -> Allow" am: f9718dbe17
am: 56ed214f67

Change-Id: Ieec3c59499c3a3770d92a52866aa324df1ce0473
2019-01-22 15:28:39 -08:00
Nick Kralevich
56ed214f67 Merge "UsbDebuggingActivity.java: OK -> Allow"
am: f9718dbe17

Change-Id: I597e50b031334ff67641f9252d8081fbfca7f4b4
2019-01-22 15:19:11 -08:00
Treehugger Robot
f9718dbe17 Merge "UsbDebuggingActivity.java: OK -> Allow" 2019-01-22 23:09:39 +00:00
Joel Galenson
4bed492179 Show only recent accesses
Pass an argument to the Permissions Hub telling it to show only
accesses in the last minute.

Test: Open this dialog, click the button, ensure last minute is
selected in the Permissions Hub.

Change-Id: I55a11248ba3f08723628cb38861c86254d8e9e11
2019-01-22 15:07:24 -08:00
TreeHugger Robot
f749198d19 Merge "Add exp flag for min number of sys gen smart replies in notifications" 2019-01-22 22:36:37 +00:00
TreeHugger Robot
073291142a Merge "Do not crash NearestTouchFrame when views are not attached to window" 2019-01-22 21:14:19 +00:00
Lucas Dupin
a47310fde0 Merge "Fix StatusBarWindowController initialization NPE" 2019-01-22 20:34:12 +00:00
TreeHugger Robot
cc249beb0d Merge "Add notification location to onNotificationExpansionChanged." 2019-01-22 19:15:01 +00:00
Mady Mellor
9c79041cc6 Merge "Fix layout crash & bubble anything with valid bubble metadata intent" 2019-01-22 18:44:38 +00:00
TreeHugger Robot
a0602f3eba Merge "Move plugin and settings logic out of KeyguardClockSwitch." 2019-01-22 18:21:01 +00:00
Lucas Dupin
42ebe5486f Fix StatusBarWindowController initialization NPE
Plugins might be initialized before the StatusBar service is ready.
This means that #setForcePluginOpen might be called before #add.

Test: atest StatusBarWindowControllerTest
Change-Id: I99a220521272a2348ecece4c4581e7c82fa79490
Fixes: 123051520
2019-01-22 09:49:03 -08:00
Gustav Sennton
a8e38aa5d0 Add notification location to onNotificationExpansionChanged.
To know from what UI location a notification was expanded we here pass
the location of the notification through
onNotificationExpansionChanged().

Bug: 120767764
Test: atest SystemUITests
Test: atest NotificationManagerServiceTest
Change-Id: I20612f5a88cf987f434392ae7a004d3ee3098998
2019-01-22 17:12:22 +00:00
Fabian Kozynski
9399b491b9 Increase char limit for translation
Test: None
Bug: 122929700
Change-Id: I0febe4a74087db71e87c4f6fcbcefddb4190857a
2019-01-22 12:11:41 -05:00
Lucas Dupin
a54251feab Merge "Do double tap detection to wake up device while docked." 2019-01-22 17:04:27 +00:00
Gus Prevas
cdc98344d8 Implements flinging for anchor-based scrolling.
Test: atest SystemUITests, manual
Change-Id: I636dbbc4faf1dde0a97be5ac4d323fc813e2e05b
2019-01-22 11:41:48 -05:00
Robert Snoeberger
15b4af1943 Move plugin and settings logic out of KeyguardClockSwitch.
This is in preparation for adding more logic related to docked state.

Bug: 122301289
Test: Used adb to switch between custom clock faces.
Change-Id: I0a13ef4e5894df1280a04c5a9df8bbed8054557b
2019-01-22 11:32:40 -05:00
Gus Prevas
0fa58d6cc6 Implements basic anchor-based scrolling.
This change introduces an alternate method of laying out notification
rows in StackScrollAlgorithm based on identifying an "anchor" view and
its position relative to the top of the container, then laying out the
rest of the rows outwards from there.  It also adds alternate logic to
everywhere NotificationStackScrollLayout reads or modifies the scroll
position to work with the anchor-based approach instead.  A binary flag
is introduced to toggle between the approaches.

In this change we implement the basic scrolling functionality only.
TODOs are added where functionality is missing, including:
- flinging/animated scrolling
- forced scroll/scrolling to a specific view
- clamping to window insets
- a11y scroll actions/scrolling state
- edge cases related to expanding/collapsing views above the anchor or
at the bottom of the shade

Test: atest SystemUITests, manual
Change-Id: Idd0711a7947733bd81c10feccda871b736c0578a
2019-01-22 11:13:57 -05:00
Sungsoo Lim
af7d46c117 Use MediaSession.Token instead of ISessionController
ISessionController will be moved to mainline module.

Test: pass MediaSessionTest and MediaControllerTest
Change-Id: I45b4da502e2b262730255a6cda1ab932d154ecbd
2019-01-22 21:46:12 +09:00
lpeter
8a5f470c01 Do double tap detection to wake up device while docked.
In order to keep the same action to wake up device when docked, it
should enable double tap sensor even though the setting is off.

The miss-touch can be ignored when docked.

Bug: 123057133
Test: atest SystemUITests
Change-Id: I67dec8b3ae51f46c50570eaec0250c1aa1dc8bb9
2019-01-22 20:27:57 +08:00
wilsonshih
3b2683a668 Fix image wallpaper distortion after rotate.
Keep surface size large enough to draw the image.
When we shrink for small image, we still maintain its aspect ratio.

Fix: 123108383
Test: atest ImageWallpaperTest
Test: manual verify aspect ratio not changed after rotate.
Test: manual put a small image as wallpaper and see surface size won't
grow too much.

Change-Id: Icf3bc4a3129d9aecba2b57c620f378b9d9d7374b
2019-01-22 12:03:25 +08:00
Gustav Sennton
a31f6aede1 Add exp flag for min number of sys gen smart replies in notifications
For system (assistant) generated smart replies we want to ensure the
replies don't seem biased (see example [1]). Therefore we here add an
experiment flag that determines the minimum number of replies N to show
in a notification. If we can't fit N replies into the notification we
remove all replies from that notification (i.e. we show zero replies).

[1] Example of biased replies:
Message: "Hi, how are you?"
Replies: "Good", "Great!", "Bad"
using only one reply here ("Good") might be seen as biased.

Bug: 120779592
Test: atest SystemUITests
Test: call "adb shell settings put global
smart_replies_in_notifications_flags enabled=true,min_num_replies=X" for
different values of X and ensure the behaviour is correct.
Change-Id: I898850f7895d0fd43ec6788095162f3138cd62cb
2019-01-21 15:03:26 +00:00
TreeHugger Robot
96583d40d1 Merge "onNotificationExpansionChanged is called only when the expansion change... is visible to users." 2019-01-21 12:07:26 +00:00
Gustav Sennton
a8b23abc66 Merge "Remove smart actions accessibility TODO - this works fine already." 2019-01-21 10:56:55 +00:00
Yohei Yukawa
7276946b92 Use setTextOperationUser() in KeyguardPasswordView and RemoteInputView
Android implements many complex text-related operations as per-user
out-of-process services. Notable examples are:

  * InputMethodServices
  * SpellCheckerService
  * TextClassifierService
  * AutofillService

For service client processes to connect to the right user's services
often the system assumes that a process that runs as user X should
connect to services that run as user X.  While this approach works for
most of cases, there is at least one exception, System UI, which
always runs as the primary user (unless the device enables special
mode e.g. UserManager.isSplitSystemUser()) no matter who is the
current foreground user.

In order to deal with this special case, we recently introduced an
@hide API TextView#setTextOperationUser() [1] to centralize cross-user
special logic inside TextView.  With this CL, KeyguardPasswordView and
RemoteInputView actually start calling it.

Note that TextView#setTextOperationUser() already takes care of IMEs
and SpellCheckers hence those two operations start working as expected
with this CL.  Once TextView#setTextOperationUser() start taking care
of other operations such as text classification and clipboard,
KeyguardPasswordView and RemoteInputView will be automatically taken
care of with no code change.

 [1]: I6d11e4d6a84570bc2991a8552349e8b216b0d139
      401e3d4c842ce86569de4477138137dc07a6aa6f

Fix: 120744418
Fix: 123043618
Test: atest SystemUITests
Test: Manually tested Bug 120744418 scenario as follows.
  1. Build and flash an AOSP build
  2. adb root
  3. adb shell setprop persist.debug.per_profile_ime 1
  4. adb reboot
  5. Install Test DPC
  6. Enable managed profile with Test DPC
  7. make -j SoftKeyboard
  8. adb install -r $OUT/system/app/SoftKeyboard/SoftKeyboard.apk
  9. adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard
 10. adb shell ime set com.example.android.softkeyboard/.SoftKeyboard
 11. make -j EditTextVariations
 12. adb install -r $ANDROID_TARGET_OUT_TESTCASES/EditTextVariations/EditTextVariations.apk
 13. adb shell am start --user 0 \
     -n com.android.inputmethod.tools.edittextvariations/.EditTextVariations
 14. Tap the menu icon on the EditTextVariations then click "Direct Reply"
 15. adb shell am start --user 10 \
     -n com.android.inputmethod.tools.edittextvariations/.EditTextVariations
 16. Tap the menu icon on the EditTextVariations then click "Direct Reply"
 17. Open notification shade.
 18. Tap reply icon on "Message from UserHandle{0}".
 19. Make sure that SoftKeyboard Sample IME is shown.
 20. Tap reply icon on "Message from UserHandle{10}".
 21. Make sure that AOSP Keyboard is shown.
 22. Tap reply icon on "Message from UserHandle{0}" again.
 23. Make sure that SoftKeyboard Sample IME is shown again.
Test: Manually tested Bug 123043618 scenario as follows.
  1. Build and flash an AOSP build
  2. Create a secondary user then switch to it.
  3. make -j SoftKeyboard
  4. adb install -r $OUT/system/app/SoftKeyboard/SoftKeyboard.apk
  5. adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard
  6. adb shell ime set com.example.android.softkeyboard/.SoftKeyboard
  7. make -j EditTextVariations
  8. adb install -r $ANDROID_TARGET_OUT_TESTCASES/EditTextVariations/EditTextVariations.apk
  9. adb shell am start \
     -n com.android.inputmethod.tools.edittextvariations/.EditTextVariations
 10. Tap the menu icon on the EditTextVariations then click "Direct Reply"
 11. Tap reply icon on "Message from UserHandle{10}".
 12. Make sure that SoftKeyboard Sample IME is shown.
 13. Type "ggggg" then hit the space key.
 14. Make sure that red underline is drawn under "ggggg"
 15. Make sure that AndroidSpellCheckerService runs as user 10.
Test: Manually tested multi-user scenario with per-profile mode as follows.
  1. Build and flash an AOSP build
  2. adb root
  3. adb shell setprop persist.debug.per_profile_ime 1
  4. adb reboot
  5. Create a secondary user then switch to it.
  6. make -j SoftKeyboard
  7. adb install -r $OUT/system/app/SoftKeyboard/SoftKeyboard.apk
  8. adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard
  9. adb shell ime set com.example.android.softkeyboard/.SoftKeyboard
 10. make -j EditTextVariations
 11. adb install -r $ANDROID_TARGET_OUT_TESTCASES/EditTextVariations/EditTextVariations.apk
 12. adb shell am start \
     -n com.android.inputmethod.tools.edittextvariations/.EditTextVariations
 13. Tap the menu icon on the EditTextVariations then click "Direct Reply"
 14. Tap reply icon on "Message from UserHandle{10}".
 15. Make sure that SoftKeyboard Sample IME is shown.
 16. Type "ggggg" then hit the space key.
 17. Make sure that red underline is drawn under "ggggg"
 18. Make sure that AndroidSpellCheckerService runs as user 10.
 19. Set up a text screenlock.
 20. Turn off the display.
 21. Turn on the display.
 22. Make sure that SoftKeyboard Sample IME is shown.
Change-Id: Ibabe13e5b85e5bb91f9f8af6ec07c395c25c4393
2019-01-20 09:28:08 -08:00