Commit Graph

19748 Commits

Author SHA1 Message Date
Yohei Yukawa
3ca950724c Simplify FINISH_INPUT_NO_FALLBACK_CONNECTION handling
This is the 6th CL for Bug 26851566 [1][2][3][4][5].

In the CLs [3][5], the approach we took was to extend an existing IPC
method

  IInputMethodClient#setActive(boolean active, boolean fullscreen)

by adding one more parameter "reportToImeController".

However, it seems that such an approach made its handling code hard to
maintain, because the IPC method needed to behave in a completely
different manner depending on the newly introduced parameter.

To avoid such a confusion and to make subsequent refactoring easier,
this CL introduces a new IPC method

  IInputMethodClient#setInteractive(
          boolean interactive, boolean fullscreen)

to clarify what we are actually doing.

In most cases there must be no observable behavior change.  One
possible behavior change is when setInteractive() gets called when
IMM#mCurRootView.getView() is not available.  In the previous CL, we
fell back to previous behavior as if
FINISH_INPUT_NO_FALLBACK_CONNECTION was not defined.  However it looks
like such a fallback mechanism is not an intentional behavior.

The main use case is still verified with existing CTS tests [6][7].

 [1]: Ic11956fe745a829da1ec7c09ea214e9b3961c8e0
      0df8812486
 [2]: If06daf71160aa44a4254ac125561974ecbdef4f2
      2c6e80be12
 [3]: I8a657e75e274d842fb46b60375f6aeafeab96a59
      152eacec4f
 [4]: I16f4a34360a2f64b69978724648a9be741f140b5
      3d62f739a8
 [5]: Id4e71a822bfde5fe6a263bbe094c0d238017efe1
      3d62f739a8
 [6]: Iba0332ed3b767a9a15768b64947b9cde31105af1
      e2f4138156c784746becde6a01c19f0c3de6ac32
 [7]: I346ef42f2546a2925bf44ca7719ae19399e15e78
      84c5ec2f81d4be5285b9c5f1d0e943f808e9158c

Bug: 26851566
Bug: 156215187
Test: atest InputMethodStartInputLifecycleTest
Change-Id: I0c95d7e70357ac98b336cd1b51a7405ba92a9a6f
2022-10-15 14:54:34 -07:00
Andrey Epin
b58a452b31 Merge "Load direct-share icons asynchronously" into tm-qpr-dev am: 087c3d1918 am: 03b221874b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19920873

Change-Id: Icefe32e65e2fb88660ffa3ebcb432313b90d9db0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-13 21:58:16 +00:00
Andrey Epin
03b221874b Merge "Load direct-share icons asynchronously" into tm-qpr-dev am: 087c3d1918
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19920873

Change-Id: I0c5ca0aa635f8cfe51a16082187cf2476e6c3f47
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-13 21:25:39 +00:00
Andrey Epin
087c3d1918 Merge "Load direct-share icons asynchronously" into tm-qpr-dev 2022-10-13 20:50:28 +00:00
TreeHugger Robot
33cef05d7d Merge "Refactor updateState method for trusted hotword" 2022-10-13 02:59:06 +00:00
Andrey Epin
0313161023 Merge "Fix Resolver dragging animation" into tm-qpr-dev am: adad5c91bd am: 7de4fa9bd2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19719026

Change-Id: Ic6813b4c9d5c61dbd224a4438365d602114dbb87
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-12 17:46:12 +00:00
Andrey Epin
7de4fa9bd2 Merge "Fix Resolver dragging animation" into tm-qpr-dev am: adad5c91bd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19719026

Change-Id: I30639003d4944eed4f10ff78168cbfe6cc9a5161
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-12 17:13:43 +00:00
Andrey Epin
adad5c91bd Merge "Fix Resolver dragging animation" into tm-qpr-dev 2022-10-12 17:07:20 +00:00
TreeHugger Robot
a2f02ea1e8 Merge "Update DreamService -> DreamOverlayService connection to handle crashes" into tm-qpr-dev am: 2ab63d23d3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20107778

Change-Id: Ied0ea3a6d52dab588907872f3170547a667b0b15
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-12 15:16:58 +00:00
TreeHugger Robot
2ab63d23d3 Merge "Update DreamService -> DreamOverlayService connection to handle crashes" into tm-qpr-dev 2022-10-12 14:53:54 +00:00
lpeter
ec669ddecd Refactor updateState method for trusted hotword
Test: atest CtsVoiceInteractionTestCases
Bug: 193232191
Change-Id: I781f9595e9c5016ba81e478e7f550d805699f7fb
2022-10-12 17:55:32 +08:00
Lucas Silva
7856a35e20 Update DreamService -> DreamOverlayService connection to handle crashes
This change implements PersistentServiceConnection and
ObservableServiceConnection helper classes in framework for better
handling of crashes.

Fixes: 247103878
Test: manually by crashing systemui using adb while dreaming and
verifying that the overlay is visible
Test: atest com.android.internal.util.PersistentServiceConnectionTest
Test: atest com.android.internal.util.ObservableServiceConnectionTest

Change-Id: Ib9a7e8675e408c1724567335a3c186fe5c9f5f59
2022-10-12 03:25:28 +00:00
Taran Singh
2ae0de31d3 Merge "Remove inkWindow after stylus idle-timeout" 2022-10-11 16:12:14 +00:00
Lucas Silva
7bbcdc1c01 Update DreamService -> DreamOverlayService connection to handle crashes
This change implements PersistentServiceConnection and
ObservableServiceConnection helper classes in framework for better
handling of crashes.

Fixes: 247103878
Test: manually by crashing systemui using adb while dreaming and
verifying that the overlay is visible
Test: atest com.android.internal.util.PersistentServiceConnectionTest
Test: atest com.android.internal.util.ObservableServiceConnectionTest

Change-Id: Ib9a7e8675e408c1724567335a3c186fe5c9f5f59
Merged-In: Ib9a7e8675e408c1724567335a3c186fe5c9f5f59
2022-10-11 13:37:59 +00:00
Philip Junker
9b5f8d21ed Merge "Sync BatteryStats user activity types with PowerManager ones." into tm-qpr-dev 2022-10-07 15:32:21 +00:00
TreeHugger Robot
7a46571285 Merge "[2/2] Fix sharing to another profile where an app has multiple targets" into tm-qpr-dev am: dd4fc6db67 am: 6f4ad539f6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20063949

Change-Id: I34d6a519c46ad8066cbd633b27444f2284535666
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-07 14:33:14 +00:00
TreeHugger Robot
6f4ad539f6 Merge "[2/2] Fix sharing to another profile where an app has multiple targets" into tm-qpr-dev am: dd4fc6db67
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20063949

Change-Id: I6175a98e7c4b596916fd3b5bc08629a9d64176bb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-07 13:59:11 +00:00
TreeHugger Robot
dd4fc6db67 Merge "[2/2] Fix sharing to another profile where an app has multiple targets" into tm-qpr-dev 2022-10-07 12:52:26 +00:00
Philip Junker
715cba5f63 Sync BatteryStats user activity types with PowerManager ones.
Add more logs when entering doze.

Bug: 243518837
Test: atest BatteryStatsTests
Test: atest PowerManagerServiceTest
Test: manually observe logs using logcat / adb bugreport

Change-Id: I234a999cf41da0346ce4d9f05663cae116b095a3
Merged-In: I234a999cf41da0346ce4d9f05663cae116b095a3
2022-10-07 08:17:41 +00:00
Philip Junker
998b368a66 Merge "Sync BatteryStats user activity types with PowerManager ones." into tm-qpr-dev-plus-aosp 2022-10-07 08:17:18 +00:00
Dmitri Plotnikov
a64fd1b4db Merge "Use varint to record cpu usage data and measured energy in battery history" 2022-10-06 22:13:33 +00:00
Jeff Sharkey
59182b3b9f Merge changes from topic "oct3"
* changes:
  BroadcastQueue: periodic internal health check.
  BroadcastQueue: mark dump methods @NeverCompile.
  More tests for BroadcastRecord.
  Relax broadcast ANR timeouts based on run_delay.
  BroadcastQueue: more debugging information.
  BroadcastQueue: add support for wait-for-barrier.
  BroadcastQueue: add support for REPLACE_PENDING.
  BroadcastQueue: add support for priority tranches.
2022-10-06 22:04:25 +00:00
Andrey Epin
a54f0d13a6 Load direct-share icons asynchronously
Move direct-share icons loading off the main thread in the same way
we're loding A-Z icons.

Test: Manual testing with rotatin and screen locking, artificially
delaying image loading, debug logging for potential event loops.
Test: atest ChooserListAdapterTest
Fix: 215699869
Change-Id: I97e3383a74bb4ef795099fe55cae9fc5aed2b790

Change-Id: I3b110447d4cf2ab94e663c2684cd2cce4968d4ca
2022-10-06 14:42:05 -07:00
Derek Jedral
1d32dd2293 Merge "Revert "Fix TrustAgent showing unclear string."" into tm-qpr-dev am: 84e68e28b2 am: a9104016ea
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20122571

Change-Id: If9c9436bdc9bc6473b17b54132747b7068c32a0a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-06 18:10:39 +00:00
Derek Jedral
a9104016ea Merge "Revert "Fix TrustAgent showing unclear string."" into tm-qpr-dev am: 84e68e28b2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20122571

Change-Id: I57e7259014605c40712b406e285e30b0cd1a3f71
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-06 17:36:54 +00:00
Dmitri Plotnikov
d837100844 Use varint to record cpu usage data and measured energy in battery history
Bug: 244623253
Test: atest FrameworksServicesTests:BatteryStatsTests
Change-Id: Idce38be9badf8f2460acb5eafe3367c9a2cbb0c3
2022-10-06 10:01:58 -07:00
Derek Jedral
84e68e28b2 Merge "Revert "Fix TrustAgent showing unclear string."" into tm-qpr-dev 2022-10-06 17:00:01 +00:00
Philip Junker
9e1f0003d3 Merge "Initialize ContentObserver in startObserving()." into tm-qpr-dev am: af0795a722 am: e9c793f8c4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20111661

Change-Id: Ie1890672bf962e49bc7cf1630012afb6d0a28f1b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-06 16:53:36 +00:00
Dmitri Plotnikov
3416dc96f1 Merge "Add CPU time-in-state data to battery history" 2022-10-06 16:51:23 +00:00
Jeff Sharkey
a6805188ff Relax broadcast ANR timeouts based on run_delay.
When the majority of CPU resources are being consumed by other
more-important tasks on the device, a broadcast receiver running at
a lower priority could end up triggering the ANR deadline due to
being starved for resources, which is unfair to that app.

This change relaxes the broadcast ANR timeout relative to the
amount of time a process was runnable-but-waiting, up to double the
normal ANR timeout.

Bug: 241829443
Test: atest FrameworksCoreTests:ProcessCpuTrackerTest
Test: atest FrameworksMockingServicesTests:BroadcastQueueTest
Test: atest FrameworksMockingServicesTests:BroadcastQueueModernImplTest
Change-Id: I903c3fa16e4bd64f1660bd0fb2f221b7b82f3661
2022-10-06 10:47:50 -06:00
Philip Junker
e9c793f8c4 Merge "Initialize ContentObserver in startObserving()." into tm-qpr-dev am: af0795a722
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20111661

Change-Id: I81b04a769382ef1c5c8df1129f4b12db73462eaf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-06 16:20:42 +00:00
Philip Junker
af0795a722 Merge "Initialize ContentObserver in startObserving()." into tm-qpr-dev 2022-10-06 15:47:39 +00:00
Philip Junker
4928d74f0d Sync BatteryStats user activity types with PowerManager ones.
Add more logs when entering doze.

Bug: 243518837
Test: atest BatteryStatsTests
Test: atest PowerManagerServiceTest
Test: manually observe logs using logcat / adb bugreport

Change-Id: I234a999cf41da0346ce4d9f05663cae116b095a3
Merged-In: I234a999cf41da0346ce4d9f05663cae116b095a3
2022-10-06 12:32:48 +00:00
TreeHugger Robot
d6e7cef873 Merge "Inform Assistant visible activity when the stage of activity lifecycle is invoked." 2022-10-06 02:08:43 +00:00
Dmitri Plotnikov
c70cff6ad7 Add CPU time-in-state data to battery history
Bug: 244623253
Test: atest FrameworksServicesTests:BatteryStatsHistoryTest

Change-Id: I12ca7e8951e00bcc264f74b84b14b1c51cb095a8
2022-10-05 18:36:16 -07:00
Derek Jedral
f60d171a4b Revert "Fix TrustAgent showing unclear string."
This reverts commit 140516bf65.

Reason for revert: Bug where users cannot use biometrics to re-auth after trustagent timeout.

Bug: 251078638
Change-Id: I6254196327e09381eaa047e6444034ada6030113
2022-10-05 19:42:49 +00:00
Philip Junker
90e2f37790 Initialize ContentObserver in startObserving().
This removes a race condition where ContentObserver is initialized
while mHandler is null which causes the ContentObserver#onChange() callback to run on a different thread and can cause an NPE.

Bug: 246843362
Test: manual
Test: atest BrightnessSynchronizerTest
Change-Id: Ib8e192c3961390ece721fa473d5c09323c30bafe
2022-10-05 14:30:47 +00:00
Andrey Epin
3b1524af50 Merge "Load icons and labels only once" into tm-qpr-dev am: 3002386445 am: 260401b184
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19961127

Change-Id: I78f85d33d44d7ef9ac23c29fc9576e45a0dcb07d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-04 21:35:31 +00:00
Andrey Epin
260401b184 Merge "Load icons and labels only once" into tm-qpr-dev am: 3002386445
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19961127

Change-Id: I79d2abc85622e57dbb004a4df7cd73635fd1f5d6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-04 21:06:26 +00:00
Andrey Epin
3002386445 Merge "Load icons and labels only once" into tm-qpr-dev 2022-10-04 20:39:58 +00:00
Eric Biggers
fd8bf04f1f Merge changes from topic "sps-on-creation"
* changes:
  Make the CE key always be encrypted by the synthetic password
  Give all users SP-based credentials
  Unlock user keys from LockSettingsService only
2022-10-04 20:21:45 +00:00
Matt Casey
7b19c4b99f Merge "Copy multi-image editor fix to QPR" into tm-qpr-dev 2022-10-04 20:01:43 +00:00
Eric Biggers
78e245a21a Give all users SP-based credentials
Make it so that every user gets a synthetic password (SP).  Previously,
users only got an SP if an LSKF or escrow token was set at least once.

For normally created users, create the SP by making UserManagerService
call the new method LSS.createNewUser(), just after the prerequisite
steps of createUserKey and prepareUserData.  As this now results in the
allocation of LSS state (e.g. a Weaver slot) before the user is fully
created, LSS can no longer rely on ACTION_USER_REMOVED for cleaning up
its state, so instead make UserManagerService.destroyUserState() call
LSS.removeUser().  Note that ACTION_USER_REMOVED isn't sent for
pre-created users, so as a side effect this change also fixes a bug
where LSS state for pre-created users wasn't removed immediately.

For the system user, which doesn't go through the normal user creation
flow, make LSS create the SP upon PHASE_BOOT_COMPLETED.  At the same
time, also create SPs for any other users who don't have one yet; this
handles users that were created by older versions of Android.

This change makes things more consistent.  It is also a prerequisite to
making it so that a Weaver value is always needed to unlock the CE key
if the device supports Weaver; this is important since Weaver may be the
only available securely erasable storage.  A later CL will implement
this by making the CE key be always bound to the SP.  For now, the CE
key remains unlockable separately from the SP when there is no LSKF.

Test: see Ia753ea21bbaca8ef7a90c03fe73b66c896b1536e
Bug: 232452368
Change-Id: Ic82084fe9d9bb34ee9640dea027963043afca9c2
2022-10-04 16:41:28 +00:00
Eric Biggers
3d5653e11e Unlock user keys from LockSettingsService only
In preparation for making the CE key of each user always be protected by
the user's synthetic password even when the user has no LSKF, make
LockSettingsService the sole caller of IStorageManager.unlockUserKey().

For the opportunistic secret-less unlock by UserController at user start
time, call a new method LSS.unlockUserKeyIfUnsecured().  For now this
method calls IStorageManager.unlockUserKey() with a null secret.  Later
it will unwrap the user's synthetic password if needed.

For the unlock via credential verification that is triggered by LSS,
make LSS call IStorageManager.unlockUserKey() before calling
IActivityManager.unlockUser(), rather than passing the SP-derived secret
to IActivityManager.unlockUser() for it to do the unlockUserKey().

Since neither the secret nor the token arguments to
IActivityManager.unlockUser() are used anymore, add a new method
IActivityManager.unlockUser2() that lacks these arguments.  Note that
method name overloading cannot be used because AIDL doesn't support it.

Test: atest com.android.server.locksettings && \
      atest com.android.server.am.UserControllerTest \
            com.android.server.pm.UserManagerServiceTest \
            com.android.server.pm.UserManagerTest
Test: Boot and reboot Cuttlefish
Bug: 232452368
Change-Id: I8971b92bb5055fca8e19e0f9d14e8f0a7022b453
2022-10-04 16:41:23 +00:00
Liahav Eitan
a4fe4bd9a2 [2/2] Fix sharing to another profile where an app has multiple targets
Complete the change in ag/19657256 to also apply in SelectableTargetInfo.
That would ensure that in all cases of cross-profile targets the URIs
are fixed to include the user-id prefix.

Bug:244876518
Bug:242605257
Test: manually share image from work Photos app to personal WhatsApp's
frequent contact target.

Change-Id: Ib41c8a3c46afcc2d62a4c1a924212bcd98bcfbe4
2022-10-04 09:15:39 +00:00
Andrey Epin
cd7c00c36e Load icons and labels only once
The current implementation triggers icon loading each time a view gets
bound and, as binding happens multiple times, icon and label loadings
are unnecessarily duplicated. In addition, as a loading task never gets
canceled, there’re cases (like in the associated ticket) when a view
gets rapidly bound to multiple positions and all the icon loadings
eventually catches up updating it, ending up in icons rapidly changing
on the screen for the view.
This change addresses this by simplifying the icon loading/binding
logic: a view is always bound to the current data and the task is only
updates the data with the missing piece of info once (and applied for
both icons and label loading tasks).
There is one extra change in ResolverActivity due to LoadIconTask
interface change and cancellation logic for the tasks.

Fix: 245934835
Test: Manual tests on a list which does not fit into the screen.
Test: Manual tests with arficial delays added into the tasks.
Test: atest FrameworksCoreTests:ResolverActivityTest
Test: atest FrameworksCoreTests:ChooserActivityTest
Change-Id: I76fe5663523232a74d4f505c535cd6dbcf7f8759
2022-10-03 22:38:47 -07:00
TreeHugger Robot
5baed8b6f4 Merge "Use @EnforcePermission for IIMM#isInputMethodPickerShownForTest()" 2022-10-04 02:38:54 +00:00
TreeHugger Robot
80c068c107 Merge "Implement TIP3." 2022-10-04 00:23:10 +00:00
Andrey Epin
2e1805e892 Fix Resolver dragging animation
Adds a new ResolverDrawerLayout XML property, ignoreOffsetTopLimit, that
takes a direct child view’s id. The specified view will serve as a top
limit for all child views below it with layout_ignoreOffset attribute
set to true i.e. they will be pushed down by the view when the drawer
is moving.

Fix: 240481385
Test: atest FrameworksCoreTests:ResolverActivityTest
Test: atest FrameworksCoreTests:ChooserActivityTest
Test: Manual testing with some injected code that simulates various
conditions:
  * various property values or property absence
  * simultaneous layout and drawer moving
  * one-time layout while an "ignoreOffset" view has been moved out of
    place with a consequent release.

Change-Id: Ib9aa4f11d35c2dede06b0913091e7b146438e57e
2022-10-03 17:21:29 -07:00
Yohei Yukawa
aa29be8dda Use @EnforcePermission for IIMM#isInputMethodPickerShownForTest()
This is a follow up CL to my previous CL [1], which locked down

  IInputMethodManager#isInputMethodPickerShownForTest()

with

  android.Manifest.permission.TEST_INPUT_METHOD

permission.

After the original CL was committed the severity assessment was
performed again and in the updated assessment it was concluded that
denial logging was not necessary.  With that, this CL simplifies the
logic by using

  @EnforcePermission

annotation in the ADIL method definition.

Note that there must be no developer-observable behavior change in
this CL, and the security test that was added as part of the original
effort [2] still verifies that the method in question is indeed
guarded with "TEST_INPUT_METHOD" permission.

 [1]: Ie79a3e9d41ce22605ae083594d639c37d08b7def
      b869c78380
 [2]: Idf907e3b762307696a3a7ca11470b0c44b9b7aa4
      3e1dd9d2797f818766105247e3634da525fec8e8

Bug: 237317525
Test: atest CtsInputMethodTestCases:InputMethodManagerTest#testIsInputMethodPickerShownProtection
Change-Id: Ib3f56b1ab1538742a2bf64fec435ced5b8f90bc2
2022-10-03 15:54:37 -07:00