Commit Graph

15129 Commits

Author SHA1 Message Date
Hai Zhang
c25b63c275 Merge "Move or refactor PermissionManagerInternal APIs." 2020-12-06 00:50:22 +00:00
Treehugger Robot
54b570ea4c Merge "Add more logging for wakelock stats inquiries" am: e98c214507 am: 9aafb7ca56 am: 7400c11e9d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1518102

Change-Id: Ic7383de3d521e399b4071ed456d9ae0a137e283f
2020-12-05 22:15:31 +00:00
Hai Zhang
93e38c9566 Move or refactor PermissionManagerInternal APIs.
Make the three backup related methods in PermissionManagerInternal
ready for system API. PermissionManagerInternal is currently used in
framework so it can't be removed without other changes yet. The other
listener methods are only used by PermissionPolicyService and will
become module internal.

Finally turn PermissionManagerInternal and
PermissionManagerServiceInternal into an interface from an abstract
class, and remove redundant modifiers after this.

Also refactors onUserCreated/Removed() to be system API ready.

Bug: 158736025
Test: presubmit
Change-Id: I335a7a37b737f6fa0faf0a2c34634d44199aee97
2020-12-04 23:05:59 -08:00
Treehugger Robot
7400c11e9d Merge "Add more logging for wakelock stats inquiries" am: e98c214507 am: 9aafb7ca56
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1518102

Change-Id: Iccd807a0ef318f8690e1e2418a07b3425435a16b
2020-12-05 02:20:05 +00:00
Zoey Chen
415ec768ba Merge "[Telephony] PhoneStateListener redesign for new event" 2020-12-05 01:28:41 +00:00
Treehugger Robot
9aafb7ca56 Merge "Add more logging for wakelock stats inquiries" am: e98c214507
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1518102

Change-Id: I02a2586654f3ec241491d5471a2c1f94123e5f36
2020-12-05 00:27:26 +00:00
Jeff Sharkey
db4ae71beb Merge changes from topic "nov30"
* changes:
  Hand-migration to TypedXml interface.
  Mechanically apply TypedXml refaster template.
  Mechanical refactoring to new typed XML classes.
  Additional hand-migration to TypedXml interface.
  "Resolve" both human-readable and binary XML.
2020-12-04 21:32:44 +00:00
Michael Sun
757b01b94b Add more logging for wakelock stats inquiries
Add additional logging after receiving wakelock statistics from
SystemSuspend via AIDL.

Test: atest FrameworksCoreTests:KernelWakelockReaderTest
Test: manually verified new log presented
Bug: 173539101
Change-Id: Ia64ca7edaa4c7925348e1c31d5681943cfbe4f33
2020-12-04 20:25:28 +00:00
Ming-Shin Lu
4ba8484ffb Revert "Revert "Let IME#onFinishInput called without dup onStart..."
Revert^2 "Verify lifecycle test when screen on/off"

c2769e41ea17d7f0d261396d28ddde3563422701

Reason: Fix forward Bug 174512702 and Bug 174445559
        with CL[1].

CL[1]: Icf1504d40b25fc5f53eae65d4bab48a3070db1d6

Change-Id: Id4e71a822bfde5fe6a263bbe094c0d238017efe1
2020-12-04 11:40:20 +08:00
Jeff DeCew
13fa153e25 Merge "Revert "Let IME#onFinishInput called without dup onStartInput wh..."" 2020-12-04 01:02:15 +00:00
Dmitri Plotnikov
75affe2132 Merge "Introduce BatteryUsageStats API" 2020-12-04 00:00:46 +00:00
Jeff DeCew
3d62f739a8 Revert "Let IME#onFinishInput called without dup onStartInput wh..."
Revert "Verify lifecycle test when screen on/off"

Revert submission 12716106-ims_screenstate_lifecycle

Reason for revert: b/174512702
Reverted Changes:
Iba0332ed3:Verify lifecycle test when screen on/off
I8a657e75e:Let IME#onFinishInput called without dup onStartIn...

Change-Id: I16f4a34360a2f64b69978724648a9be741f140b5
2020-12-03 19:13:34 +00:00
Dmitri Plotnikov
bfe822007b Introduce BatteryUsageStats API
Bug: 158137862
Test: Start Settings app, navigate to Apps, pick an app, navigate to Battery

Change-Id: I8da8cc9501e01282b855f1bee6032911d91aaf77
2020-12-03 10:42:41 -08:00
Zoey Chen
6ec5712446 [Telephony] PhoneStateListener redesign for new event
1. Add int EVENT_* and expose these as @SystemApi
 2. Add listener interface
 3. Deprecated LISTEN_*
 4. un/registerPhoneStateListener
 5. get event from event listener
 6. Add event to list

Test: manual and
atest TelephonyManagerTest#testRegisterPhoneStateListener
atest TelephonyManagerPermissionTest
atest CtsTelephonyTestCases:PhoneStateListenerTest
atest TelephonyRegistryManagerTest
atest CtsTelecomTestCases:android.telecom.cts.IncomingCallTest
atest CtsTelecomTestCases:android.telecom.cts.OutgoingCallTest

Bug: 167684594
Change-Id: Id89a541745fb8700e1ebd2cc162ee55cd1055661
2020-12-03 17:46:22 +08:00
Jackal Guo
ccfa9a6682 Merge "Reduce package parsing times" 2020-12-03 05:57:53 +00:00
TreeHugger Robot
29bca68828 Merge "Move activity client operations to a separate interface" 2020-12-03 02:25:01 +00:00
Alison Cichowlas
d73da5485f Merge "Fix wrong target launches in Chooser." 2020-12-03 00:30:46 +00:00
Jeff Sharkey
a2c132d9c6 Hand-migration to TypedXml interface.
Previous changes have applied mechanical refactorings, but this change
hand-migrates the remaining logic which was too complex to identify.

This change should have no behavior change; famous last words.

Bug: 171832118
Test: manual
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: I85cd830eb6bfde18fca6e73ee7adfdc385a890de
2020-12-02 13:55:35 -07:00
Alison Cichowlas
6f015708fb Fix wrong target launches in Chooser.
The service target row was sometimes overfull - with more targets in
the list than were displayed - when we used each row's offset
to calculate which target was selected to launch.
This fix makes sure we are not overfilling.

Test: ChooserActivityTest & manual repro -- use targets from
alphabetical section, make sure you have at least one old-API target
available
Fixes: 170518649, 165944833

Change-Id: I8a554197c01f4eadbeac43742984e4c86ca49601
2020-12-02 15:20:17 -05:00
TreeHugger Robot
0612ad7955 Merge "Add InputConnection app and service dump" 2020-12-02 17:30:06 +00:00
Riddle Hsu
6d0979e211 Move activity client operations to a separate interface
This CL focuses on the methods used by Activity and ActivityThread.

Also remove getUriPermissionOwnerForActivity, notifyActivityDrawn
notifyLaunchTaskBehindComplete notifyEnterAnimationComplete
because they are only used between ATMS and WMS.

Bug: 174041144
Bug: 174040691
Test: CtsWindowManagerDeviceTestCases

Change-Id: I5a30ec30cf6acd9ae4c908e524141fd17a4e54ff
2020-12-02 23:14:09 +08:00
Ioana Stefan
0653b692d1 Add InputConnection app and service dump
This change dumps information through IME tracing for the getter methods
exposed by the InputConnection interface. The dump is done through the
ImeTracing interface and is triggered by events in the wrapper classes
used to handle InputConnection implementations corresponding to:
 - different apps
 - InputMethodService
The new data is available under inputConnectionCall in the clients
output proto.

Bug: 154348613
Test: flash a device
      start IME tracing by calling "adb shell ime tracing start"
      end IME tracing by calling "adb shell ime tracing stop"
      pull generated trace files and visualize in Winscope
      or start tracing directly through ADB Connect and visualize traces
Change-Id: Iabd6af1b858803030848a0ef5e7dd9ecfc562716
2020-12-02 14:08:04 +00:00
Xin Li
d31ee38811 Merge rvc-qpr-dev-plus-aosp-without-vendor@6881855
Bug: 172690556
Merged-In: I78222391b83a4add8e964340ec08bb8a1306e1c6
Change-Id: I28bbf40820674675ccf765c912aa8140d3f74ab2
2020-12-02 00:38:58 -08:00
Lucas Dupin
7b8636fdb0 1/N The road to Material NEXT (bouncer and shade)
Styling bouncer and shade so they have solid backgrounds and read colors
from themes instead of named resources.

Scrim now fetches colorBackgroundFloating, and views get their background
from colorBackground.
Switching from light to dark theme will make bouncer colors update without
re-inflating any views.

Bug: 173561906
Bug: 173561901
Test: atest ScrimControllerTest
Test: atest KeyguardSecurityContainerControllerTest
Test: manual, switching to dark theme annd showing notif guts
Change-Id: I372e8b688d7bbddd698381accd074b7655788cd0
2020-12-01 14:23:16 -08:00
TreeHugger Robot
af3e372ca6 Merge "Fix handling of null "standalone" value." 2020-12-01 21:00:44 +00:00
Jeff Sharkey
956f2ac9ac Fix handling of null "standalone" value.
As part of transitioning the OS towards FastXmlSerializer, we found
at least one example of a caller who is omitting a "standalone" value
by passing null.  Handle this by mirroring the behavior of the
upstream KXmlSerializer and omitting the attribute entirely when
the value is undefined.

Bug: 174561276
Test: manual
Change-Id: I868aceaed8e3dd1575947a56b28f8fff8759c0ae
2020-12-01 11:53:59 -07:00
Wilson Wu
b325530f65 Merge "Make IInputMethodManager to oneway (3/N)" 2020-12-01 10:39:18 +00:00
Eran Messeri
6aa9b789e4 Merge "DPMS: Enforce password complexity in lockscreen setting" 2020-12-01 09:53:08 +00:00
Wilson Wu
b9590fa1e1 Make IInputMethodManager to oneway (3/N)
-. Create InputBindResult result callback and apply it
   to startInputOrWindowGainedFocus().
-. Create a callback utility class.

Bug: 163453493
Test: Manual test with keyboard
Test: atest CtsInputMethodTestCases
Change-Id: If4b40244a2e0e3b11c38c1da9340ba8e5166ad64
2020-12-01 14:58:00 +08:00
Wilson Wu
21701d24c7 Merge "Prevent ANR when app is terminated abruptly" 2020-12-01 06:11:01 +00:00
Jeff Sharkey
8f43151721 Mechanically apply TypedXml refaster template.
This is a purely mechanical CL that applies the output of the
recently added refaster templates to help guide towards more
efficient TypedXml methods.  There is no behavior change.

Bug: 171832118
Test: manual
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: Ic95dd3de77c60482ad36b31706e6b701929f40b3
2020-11-30 20:45:40 -07:00
Jeff Sharkey
236c03b5c3 Mechanical refactoring to new typed XML classes.
Related changes are introducing new TypedXmlSerializer and
TypedXmlPullParser interfaces which offer efficient access to
primitive attributes.

Bug: 171832118
Test: manual
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: Ibd93f353ff3cb1f0b7073ebbeae17fe5194b046b
2020-11-30 20:45:25 -07:00
Jeff Sharkey
1f5d9af0cd Additional hand-migration to TypedXml interface.
Previous changes have applied mechanical refactorings, but this change
hand-migrates the remaining logic which was too complex to identify.

This change should have no behavior change; famous last words.

Bug: 171832118
Test: manual
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: If2d4b1a354481a83edb4bbcfa22f690b7f5e97c3
2020-11-30 20:45:25 -07:00
Jeff Sharkey
42bd76058f "Resolve" both human-readable and binary XML.
Recent refactorings have pivoted many XML users across the system
to call resolveSerializer() and resolvePullParser(), which gives us
an easy path to pivot between human-readable XML and our binary XML
wire format.

This change introduces a feature flag (still disabled by default)
for emitting binary XML by default when serializing.  It also adds
logic to automatically select the relevant parser by sniffing the
magic file header.

This is the key to our upgrade strategy: we'll gladly parse
human-readable XML from old devices, or binary XML from new devices.

Bug: 171832118
Test: atest FrameworksCoreTests:android.util.XmlTest
Test: atest FrameworksCoreTests:android.util.BinaryXmlTest
Change-Id: I14fdab9a6667819db38116a8ce126f5f2a5a04df
2020-11-30 20:45:25 -07:00
Eran Messeri
9afde363cc DPMS: Enforce password complexity in lockscreen setting
Enforce a lock screen that adheres with the required complexity set by
the admin.

To do this, provide a method to let the Settings code query the
DevicePolicyManager for the effective password complexities that applies
to a user.

Bug: 165573442
Test: Manually, set complexity using TestDPC.
Test: m RunSettingsRoboTests
Change-Id: Ia03aebb725cacc7104d7fd765ae6ab53456e33e0
2020-11-30 22:28:06 +00:00
Alec Mouri
d90d2cad62 Merge "Temporarily additional stats into battery dumpsys" 2020-11-30 21:49:11 +00:00
TreeHugger Robot
a2be7ce315 Merge "AnimatedImageDrawable in MessageStyle+ConversationStyle" 2020-11-30 19:43:40 +00:00
Ioana Stefan
c9393ea0ad Merge changes I6718aa31,I4dc6147f
* changes:
  Add InputConnection app side tracing
  Add InputConnection debug information
2020-11-30 11:33:14 +00:00
Jackal Guo
f2404ee37b Reduce package parsing times
After committing the install session, a single APK would be parsed
several times even if this APK doesn't change. We should store the
parsed result, and then reuse it to save unnecessary parsing calls
during the installation.

Bug: 138292426
Test: atest PackageManagerTest
Test: atest PackageManagerTests
Test: atest PackageManagerServiceTest
Test: atest PackageManagerShellCommandTest
Test: atest PackageParserTest
Test: manually both staged and non-staged install APK from adb
Test: manually install APK from Play Store and Android Studio
Change-Id: Ie786d964ac96536015e83e36865505a1f34e3cbf
2020-11-30 18:16:12 +08:00
Wilson Wu
02c934b09b Prevent ANR when app is terminated abruptly
When app is forced stop, the removeImeSurface flow
from DisplayImeController will be dropped in IMMS
and IMS because some fields (IMMS#mShowRequested,
IMS#mShowInputRequested..etc) still remain previous
state. The launcher cannot receive keyevent at that
time since IME surface remain and cause ANR.

Calling hideCurrentInputLocked() to hide the IME
surface when a IME client is removed.

Bug: 167780081
Test: atest CtsInputMethodTestCases
Test: Verify with issue reproduce steps:
      1) Add another language to the keyboard
      2) Open chrome and tap the EditText to show keyboard
      3) Tap to show language swiching dialog
      4) adb shell am force-stop com.android.chrome
      5) adb shell input keyevent 8
      6) Verify there is no ANR happen
Change-Id: Ifb91111f7136952462678ff6d0a5e917abb5005e
2020-11-30 17:12:05 +08:00
Ioana Stefan
bbdec456e2 Add InputConnection app side tracing
This change adds tracing for the methods exposed by the InputConnection
interface. The tracing is added to the wrapper class used to handle
InputConnection implementations created by different apps.

Bug: 154348613
Test: flash a device
      record a trace with Perfetto at https://ui.perfetto.dev/#!/record
      visualize traces and duration of tracing tags
Change-Id: I6718aa3183c95fc6802d93137e22d21b71869cfc
2020-11-27 17:44:10 +00:00
Ioana Stefan
c47b324d39 Add InputConnection debug information
Add InputConnection information to IME tracing. This change adds
only information about the text associated with an
EditableInputConnection instance: editable text, selected text, text
before and after the cursor (for a preset length) and cursor caps mode.

Test: flash a device
      start IME tracing with `adb shell ime tracing start`
      stop IME tracing with `adb shell ime tracing stop`
      visualise the traces in Winscope and see the inputConnection information
Change-Id: I4dc6147fb7baa2cea413d2c44226e8c84c056c37
2020-11-27 15:20:58 +00:00
TreeHugger Robot
bf598cdfbc Merge "SharedLibraryInfo.isNative() returns true for native libs" 2020-11-26 23:14:13 +00:00
Ioana Stefan
eb778956a4 Merge "Expose public interface to starting and stopping IME tracing" 2020-11-26 14:32:26 +00:00
Treehugger Robot
eeef7c8271 Merge "Make ChangeReporter.{Status,Source} proper enums" am: a421f8ff53 am: cdd4f0bdaf am: 4d61ec6e60
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1511333

Change-Id: Ib1c2122bb8fdc876529faf37954e1745b5e73805
2020-11-26 14:16:16 +00:00
Treehugger Robot
4d61ec6e60 Merge "Make ChangeReporter.{Status,Source} proper enums" am: a421f8ff53 am: cdd4f0bdaf
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1511333

Change-Id: Ie7b5bd929dba5bdaee67e5381bcac7099c1e0596
2020-11-26 14:11:15 +00:00
Treehugger Robot
a421f8ff53 Merge "Make ChangeReporter.{Status,Source} proper enums" 2020-11-26 13:37:45 +00:00
TreeHugger Robot
d329889eea Merge "Let IME#onFinishInput called without dup onStartInput when screen-off" 2020-11-26 11:25:22 +00:00
Treehugger Robot
b84b78893b Merge "Clarify why it's safe to add java.library.path to the classloader namespace." am: 27310f0340 am: bca09c81a3 am: e14a8ca797
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1507503

Change-Id: I39afd342c20288f3776da08584c5d2fa73c4f220
2020-11-26 03:32:49 +00:00
Treehugger Robot
e14a8ca797 Merge "Clarify why it's safe to add java.library.path to the classloader namespace." am: 27310f0340 am: bca09c81a3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1507503

Change-Id: Ia31368bc67bfde85e6845ed8832966363fdc7ac0
2020-11-26 03:10:33 +00:00