Commit Graph

17317 Commits

Author SHA1 Message Date
Alison Cichowlas
5097eb8eed Merge "Temporary @ignores for failing tests. Move tests to presubmit." 2021-08-25 13:58:28 +00:00
Dmitri Plotnikov
13b0aa2aef Merge "Prevent zero-division in the absence of measured system server drain" 2021-08-25 00:33:55 +00:00
Alison Cichowlas
0fdc5eaffc Temporary @ignores for failing tests. Move tests to presubmit.
Will come around in follow-up CL to fix & un-ignore.

Test: atest --test-mapping frameworks/base/core/java/com/android/internal/app
Change-Id: I99e98d3485c29722529f3619a624b5bd95126590
2021-08-25 00:18:18 +00:00
Joshua Trask
6ded7a4146 Remove ChooserTargetServiceConnection from adapter
In the new flow, ChooserListAdapter didn't actually depend
on this data for anything (and ChooserActivity only ever
sent an empty list). In preparation for removing the
(internal) ChooserTargetServiceConnection class altogether,
this CL removes it from the ChooserListAdapter API: the
only reference outside of ChooserActivity.

Test: compiles.
Change-Id: I2c379562e47fba405714b08632118af2e16d8a40
2021-08-24 18:02:48 -04:00
Dmitri Plotnikov
0312c36cc7 Prevent zero-division in the absence of measured system server drain
Bug: 197237752
Test: atest CtsDumpsysHostTestCases:android.dumpsys.cts.BatteryStatsDumpsysTest#testBatterystatsOutput -- --abi arm64-v8a
Change-Id: I18a1b563a066bcabe686a12fd9c93d3838ed0d10
2021-08-24 14:10:59 -07:00
Joshua Trask
cca005c11f Merge "Remove watchdog timer logic in ChooserActivity." 2021-08-24 20:22:45 +00:00
Neha Jain
4375f00381 Merge "ims: Version support for uce feature tags" into sc-dev am: d446e80289 am: a8a7058f4f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15515803

Change-Id: Ia33197ef4466909d748506f152315906606e79fd
2021-08-24 18:39:24 +00:00
Jeff DeCew
54aabf01db Merge "Add notifications team as OWNERS of notification-related utilities and their tests" am: 39366563d3 am: bce9262c0d am: a9185e3a4f am: 2f1354521a am: 225ee7c619
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1796768

Change-Id: Ic1e5937c08ec454c6f427fc9d6ca3bde972ffaea
2021-08-24 18:08:34 +00:00
Jeff DeCew
225ee7c619 Merge "Add notifications team as OWNERS of notification-related utilities and their tests" am: 39366563d3 am: bce9262c0d am: a9185e3a4f am: 2f1354521a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1796768

Change-Id: I89a58c2e6590b102fa54ef42dd616b23007ab0a1
2021-08-24 17:46:50 +00:00
Jeff DeCew
2f1354521a Merge "Add notifications team as OWNERS of notification-related utilities and their tests" am: 39366563d3 am: bce9262c0d am: a9185e3a4f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1796768

Change-Id: If65518b6c220614e35bd8e873facd66c13a89c76
2021-08-24 17:45:45 +00:00
Jeff DeCew
a9185e3a4f Merge "Add notifications team as OWNERS of notification-related utilities and their tests" am: 39366563d3 am: bce9262c0d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1796768

Change-Id: I30d28b693988ab1234dc951ff3a7ca7fc1640ac9
2021-08-24 17:34:07 +00:00
Jeff DeCew
bce9262c0d Merge "Add notifications team as OWNERS of notification-related utilities and their tests" am: 39366563d3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1796768

Change-Id: I6bd3759e5e7e37aaa1a2dbcda3b0ecba073a67a0
2021-08-24 17:13:15 +00:00
Pavan Kumar M
6624e2aa57 ims: Version support for uce feature tags
Add version support for uce feature tags

Bug: 175092320
Bug: 193992611
Bug: 193543670
Change-Id: I8b62b9b9d7ae271bc623764d545db1320b4dc64f
2021-08-24 01:39:55 +00:00
Dmitri Plotnikov
7058a51deb Merge "Add LongArrayMultiStateCounter" 2021-08-24 00:06:46 +00:00
Joshua Trask
9fbb0d35e8 Remove watchdog timer logic in ChooserActivity.
This timeout was intended for the deprecated ChooserTargetService,
and as of ag/15644659 we no longer rely on it in the new flow.

Since we're no longer dependent on CTS connections for our
completion conditions, the timeout-handling logic was always fired
both on the "min" and the "max" watchdog periods, apparently
resulting in a spurious additional logDirectShareTargetReceived
call (both with ACTION_DIRECT_SHARE_TARGETS_LOADED_CHOOSER_SERVICE).
The new condition added in ag/15644659 results in an *additional*
spurious log event when the share targets are finished loading,
but as of this CL that load-completion callback will be the sole
place that we perform the logging.

Test: manual / presubmits
Change-Id: Ied1f7c90159d4db42669f0b7e046a9c0a16cb6d0
2021-08-23 17:00:20 -04:00
Joshua Trask
04b56be783 Add explicit completion condition for Direct Share
Prior to this change, we've implicitly relied on the async
Direct Share results coming in before the service watchdog
timer goes off. This has several issues -- the results may
not *actually* come in before the timeout; the old flow
still depended on us waiting for the full timeout even if
we were done sooner; and it's only somewhat inci dental
that we were even still scheduling the timer in the first
place, since that occurs on a code branch that's slated
for deletion. This CL makes those assumptions explicit in
preparation to remove the timeout logic altogether (and
then from there to remove the rest of the ChooserTargetService
support in ChooserActivity).

There are a couple concerns we should consider in review:

 1. I don't know why the sendShareShortcutInfoList()
    helper had been implemented to send RESULT_COMPLETED
    only if it notifies at least one SHARE_TARGET_RESULT
    event. It seems to me that this is an essential step
    to gate the progress of our async flow, but (on a new
    phone with no apps installed as share targets) I
    ended up never seeing the COMPLETED event at all.
    With the change from this CL, I see the COMPLETED event
    exactly when I would expect -- but I could easily be
    missing something about the original intention of
    this code. (However I will note that there was no
    logic to retry the request if resultMessageSent is
    false, so it *seems* like we're just left hanging
    in this case?)

 2. In practice, this change allows the flow to complete
    immediately once the Direct Share targets are received,
    since we'll never have any service connections to
    wait for. That's great -- it means we can get to the
    completeServiceTargetLoading() event that signals the
    end of our flow, effectively one full second earlier
    (confirmed in informal testing). However, as currently
    written, it's actually possible that we'll signal
    completeServiceTargetLoading() more than once;
    ChooserHandler's maybeStopServiceRequestTimer() method
    is poorly-named and doesn't actually cancel the
    timer, nor otherwise ensure that we haven't already
    completed.

    IMO this should be OK since it's already happening
    without this change (we were already firing twice, for
    the min & max watchdog timer events), and I expect to
    clean it up in my next CL anyways. Just wanted to call
    attention since this will result in one *additional*
    "extra" event until the timer logic is removed.

Test: manual (may need more coverage)

Change-Id: I62c714b235fe5521b1ad01c3556a5a6be1db539c
2021-08-23 17:35:13 +00:00
Dmitri Plotnikov
2f618d1bab Add LongArrayMultiStateCounter
Bug: 197162116
Test: atest FrameworksCoreTests:LongArrayMultiStateCounterTest
Test: atest CorePerfTests:LongArrayMultiStateCounterPerfTest

Change-Id: I3e20aa1a64b6bb89658c57c74487f95681d4f0ff
2021-08-20 18:30:44 -07:00
Dmitri Plotnikov
b4c3af22dd Merge "Check custom component names before aggregating BatteryUsageStats snapshots" 2021-08-17 03:05:04 +00:00
Dmitri Plotnikov
a1ea9ecd56 Check custom component names before aggregating BatteryUsageStats snapshots
If the lists of custom power components do not match, a crash will occur.
Instead of causing a crash, simply skip incompatible snapshots.

Bug: 196040329
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryUsageStatsProviderTest

Change-Id: I87ba605371a5f3119dcff33f6109e94ee46ab57d
2021-08-16 15:05:15 -07:00
Jeff DeCew
6b6610df79 Merge changes I09b3999a,I590be0ba into sc-qpr1-dev am: 10c7e2b811 am: 2de4373e93 am: 7b19b1dd94
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15549414

Change-Id: I0d4fbd00d0403fc6b5c7c81a8fccd9a9d8d330d3
2021-08-16 20:06:42 +00:00
Jeff DeCew
7b19b1dd94 Merge changes I09b3999a,I590be0ba into sc-qpr1-dev am: 10c7e2b811 am: 2de4373e93
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15549414

Change-Id: Iadfda414b3df0bd66e7f505cf8190000bd0b5367
2021-08-16 19:51:56 +00:00
Jeff DeCew
2de4373e93 Merge changes I09b3999a,I590be0ba into sc-qpr1-dev am: 10c7e2b811
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15549414

Change-Id: I09ff92b8debe78859e621fd6ac013d8281959d07
2021-08-16 19:38:06 +00:00
Jeff DeCew
10c7e2b811 Merge changes I09b3999a,I590be0ba into sc-qpr1-dev
* changes:
  Use tertiary accent color for expander with unread count.
  Fix ContrastColorUtil.findContrastColorAgainstDark to return the valid color
2021-08-16 19:21:18 +00:00
Jeff DeCew
1cbc573b93 Add notifications team as OWNERS of notification-related utilities and their tests
Change-Id: I153ab4e182a0843706c25f03c891a92eb48eea9c
2021-08-16 14:56:48 +00:00
Jeff DeCew
4c0e8a62e6 Fix ContrastColorUtil.findContrastColorAgainstDark to return the valid color
Fixes: 196600502
Test: atest ContrastColorUtilTest
Change-Id: I590be0ba30c03e867bf08558483239818b3aff82
2021-08-16 14:14:53 +00:00
Jeff DeCew
d5c2749cac Merge "Collapse the CallStyle buttons to just an icon instead of truncating text." into sc-qpr1-dev am: 44527690ed am: 62a1033f13
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15559241

Change-Id: I014ee9def5489aafc915a5c0be812fafd418827c
2021-08-15 02:12:49 +00:00
Xin Li
773a9dfba7 Merge sc-dev-plus-aosp-without-vendor@7634622
Merged-In: I661f5fb6b1f3f6ce4322fab8fa84a7ab364c65b1
Change-Id: I16482b494ff4821016aabbb646e495d616c630ac
2021-08-14 07:23:27 +00:00
Jeff DeCew
e30260aa9a Merge "Collapse the CallStyle buttons to just an icon instead of truncating text." into sc-qpr1-dev am: 44527690ed
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15559241

Change-Id: Ib93a57b8bd4e2158f2edbd87a552de2db49d8032
2021-08-14 02:17:17 +00:00
Jeff DeCew
62a1033f13 Merge "Collapse the CallStyle buttons to just an icon instead of truncating text." into sc-qpr1-dev am: 44527690ed
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15559241

Change-Id: I9a60203a071be94737e09c9a1d0ffd77fe4323e8
2021-08-14 02:17:12 +00:00
Jeff DeCew
7ce358c005 Collapse the CallStyle buttons to just an icon instead of truncating text.
Fixes: 195019654
Test: post CallStyle notification without custom action; observe text
Test: post CallStyle notification with custom action; observe buttons shrink to icon only.
Test: repeat tests using various font and screen sizes.
Change-Id: Icbd6189a1e03494e481e8672263570ae2657f946
2021-08-13 15:52:48 +00:00
Ayush Sharma
3236d5e5a3 Merge "Remove isSeparateProfileChallengeAllowed API" 2021-08-13 15:49:02 +00:00
Jigar Thakkar
f96f4b9de9 Merge "Notify changes after loading icon in sharesheet" 2021-08-13 12:26:58 +00:00
Jackal Guo
42c12fa3d2 Merge "Remove the usage of PackageParser" 2021-08-13 06:53:18 +00:00
Jigar Thakkar
57882dab5f Notify changes after loading icon in sharesheet
The icon loading inside the sharesheet happens as a separate
async task inside the bindViewHolder. We have seen it taking longer
time in some cases which caused the icon loading to happen after the
bindViewHolder resulting in empty icons being loaded in the
sharesheet for wembley/namaste phone devices. This change introduces a
call to notify observers after the icon loading is done.

Test: Tested on device
Bug: 194886990
Change-Id: Id1752f10ced7877efe5eff90aac6db2bd656f34c
2021-08-12 14:16:21 +00:00
Michael Wright
93b3c57a13 Make PointerLocationView more resilient.
Right now it crashes if we miss an up event since the active pointer
won't get reset. We can't just clear this in onDetachedFromWindow
because of how it gets drawn in system_server, so instead we just check
before using the active pointer.

Bug: 109779280
Test: put settings into split screen, frequently enable / disable
      Pointer Location while tapping in another app window. See that it
      doesn't crash.
Change-Id: If2b1f3157574c962b24115b0ecf0a27feec8e84c
2021-08-12 00:11:28 +00:00
Jackal Guo
1030f5807e Remove the usage of PackageParser
PackageParser.PackageParserException is deparected, and should be
either using the PraseResult or throwing a more generic Exception.
Remove the unused setError method.

Besides, using alternative instead of PackageParser when checking
AndroidTestBaseUpdater.

Bug: 174723245
Test: build
Test: atest PackageBackwardCompatibilityTest
Test: atest AndroidTestRunnerSplitUpdaterTest
Change-Id: I572d167ae3d794ef9f11e7564f09694d0f906f0c
2021-08-11 09:23:31 +08:00
Yohei Yukawa
d55ddf27c6 Ensure View#onInputConnectionClosedInternal() timing
This is a follow up CL to our previous CLs [1][2], which introduced
an @hide callback

  View#onInputConnectionClosedInternal()

to notify View when an is closed.

What this CL aims to do is to fix a potential problem in a code path
that has not been yet used.  Thus there should be, in theory, no
observable app compat impact.

The problem is that

  RemoteInputConnectionImpl#deactivate()

can dispatch

  A: View#onInputConnectionClosedInternal()

before

  B: InputConnection#closeConnection()

is completed when A and B need to be dispatched to two different
threads.  This can, in theory, happen when

  A: View#onInputConnectionClosedInternal()
  C: InputConnection#getHandler()

are both explicitly overridden.  That said, A is still @hide and only
by TextView, which basically does not support InputConnection with a
custom InputConnection#getHandler().

Anyway, with this CL A is guaranteed to happen after B under any
circumstances.

 [1]: Iaafb0a03126c9292c24415f866dbdd72cadfa239
      7b384751ea
 [2]: I9280604e7ec7e8d08c1179e6bbf0068647a41040
      7b384751ea

Bug: 163400105
Test: atest FrameworksCoreTests:ViewInputConnectionTest
Change-Id: I8a0e321ecf6e0b3be4b6ab1a35e6ac7259826c2e
2021-08-05 17:02:02 -07:00
Yohei Yukawa
d1ff9740c1 Lock down RemoteInputConnectionImpl#getInputConnection()
This is a mechanical refactoring CL that locks down

  RemoteInputConnectionImpl#getInputConnection()

as a private method.

This is supposed to be helpful to to avoid future misuse of raw
InputConnection instance outside RemoteInputConnectionImpl.

Note that InputMethodManager#isAcceptingText() remains to have the
same observable behavior in this CL.  The key fact is that the
following two fields are updated in an atomic way.

  * RemoteInputConnectionImpl#mInputConnection
  * RemoteInputConnectionImpl#mFinished

Bug: 192412909
Test: presubmit
Change-Id: Ic5fbc6213ad62df95fc0b7eef18bab1fd9fbdbf1
2021-08-04 11:57:42 -07:00
Yohei Yukawa
b37f32cfec Let IC#reportFullscreenMode() honor IC#getHandler()
This CL fixes a regression that

  InputConnection#reportFullscreenMode()

is always called back on the main thread rather than its associated
thread.  In most of cases those two threads are the same hence there
is no semantic problem, threads are the same, but for some special
cases, e.g. when apps explicitly override

  InputConnection#getHandler(),

our thread affinity contract can be violated.

This regression was accidentally introduced in Android O time frame
while attempting to make the system more robust at Bug 28406127 [1].

Although we have never received any actual issue report from app
developers so far, this is still worth fixing.

 [1]: If23e7c7c265ab3dfb48c2fb6fdb361b17d22c594
      2bc66171cc

Bug: 28406127
Fix: 193588937
Test: atest CtsInputMethodTestCases:InputConnectionHandlerTest
Change-Id: Id3ac21c11d6b062bb66719109376ff642309b8ff
2021-08-04 11:37:16 -07:00
Yohei Yukawa
002ceeec8d Merge "Rename IInputConnectionWrapper to RemoteInputConnectionImpl" 2021-08-04 16:34:25 +00:00
Yohei Yukawa
23463870e9 Merge "Remove inaccurate words "main thread" from IInputConnectionWrapper" 2021-08-04 15:34:44 +00:00
Jeff DeCew
ab188125a5 Merge "Collapse the CallStyle buttons to just an icon instead of truncating text." 2021-08-04 15:19:44 +00:00
Yohei Yukawa
5693db4d66 Rename IInputConnectionWrapper to RemoteInputConnectionImpl
This is a mechanical refactoring CL that renames

  com.android.internal.view.IInputConnectionWrapper

to

  com.android.internal.inputmethod.RemoteInputConnectionImpl

with no observable behavior change.

Bug: 192412909
Test: presubmit
Test: No lint error under core/java/com/android/internal/inputmethod
Change-Id: I171106ad0b46fbb495a6bf08d10f33915c2d29ac
2021-08-03 14:34:36 -07:00
Yohei Yukawa
d6a6037196 Remove inaccurate words "main thread" from IInputConnectionWrapper
This is a clean-up CL for up my CL [1], which introduced

  InputConnection#getHandler()

per request from the Chromium team.

This CL only renames misleading and/or inaccurate code commends and
field names.  There should be no observable behavior change.

Even before my change [1], IInputConnectionWrapper had been
responsible for re-dispatching incoming IPCs onto the "UI thread"
obtained from View#getHandler(), which is not guaranteed to be the
"main thread" in some rare situations.

With my change [1], the target thread is no longer limited to the UI
thread.

This CL removes misleading and confusing "main" terminology from the
variable names and comments for future readers.

 [1]: Id9e579bb3e2966986cdcb1c34bc8cacfeca2e1a9
      612cce92ad

Bug: 26945674
Bug: 192412909
Test: presubmit
Change-Id: Ibb31da4f66e8a6cd35f93c3ca1cc0f871dfb3b73
2021-08-03 14:34:05 -07:00
Nate Myren
e612997b53 Merge "Add attribution info to start callbacks" into sc-dev am: 5d97f29218 am: 9d1a9399b8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15446590

Change-Id: Ib6fedf0b38bd88c3f6cd0aef6efa9529f17aaa44
2021-08-03 20:18:59 +00:00
Nate Myren
aad177261c Merge "Add attribution info to start callbacks" into sc-dev am: 5d97f29218 am: d1a82a7de8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15446590

Change-Id: Ic800a8e11e6d8513629ec8e9b1f64ffef0c85645
2021-08-03 20:18:08 +00:00
Jeff DeCew
4748afe362 Collapse the CallStyle buttons to just an icon instead of truncating text.
Fixes: 195019654
Test: post CallStyle notification without custom action; observe text
Test: post CallStyle notification with custom action; observe buttons shrink to icon only.
Test: repeat tests using various font and screen sizes.
Change-Id: Icbd6189a1e03494e481e8672263570ae2657f946
2021-08-03 20:09:56 +00:00
Nate Myren
7ebbcf1685 Merge "Add attribution info to start callbacks" into sc-dev am: 5d97f29218
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15446590

Change-Id: If5ddeb244befcaea57a3e53f741b94ec5bfd6dd0
2021-08-03 20:06:56 +00:00
Nate Myren
9d1a9399b8 Merge "Add attribution info to start callbacks" into sc-dev am: 5d97f29218
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15446590

Change-Id: I42bdf188ec74c9d3a7179f717a08c7fec7f33833
2021-08-03 20:06:34 +00:00
“Ayush
deb33311db Remove isSeparateProfileChallengeAllowed API
This API is not required by framework anymore.

Bug: 189502721
Test: N/A
Change-Id: Id24d365a0f7bf65af50c147c3655cb5f8c83e1a4
2021-08-03 19:37:23 +00:00