Commit Graph

17073 Commits

Author SHA1 Message Date
TreeHugger Robot
2f446c57fb Merge "Added Ble scan APIs to BatteryStatsManager" 2021-07-08 18:43:28 +00:00
TreeHugger Robot
48f66dba2e Merge "Clarify EditableInputConnection has a public alternative" 2021-07-08 14:58:37 +00:00
Etienne Ruffieux
f771dac97b Added Ble scan APIs to BatteryStatsManager
Added missing service functions to manager to prevent directly
calling BatteryStatsService from Bluetooth package. Updated
system-current.txt accordingly.

Tag: #feature
Bug: 190442794
Test: Manual
Change-Id: Ie6c6d3688d2da45956d57ea1dbc2cc4430f27783
2021-07-08 08:56:34 +00:00
TreeHugger Robot
a743deb5f9 Merge "Rename InputConnectionWrapper to RemoteInputConnection" 2021-07-07 19:51:59 +00:00
Yohei Yukawa
e6cd60da19 Clarify EditableInputConnection has a public alternative
This is a preparation to remove @UnsupportedAppUsage from the
constructor of a hidden class EditableInputConnection.

In most of cases, app developers should be using

  android.view.inputmethod.InputConnectionWrapper

to intercept InputConnection API calls before they are delivered to
EditText as follows.

  final EditText editText = new EditText(activity) {
    @Override
    public InputConnection onCreateInputConnection(
        EditorInfo editorInfo) {
      return new InputConnectionWrapper(
          super.onCreateInputConnection(editorInfo), false) {
        /**
         * {@inheritDoc}
         */
        @Override
        public boolean commitText(
            CharSequence text, int newCursorPosition) {
          // do something
          return super.commitText(text, newCursorPosition);
        }
      };
    }
  };

You can also re-implement BaseInputConnection without hidden APIs
since Android 9.  See CLs that are associated with Bug 24688781 for
details.

This CL makes this fact clear for app developers by using
"publicAlternatives" field in @UnsupportedAppUsage.

Bug: 192969370
Test: presubmit
Change-Id: I0c879645a84fde14dd6444bb4735f543457e43a8
2021-07-07 09:03:53 -07:00
Yohei Yukawa
8426bd7d02 Rename InputConnectionWrapper to RemoteInputConnection
This is a purely mechanical refactoring with no behavior change.

An existing non-API class

  com.android.internal.view.InputConnectionWrapper

has been used only from another non-API class

  android.inputmethodservice.IInputMethodWrapper.

By moving it to android.inputmethodservice package we can make it a
package-private class, which is what this CL is intended
to achieve.

Furthermore, there is another public API class with the same name:

  android.view.inputmethod.InputConnectionWrapper

, which has been confusing with this internal one.  To avoid such a
confusion, this CL also renames this internal one to
RemoteInputConnection.

Other than those mechanical changes, there should be no observable
behavior changes.

Bug: 192412909
Test: atest CtsInputMethodTestCases
Change-Id: Ic0babecd34a6bc80b917050370abc2db5c03d84e
2021-07-07 09:03:34 -07:00
Matt Casey
878423ef22 Merge "Revert RecyclerViewCaptureHelper changes from ag/15083160" into sc-dev am: 5f5e03d3ef am: 6a13a5de2b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15192923

Change-Id: I49a2f2de845c3614de63a8904f3b3aab7bf13cb3
2021-07-07 15:37:04 +00:00
Matt Casey
5f5e03d3ef Merge "Revert RecyclerViewCaptureHelper changes from ag/15083160" into sc-dev 2021-07-07 15:19:41 +00:00
Fiona Campbell
4cb38cabc9 Merge "Clean up framework brightness system" into sc-dev am: 2bb1f86a17 am: e72028befe
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15175190

Change-Id: Id60e0ccace817a2e3dd899b7616e8865544b039e
2021-07-05 17:47:40 +00:00
Fiona Campbell
2bb1f86a17 Merge "Clean up framework brightness system" into sc-dev 2021-07-05 17:22:46 +00:00
Michael Wachenschwanz
c7bf1b517c Merge "Move RPM stats collection out of BatteryStatsImpl.mLock" into sc-dev am: 42f68a76f5 am: d1efed6932
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15189209

Change-Id: I51a3ba56129d3167f2f5c0dc27cbf05142f1b069
2021-07-03 01:59:09 +00:00
Michael Wachenschwanz
42f68a76f5 Merge "Move RPM stats collection out of BatteryStatsImpl.mLock" into sc-dev 2021-07-03 01:41:41 +00:00
Fiona Campbell
7e8d205424 Clean up framework brightness system
Remove brightness_float setting.
Delete unused code.
Use display manager sync root for BrightnessSetting

Bug: 191472484
Test: atest com.android.server.display

Change-Id: I0cc722949081ba5a3aaa9f7fa4ff4e874578925b
2021-07-03 00:10:33 +01:00
Matt Casey
fb0dea3d3c Revert RecyclerViewCaptureHelper changes from ag/15083160
Changes in shared code with ListView implementation seem to have
had negative side effects with Telegram. Revert the old onScrollRequested
implementation for now.

Bug: 189475409
Test: Verify gaps missing from telegram long screenshots
      (and they don't run out of tiles)

Change-Id: Iff81293c6ec34bf3e024e930fe61ba9a1fd95b7b
2021-07-02 23:03:28 +00:00
Michael Wachenschwanz
62a9ff6718 Move RPM stats collection out of BatteryStatsImpl.mLock
Querying RPM stats on device with a large number of StateResidency info
can take a long time. Move the query to outside of the BatteryStats
lock to reduce the chance of lock contention.

Bug: 185970842
Test: atest android.cts.statsd.validation.ValidationTests#testPartialWakelock

Change-Id: I1c69b3f9c071e5d758cf4b22855c4b0ec221a5cf
2021-07-02 15:58:27 -07:00
Song Hu
469f9d3253 Fix sharing shortcuts not showing for Work Profile. Check package by
using selected profile PackageManager.

Test: test on local device
Bug: 175240616
Fixes: 179798044
Change-Id: I30728705dbc60d0506b7d20a16bcc8f1eed9b6d0
(cherry picked from commit 0e4b75a215)
2021-07-02 17:16:28 +00:00
TreeHugger Robot
4e944d4634 Merge "Switch back to sync IInputMethodManager" into sc-dev 2021-07-02 15:22:21 +00:00
Yohei Yukawa
4f904fac9d Merge "Switch back to sync IInputMethodManager" 2021-07-02 14:28:49 +00:00
Tiger Huang
902c5fa9bd Merge "Remove the light flag if the bar isn't specified light in theme" into sc-dev am: de8ea692b1 am: 12ea329d0e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15175031

Change-Id: I54ca1686b0fde7526b4864061d1f8b6ba2d5a0bd
2021-07-02 10:03:50 +00:00
Tiger Huang
de8ea692b1 Merge "Remove the light flag if the bar isn't specified light in theme" into sc-dev 2021-07-02 09:39:40 +00:00
Yohei Yukawa
9dde701446 Switch back to sync IInputMethodManager
This CL logically reverts recent CLs [1][2][3][4][5][6][7][8][9] to
switch back to the previous sync IPC approach in IInputMethodManager
except for the following two IPCs.

 * reportPerceptibleAsync
 * removeImeSurfaceFromWindowAsync

Reason for revert:
We need more time to understand its performance implications.

 [1]: If4b40244a2e0e3b11c38c1da9340ba8e5166ad64
      b9590fa1e1
 [2]: If79e063641a01b325c63eb9f871f5b992d7c0b72
      5a5648dcb5
 [3]: I1547b98b2aacf764e33aadc9ab784f2013f58f2f
      d833f0dab4
 [4]: I646ef4ae0570aae1812ea267f309441fdec6938d
      38fd020616
 [5]: Iaa63e01453da4ff0e3f446eac036b3be3180cb73
      4a820ccc41
 [6]: Id516fd1c961f43ac3e139c88d7ed004c188d458b
      0a32fd21ef
 [7]: Icb396ae5d74060af69c4ecb16723b2e37b9f2067
      c4663ba6a9
 [8]: I3eafbc28ed3acf3ba859885bf201cb06b3149b94
      f226a79fee
 [9]: Ic584203c1221fbae17f5e2d8f09e3992df061646
      5e2d9f271d

Bug: 163453493
Bug: 174892351
Fix: 190486491
Test: atest CtsInputMethodTestCases
Change-Id: If16ac0de536d9089eb04f6e07b1ee47378124658
Merged-In: If16ac0de536d9089eb04f6e07b1ee47378124658
2021-07-02 07:06:07 +00:00
Yohei Yukawa
662b48b72d Switch back to sync IInputMethodManager
This CL logically reverts recent CLs [1][2][3][4][5][6][7][8][9] to
switch back to the previous sync IPC approach in IInputMethodManager
except for the following two IPCs.

 * reportPerceptibleAsync
 * removeImeSurfaceFromWindowAsync

Reason for revert:
We need more time to understand its performance implications.

 [1]: If4b40244a2e0e3b11c38c1da9340ba8e5166ad64
      b9590fa1e1
 [2]: If79e063641a01b325c63eb9f871f5b992d7c0b72
      5a5648dcb5
 [3]: I1547b98b2aacf764e33aadc9ab784f2013f58f2f
      d833f0dab4
 [4]: I646ef4ae0570aae1812ea267f309441fdec6938d
      38fd020616
 [5]: Iaa63e01453da4ff0e3f446eac036b3be3180cb73
      4a820ccc41
 [6]: Id516fd1c961f43ac3e139c88d7ed004c188d458b
      0a32fd21ef
 [7]: Icb396ae5d74060af69c4ecb16723b2e37b9f2067
      c4663ba6a9
 [8]: I3eafbc28ed3acf3ba859885bf201cb06b3149b94
      f226a79fee
 [9]: Ic584203c1221fbae17f5e2d8f09e3992df061646
      5e2d9f271d

Bug: 163453493
Bug: 174892351
Fix: 190486491
Test: atest CtsInputMethodTestCases
Change-Id: If16ac0de536d9089eb04f6e07b1ee47378124658
2021-07-02 07:05:45 +00:00
Lucas Lin
c7a2b409db Merge "Fix Ikev2 vpn cannot establish through startLegacyVpn()" into sc-dev am: 30d17bd9a1 am: ab8b92f6ac
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15125750

Change-Id: Id3314185bf7d5487f4e03e637b5cc64deeb4780f
2021-07-02 05:48:03 +00:00
Lucas Lin
30d17bd9a1 Merge "Fix Ikev2 vpn cannot establish through startLegacyVpn()" into sc-dev 2021-07-02 05:27:30 +00:00
Charles Chen
73c59237fe Merge "Remove updateImeDisplayId" into sc-v2-dev am: 56e17bfcd8 am: ebf2e81d46
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15065650

Change-Id: I15b4412061117df48156736a4536bb7d43ddd3f6
2021-07-02 03:52:03 +00:00
Charles Chen
ebf2e81d46 Merge "Remove updateImeDisplayId" into sc-v2-dev am: 56e17bfcd8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15065650

Change-Id: I3b0e814649cc9debd60c00bf2be933a50a59fb3a
2021-07-02 03:36:08 +00:00
Charles Chen
56e17bfcd8 Merge "Remove updateImeDisplayId" into sc-v2-dev 2021-07-02 03:20:32 +00:00
Tiger Huang
0eb56cb359 Remove the light flag if the bar isn't specified light in theme
Previously, PhoneWindow will add the light flag for the bar if it is
specified light in theme. It won't remove the light flag if the theme is
not light. The previous logic in PhoneWindow#generateLayout assumes the
decor view was newly created.

However, the decor view can be reused from the preserved window. This
happens if the activity is recreated. So if the previous activity was in
a light theme and the newly created activity is in a dark theme, we
should clear the light bar flags added in the previous activity.

Fix: 174502412
Test: 1. Set Dialer (Phone) to dark theme from Dialer's display options.
      2. Clear app data from Dialer's app info.
      3. Open Dialer again and see if the color of system bars are
         normal.
Change-Id: I3ea61322e4c3cfe26981e23792f42ab0b9a1e217
2021-07-01 23:25:51 +08:00
TreeHugger Robot
30992d5f89 Merge changes I5bdc1f46,Idd24fd51 into sc-dev am: cfe4767b40 am: 5feaa3a962
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15113790

Change-Id: I446b4de09607db8326b5f8cffe939ad24697e1f3
2021-07-01 13:56:41 +00:00
TreeHugger Robot
ac4597bf19 Merge changes I5bdc1f46,Idd24fd51 into sc-dev am: cfe4767b40 am: 3bbaa52c9e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15113790

Change-Id: Id31712deabe80ed29e85a65b9d78387f0d8dd5a6
2021-06-30 22:07:52 +00:00
TreeHugger Robot
3bbaa52c9e Merge changes I5bdc1f46,Idd24fd51 into sc-dev am: cfe4767b40
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15113790

Change-Id: I40ea8875f98ea2e9efe21c13a17cf6d2e83bca3a
2021-06-30 22:04:19 +00:00
TreeHugger Robot
cfe4767b40 Merge changes I5bdc1f46,Idd24fd51 into sc-dev
* changes:
  Sharesheet style updates
  Update Edit icon.
2021-06-30 22:00:33 +00:00
TreeHugger Robot
5ad183eb9c Merge "Introduce IInputContextInvoker for better readability" 2021-06-30 20:32:50 +00:00
TreeHugger Robot
5ec70e9530 Merge "Log IME tracing even when RemoteException is thrown from IC" 2021-06-30 19:48:48 +00:00
Dmitri Plotnikov
82c4fce0a1 Merge "Fix boot time BatteryStats reset failure" into sc-dev am: ebf77ebc51 am: bea4bac02c am: 9285cf57dd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15128655

Change-Id: Iaf0d929b7c8cbe3e1398de82a71e3c2bc32fc1ef
2021-06-30 19:36:17 +00:00
Dmitri Plotnikov
9285cf57dd Merge "Fix boot time BatteryStats reset failure" into sc-dev am: ebf77ebc51 am: bea4bac02c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15128655

Change-Id: I2d5f02809e76c8f9381917ed307de46a3a3ba029
2021-06-30 19:25:04 +00:00
Dmitri Plotnikov
f65cbbbe42 Merge "Fix boot time BatteryStats reset failure" into sc-dev am: ebf77ebc51
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15128655

Change-Id: Ic6603505265ed644c72a5042fc30011ea1fbd149
2021-06-30 19:12:49 +00:00
TreeHugger Robot
29aa577609 Merge "Pause watchdog monitor for incfs native lib extraction" into sc-dev am: 920e1fd7a6 am: 6611a10a66 am: 9274ed1674
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15147287

Change-Id: I0c9fa3d6231853c2438f711480130a268ffbc832
2021-06-30 19:12:35 +00:00
Dmitri Plotnikov
bea4bac02c Merge "Fix boot time BatteryStats reset failure" into sc-dev am: ebf77ebc51
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15128655

Change-Id: I4681840e210a25d27ecb03ff30da088721f2fc8b
2021-06-30 19:12:17 +00:00
Dmitri Plotnikov
ebf77ebc51 Merge "Fix boot time BatteryStats reset failure" into sc-dev 2021-06-30 18:53:20 +00:00
TreeHugger Robot
9274ed1674 Merge "Pause watchdog monitor for incfs native lib extraction" into sc-dev am: 920e1fd7a6 am: 6611a10a66
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15147287

Change-Id: I7b59474dc6bf65fa5912da0061b2fa2a4759a3f9
2021-06-30 18:34:07 +00:00
TreeHugger Robot
5e26f746c1 Merge "Pause watchdog monitor for incfs native lib extraction" into sc-dev am: 920e1fd7a6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15147287

Change-Id: I91744e9e4b80a73f5831270251a119c49f03e230
2021-06-30 18:27:44 +00:00
TreeHugger Robot
6611a10a66 Merge "Pause watchdog monitor for incfs native lib extraction" into sc-dev am: 920e1fd7a6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15147287

Change-Id: I41be5812173b379543da8d777673da3e7ce519a0
2021-06-30 18:27:00 +00:00
Dmitri Plotnikov
bcd46f1ed4 Fix boot time BatteryStats reset failure
We need some services to create a battery stats snapshot
captured at the time of battery reset.
The issue is that if the battery stats reset occurs during boot,
before the system is ready, those services may not be prepared.

The fix is to postpone battery stats reset until after the
system server is ready.

Also, we will now reset the stats if battery got partially charged
and discharged repeatedly without ever reaching the full charge.
This will prevent battery sessions from going on forever and
overflowing internal data structures.

This CL partially reverts 0ed84f1263

Bug: 192252233
Test: run PowerOnOffTest#testPowerOnOff repeatedly
Change-Id: Ib486e4caeeac7c933288c3a1055259c05f45c6c8
2021-06-30 17:07:58 +00:00
Yohei Yukawa
cdd13118af Introduce IInputContextInvoker for better readability
This is a purely mechanical refactoring with no no behavior change.

With this CL, InputConnectionWrapper no longer deals with boilerplate
code around IInputContext such as RemoteException handling.

Bug: 192412909
Test: atest CtsInputMethodTestCases
Change-Id: I0ea27e915a07699a4c124750266d84346fbd7bf6
2021-06-30 09:54:14 -07:00
Yohei Yukawa
934fe8b2a5 Log IME tracing even when RemoteException is thrown from IC
This is a small preparation to consolidate RemoteException handling
out from InputConnectionWrapper.

With this CL, InputConnectionWrapper no longer early-exits when a
RemoteException is thrown but just falls through to IME tracing logic.
By making this small change, the next CL [1] can split out
RemoteException handling from InputConnectionWrapper as a pure
refactoring.

Anyway neither users nor developers can observe this change unless
they are carefully checking IME tracing result when the IME target app
is being killed.

 [1]: I0ea27e915a07699a4c124750266d84346fbd7bf6

Bug: 192412909
Test: atest CtsInputMethodTestCases:InputConnectionBlockingMethodTest
Change-Id: I5c778a1097e7f05eeff27e7a72966f613076a801
2021-06-30 00:23:09 -07:00
Wilson Wu
28429a218b Merge "Remove multi-client IME" 2021-06-30 01:34:37 +00:00
Yurii Zubrytskyi
337f73edc9 Pause watchdog monitor for incfs native lib extraction
Native library extraction potentially takes much longer time for
Incremental installations vs the regular ones: each page can
wait for up to 10s (adb) or 100ms (non-adb), adding up to the
full watchdog timeout of 1 min and triggering a reboot.

This CL pauses Watchdog for the thread that's running extraction
to make sure we don't try to fix a hanging single installation
with killing the OS.

Bug: 191166673
Fixes: 191166673
Test: atest package manager and incremental suites
Change-Id: I9c4c24f305e079f346a76b64d4841cdbd58734fa
2021-06-29 16:21:12 -07:00
TreeHugger Robot
7ffb3ce39c Merge "Add global app op restrictions" into sc-dev am: 0ac141c3ba am: f538cb084e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15080961

Change-Id: Id2db395759e66be890540ca86450b2c5bf67b2ec
2021-06-29 20:37:32 +00:00
TreeHugger Robot
858b271a9a Merge "Add global app op restrictions" into sc-dev am: 0ac141c3ba am: 6ccd19fdbe
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15080961

Change-Id: I05c8cec2eb96110a4972c5f307857a6d8d6da046
2021-06-29 20:22:27 +00:00