Commit Graph

18063 Commits

Author SHA1 Message Date
Alan Viverette
7c9b826042 Merge "Nullability annotations for view and widget" 2022-02-07 17:36:41 +00:00
Felipe Leme
2eea07021e Changes Activity to use Dumpable for "legacy" cases.
Test: adb shell am start com.android.settings && adb shell dumpsys activity com.android.settings --autofill
Test: atest CtsAppTestCases:android.app.cts.ActivityDumpTest

Bug: 149254050

Change-Id: I658b18a965f3d35c3ecbb2aae58c7c7d7527c6e4
2022-02-04 15:39:13 -08:00
Maurice Lam
84380108d8 Merge "Revert "Show error dialog if activity is blocked from streaming"" 2022-02-04 00:31:08 +00:00
Alan Viverette
68c65e58b4 Nullability annotations for view and widget
I inferred nullability annotations in Jetpack based on the guaranteed
behavior of the platform, so now I'm propagating those inferences back
to the platform as annotations.

Test: nullability presubmit checks
Fixes: 206801689
Change-Id: I78a1997faeecdafc51d303b0fc766369938b9101
2022-02-03 15:51:17 -05:00
Maurice Lam
66e861949a Revert "Show error dialog if activity is blocked from streaming"
This reverts commit 62f05520bf.

Reason for revert: b/217599896

Change-Id: I956e7ec5404c9b6908f730d764baa391d02555e7
2022-02-03 17:34:42 +00:00
Vadim Caen
8e59ca9a3a Merge "Save the OnBackInvokedCallback in WindowState" 2022-02-03 17:26:12 +00:00
Dmitri Plotnikov
6be687b645 Merge "Include per process state data in the BatteryUsageStats atom" 2022-02-03 01:24:37 +00:00
Jing Ji
a3dac676fc Merge "Add support to pre-config bg restriction exemptions in system config" 2022-02-02 21:24:57 +00:00
Vadim Caen
717e53a6a7 Save the OnBackInvokedCallback in WindowState
This CL enable OnBackInvokedCallback to be saved in a WindowState and
queried by the BackNavigationController to be returned when
ATM.startBackNavigation() is called.

The DecorView provides a PendingOnBackInvokedDispatcher that can receive
callback registration before being added to a ViewRootImpl.

Test: atest FrameworksCoreTests:BackNavigationTest
Bug: 131727607
Change-Id: I01528a22ea4a6583a56ade4eab69136d727855d0
2022-02-02 22:08:02 +01:00
Caitlin Cassidy
f759b1ebee Merge "[Media TTT] Add @SystemApis for all the media transfer callbacks." 2022-02-02 21:00:56 +00:00
Matt Casey
d22d1e1f8d Merge "Add 'miniresolver' UI for cross-profile single app resolution." 2022-02-02 20:57:32 +00:00
Jing Ji
ffa8a189ff Add support to pre-config bg restriction exemptions in system config
Also exempt packages with allow-except-idle.

Bug: 200326767
Bug: 203105544
Test: atest FrameworksMockingServicesTests:BackgroundRestrictionTest
Change-Id: Ifd3362dae4115b19337c3ecde059bd2941ad031e
2022-02-02 10:08:45 -08:00
Caitlin Cassidy
44386a5a2e [Media TTT] Add @SystemApis for all the media transfer callbacks.
This migrates the media transfer from just a service to a full-fledged
@SystemApi. Some of the testing infrastructure has not yet been migrated
to keep this CL slightly smaller.

Bug: 216318437
Test: systemui media.taptotransfer tests *still need to be updated*
Change-Id: Idf1f72de1343020668e158d74051c1dfb970cfcd
2022-02-02 16:14:33 +00:00
Pablo Gamito
48d292a2f5 Merge changes I602852b1,Ibb863815
* changes:
  Use legacy transitions in legacy transition system
  Update default activity animations
2022-02-02 13:16:04 +00:00
Matt Casey
81e474d7a7 Add 'miniresolver' UI for cross-profile single app resolution.
When the current profile only has web browsers and the other profile has
a single non-browser app to handle the given intent, simplify the
resolver UI to present the user with a yes/no question about how to
handle.

Canonical example of this is "clicking a youtube link in your work
profile".

Bug: 175433480
Test: atest ResolverActivityTest
Change-Id: I213313ca87a8d1db5e586fe074f953060a91fc19
2022-02-01 21:29:01 +00:00
Pablo Gamito
6b600cf1a9 Use legacy transitions in legacy transition system
The new activity transitions are currently only supported in shell so we want to replace them with the old transitions when running using the legacy transition system

Fixes: 215512394

Test: Flash and make sure we are using the old activity transitions when shell transitions are disabled
Change-Id: I602852b16effa150fe697262a7d7e506c464d62a
2022-02-01 13:16:44 +01:00
Yohei Yukawa
c98b9c8f40 Support floating IMEs even when IMEs render the nav buttons
As discussed in Bug 201375975, the nevigation bar handling for
floating IMEs is a bit tricky.

This CL tweaks DecorView behabior only when

  InputMethodService#canImeRenderGesturalNavButtons(),

is true and the IME is floating in the gestural navigation mode.

Fix: 215550296
Test: Manually tested with ThemedNavBarKeyboard sample
  1. Build aosp_coral-userdebug and flash it
  2. adb root
  3. adb shell setprop \
      persist.sys.ime.can_render_gestural_nav_buttons true
  4. adb reboot
  5. make -j ThemedNavBarKeyboard
  6. adb install -r \
      $OUT/system/app/ThemedNavBarKeyboard/ThemedNavBarKeyboard.apk
  7. adb shell ime enable \
      com.example.android.themednavbarkeyboard/.ThemedNavBarKeyboard
  8. adb shell ime set \
      com.example.android.themednavbarkeyboard/.ThemedNavBarKeyboard
  9. Open the Dialer app
 10. Focus in the top edit field.
 11. Tap "FLOATING MODE" mode
 12. Make sure that the navigation buttons are visible.
Change-Id: Ia54499a3c2ac6e33e72f625eba3477fd81649d32
2022-01-31 18:56:59 -08:00
Yohei Yukawa
af1695a78a Introduce Window.DecorCallback
This is a follow up CL to my previous CL [1], which introduced a
hidden callback method into Window.Callback.

This CL does not change any observable behavior but consolidate that
hidden callback into a newly introduced Window.DecorCallback
interface.  In this approach, we no longer need to worry about
accidental method name collision in Window.Callback implementations
classes.

Here is the new callback chain.

 ViewRootImpl#performTraversals()
  -> DecorView#onSystemBarAppearanceChanged()
   -> Window.dispatchOnSystemBarAppearanceChanged()
    -> NavigationBarController.Impl#onSystemBarAppearanceChanged()

 [1]: I08566034bebfafff6777ce0152cd6ca1f66f6cad
      678ddce11c

Bug: 215549533
Test: Manually tested with ThemedNavBarKeyboard sample
  1. Build aosp_coral-userdebug and flash it
  2. adb root
  3. adb shell setprop \
      persist.sys.ime.can_render_gestural_nav_buttons true
  4. adb reboot
  5. make -j ThemedNavBarKeyboard
  6. adb install -r \
      $OUT/system/app/ThemedNavBarKeyboard/ThemedNavBarKeyboard.apk
  7. adb shell ime enable \
      com.example.android.themednavbarkeyboard/.ThemedNavBarKeyboard
  8. adb shell ime set \
      com.example.android.themednavbarkeyboard/.ThemedNavBarKeyboard
  9. Open the Dialer app
 10. Focus in the top edit field.
 11. Tap "EXTENDED LIGHT NAVIGARION BAR" mode
 12. Make sure that the navigation button color is optimized for light
     navigation bar.
 13. Tap "STANDARD LIGHT NAVIGARION BAR" mode
 14. Make sure that the navigation button color is optimized for light
     navigation bar.
Change-Id: I5168f76dfc9526e925c565dbfa87597b5543fcdc
2022-01-31 18:56:50 -08:00
Dmitri Plotnikov
9440f2d5ca Include per process state data in the BatteryUsageStats atom
Bug: 216564822
Test: atest BatteryUsageStatsProtoTests:BatteryUsageStatsPulledTest
Test: atest CtsStatsdAtomHostTestCases:BatteryUsageStatsTests
Test: atest FrameworksCoreTests:MeasuredEnergyStatsTest
Change-Id: I944724b6be3a0ea0f03271d2d33a821ce275a98e
2022-01-31 18:39:18 -08:00
TreeHugger Robot
ca4633dd18 Merge "Allow overriding managed profile switching animation" 2022-01-31 22:39:51 +00:00
kholoud mohamed
dd7c79d26b Allow overriding managed profile switching animation
Bug: 203548565
Bug: 188410712
Test: manual
Change-Id: I1bf75abcee4309eee5c03f76238bb21fb8549c02
2022-01-31 19:49:49 +00:00
Songchun Fan
997c6f7514 [pm] small refactor for InstallLocationUtils
+ Renaming to reflect the actual functionality of the class.

+ Move freeStorage related code to PackageManagerService, we will want
to clean that up later.

BUG: 198177734
Test: atest InstallLocationUtilsTest
Change-Id: I951129ffb5e53df548ef78fcd9de79c0ef994914
2022-01-31 18:59:37 +00:00
Dmitri Plotnikov
5ae1bee477 Merge "Do not unparcel TimeInFreqMultiStateCounter with CPU freq count mismatch" 2022-01-31 18:04:35 +00:00
Kweku Adams
f86b09eaf1 Merge "Update callback delay when constant changes." 2022-01-31 15:51:17 +00:00
Etienne Ruffieux
fa43f240c4 Merge "Moving bt stats logging to BatteryStats." 2022-01-29 10:27:49 +00:00
Yohei Yukawa
7a7271ddea Merge "Support IME switcher icon visibility update" 2022-01-29 00:42:58 +00:00
Joe Bolinger
8a2f880221 Merge changes Id07e160b,I3ac8049c
* changes:
  Update client monitors to use HAL context methods.
  Add communication channel for AoD state for all biometric operations.
2022-01-28 23:35:17 +00:00
Kweku Adams
87f7b33534 Update callback delay when constant changes.
Update the delay of the ACTION_CHARGING/DISCHARGING broadcast whenever
the delay constant is updated to ensure that tests can run smoothly.

Bug: 214599394
Test: atest --rerun-until-failure 25 CtsJobSchedulerTestCases:BatteryConstraintTest
Test: atest --rerun-until-failure 25 CtsJobSchedulerTestCases:JobThrottlingTest
Change-Id: Ic664fa58edb3cab9980759baf356457158f66ead
2022-01-28 23:14:01 +00:00
Etienne Ruffieux
5c31c58990 Merge "Added BinderCallsStats Bluetooth initialization" 2022-01-28 22:05:17 +00:00
Dmitri Plotnikov
b8b9bf6f79 Do not unparcel TimeInFreqMultiStateCounter with CPU freq count mismatch
Bug: 216740045
Test: atest FrameworksCoreTests:BatteryStatsTests
Change-Id: I01847dbb025b0c1481066981156bf279240fdf32
2022-01-28 12:44:24 -08:00
Oli Lan
93e80fe996 Merge changes from topic "avatarpicker1"
* changes:
  Offer colored default avatars if no preselected images are provided.
  Support taking or choosing a photo in avatar picker.
  Add avatar picker that shows a predefined set of images.
2022-01-28 19:09:23 +00:00
Michael Wachenschwanz
288b4bc054 Merge "Collect fine grain time-in-state Modem durations" 2022-01-28 18:11:53 +00:00
Yohei Yukawa
75b935a12b Support IME switcher icon visibility update
With this CL, the IME switcher icon becomes visible only when
necessary, even if InputMethodService renders the back button and the
IME switcher button in the gestural navigation mode.

Implementation idea:

InputMethodManagerService#shouldShowImeSwitcherLocked() is the source
of truth about whether the IME switcher visibility should be shown or
not, and it internally depends on the following conditions:

 A. com.android.internal.R.bool.show_ongoing_ime_switcher
 B. Whether the IME switcher is already shown or not.
 C. Whether the IME is perceptible or not.
 D. Whether one or more hardware keyboards are attached or not.
 E. Keyguard state.
 F. What IMEs and their subtypes are enabled.

Here are what those conditions would mean for this project.

 * A is considered to be a per-device constant value.
 * B, D, and F can happen at any time outside of the IME lifecycle
   events such as startInput().
 * C is no longer relevant if those buttons are rendered by the IME.
 * E is considered to be constant throughout each startInput() cycle.

This CL uses the following 3 IPCs to notify when the IME switcher
visibility is changing.

 1. IInputMethod#initializeInternal()
 2. IInputMethod#startInput()
 3. IInputMethod#onShouldShowImeSwitcherWhenImeIsShownChanged()

1 and 2 will be used to provide the "initial" value to avoid potential
flickers.  3 is still necessary to take care of async changes
triggered by B, D, and F.

Fix: 215551357
Test: Manually verified with for the following scenarios:
 * Enabling/disabling multiple IMEs
 * Attaching/detaching a hardware keyboard
 * Showing/hinding the IME switcher
 * Showing an IME on the lock screen
Change-Id: I5de9ac0dc8670842edf66306bb4c281c77cea376
2022-01-28 10:04:32 -08:00
Etienne Ruffieux
5166da8664 Moving bt stats logging to BatteryStats.
Tag: #feature
Bug: 211851706
Test: manual
Change-Id: I7e40b64eaa334792dd409837fb9f512714f65eec
2022-01-28 17:16:50 +00:00
Oli Lan
4f3a0b8fdb Offer colored default avatars if no preselected images are provided.
In the new avatar picker, if no preselected images have been provided,
this CL adds several color variations of the default avatar to the
picker instead.

Bug: 215134398
Test: manual
Change-Id: I3e1f617c760b241517f94c606f5cb21eafcc022d
2022-01-28 16:12:55 +00:00
Joe Bolinger
1a2536afdb Add communication channel for AoD state for all biometric operations.
This will be added to the client monitors with tests in a follow up change.

Bug: 204585936
Bug: 204584403
Test: atest AuthControllerTest
Change-Id: I3ac8049ca73cb8bf58b1c1d47945a528f26d02a3
2022-01-27 15:06:24 -08:00
Maurice Lam
482415bc29 Merge "Show error dialog if activity is blocked from streaming" 2022-01-27 22:52:40 +00:00
Maurice Lam
62f05520bf Show error dialog if activity is blocked from streaming
Bug: 203834118
Test: Tested with a virtual device with disallowed activities
Change-Id: I2edf93e3527c261756b52e6ec477e91afc2dd833
2022-01-27 10:50:17 -08:00
Etienne Ruffieux
8b6dc9b3ed Added BinderCallsStats Bluetooth initialization
Tag: #feature
Bug: 195146428
Test: manual
Change-Id: Ia9e35c8299fc039da977018eab84402c2ba0caab
2022-01-27 18:30:43 +00:00
Yohei Yukawa
678ddce11c Support light navigation bar
In order to propagate the information about whether the IME is using
light navigation bar or not from

  android.view.ViewRootImpl

to

  android.inputmethodservice.NavigationBarController

within the same process, this CL adds a new @hide method to

  Window.Callback

as follows.

 ViewRootImpl#performTraversals()
  -> DecorView#onSystemBarAppearanceChanged()
   -> Window.Callback#onSystemBarAppearanceChanged()
    -> SoftInputWindow#onSystemBarAppearanceChanged()
     -> NavigationBarController#onSystemBarAppearanceChanged()

Button color transition will be implemented in a subsequent CL.

Bug: 215549533
Test: Manually tested with ThemedNavBarKeyboard sample
  1. Build aosp_coral-userdebug and flash it
  2. adb root
  3. adb shell setprop \
      persist.sys.ime.can_render_gestural_nav_buttons true
  4. adb reboot
  5. make -j ThemedNavBarKeyboard
  6. adb install -r \
      $OUT/system/app/ThemedNavBarKeyboard/ThemedNavBarKeyboard.apk
  7. adb shell ime enable \
      com.example.android.themednavbarkeyboard/.ThemedNavBarKeyboard
  8. adb shell ime set \
      com.example.android.themednavbarkeyboard/.ThemedNavBarKeyboard
  9. Open the Dialer app
 10. Focus in the top edit field.
 11. Tap "EXTENDED LIGHT NAVIGARION BAR" mode
 12. Make sure that the navigation button color is optimized for light
     navigation bar.
 13. Tap "STANDARD LIGHT NAVIGARION BAR" mode
 14. Make sure that the navigation button color is optimized for light
     navigation bar.
Change-Id: I08566034bebfafff6777ce0152cd6ca1f66f6cad
2022-01-27 10:29:33 -08:00
Joanne Chung
4ccfe1a551 Merge changes I73bdec96,I1f2add3e,I2e704432
* changes:
  Handle touch focus when clicking toolbar window transparent area
  The client implementation for remote selection bar
  The service implementatoin of selection toolbar
2022-01-27 16:19:53 +00:00
Billy Lau
cfa26cb21e Merge "Add BinaryTransparencyService as new SystemService." 2022-01-27 15:36:49 +00:00
Joanne Chung
6e56f6bac9 The client implementation for remote selection bar
The DefaultSelectionToolbarRenderService renders the menu items and
callbacks to the application with the SurfacePackage and the relative
postition, the application will set the SurfacePackage to the
SurfaceView and put the PopupWindow on the correct position.

The MenuItemRepr is a copy from LocalFloatingToolbarPopup, no logic
change in this class. The above changes don't contain the solution
for transfering the touch focus on the non-toolbar part to the
application process. The part will be implemented on the follow up
change.

Bug: 190030331
Bug: 205823020
Test: manual. Enable the flag, try to selectin the text then the
toolbar can show successfully. Can open opverflow menu, scroll the
view, the selection toolbar also changes the position.

Merged-In: I3915e8165b4d371700cb5fb9e7eb23d46f39bd5c
Change-Id: I1f2add3e93cee9d7af20cba9ccd4e0b393afffcb
2022-01-27 21:24:36 +08:00
TreeHugger Robot
19b32787d1 Merge "Add hide-non-system-overlay flag for HarmfulAppWarningActivity" 2022-01-27 13:16:33 +00:00
TreeHugger Robot
4c4cd6f670 Merge changes from topics "CAI-filters", "onPrepareStylusHandwriting"
* changes:
  Scribe in IMF: Introduce filters in CursoAnchorInfo API 7/N
  Scribe in IMF: Early InkWindow preparation 6/N
2022-01-27 10:32:06 +00:00
TreeHugger Robot
e2c0779ad1 Merge "Indicate which detector triggered the HotwordDetectionService" 2022-01-27 08:36:32 +00:00
TreeHugger Robot
cc016b3496 Merge "Scribe in IMF: Stylus Spy windows Impl 5/N" 2022-01-27 08:33:08 +00:00
Calvin Pan
2801e6de4f Merge changes Ib484fc0c,I2b9ff69c,I0a31b117,I888c65c8,I03723cfe, ...
* changes:
  Clean <plurals> in DateTimeView
  Clean <plurals> in CertificateMonitor
  Clean <plurals> in FillUi
  Clean <plurals> in BugreportProgressService
  Clean <plurals> in keyguard
  Clean <plurals> in ChooserActivity
  Clear <plurals> in TextUtils
  Clean <plurals> in FindActionModeCallback
  Clean <plurals> in ZenModeConfig
  Add util class for plurals
2022-01-27 06:31:58 +00:00
Jing Ji
354efbc368 Merge changes from topic "bg_app_restrictions"
* changes:
  Expose the bg restriction exemption list as an internal API.
  Add an action button to the notification for bg battery abusive apps
  Exempt certain app behaviors for their background battery usage
  Add tracking on abusive broadcast and service binding requests
  Add exemption cases for app background restrictions
  Monitor long-running foreground services
  Post notification on abusive background current drain
  Allow limited alarms/jobs when background restricted
  Cap the LRU position of broadcast receivers in bg restricted apps
  Add a tracker on background current drains for each uid
  Add background restriction levels definition and its controller
2022-01-27 05:57:18 +00:00
lpeter
84cc4accd1 Indicate which detector triggered the HotwordDetectionService
Currently we are adding the metrics to find why there is a significant
drop in assistant successful queries for using trusted hotword. In the
metrics, we need to know which detector is used. In this patch, we
first provide the way to distinguish which detector triggered the
HotwordDetectionService.

Bug: 215633663
Test: atest CtsVoiceInteractionTestCases
Test: atest CtsVoiceInteractionTestCases --instant
Change-Id: I2fa904c5a52d714c9ecb545084ffb60e81ed1d8a
2022-01-27 11:53:16 +08:00