Commit Graph

14707 Commits

Author SHA1 Message Date
Alex Johnston
0a378db111 Merge "Replace can managed scope enforce methods" 2020-09-13 18:47:46 +00:00
TreeHugger Robot
8d3243db15 Merge "Add stash support for PIP." 2020-09-12 01:15:12 +00:00
Ben Lin
104b2de2a5 Add stash support for PIP.
Bug: 165793553
Test: adb shell cmd device_config put systemui pip_stashing true
Test: Drag PIP Window to outside of display and see it stashed
Change-Id: I59e5475162cd3353e2bcbdf38bd5c5a22561a578
2020-09-11 13:50:12 -07:00
Sudheer Shanka
b60c823aab Merge "Include batterystats constants in the service dump." 2020-09-11 20:11:58 +00:00
Alex Johnston
6834e11d92 Replace can managed scope enforce methods
Removed DPMS methods
* enforceCanManageScope
* enforceCanManageScopeOrCheckPermission
* ensureAllUsersAffiliated

Updated DPMS methods
* installKeyPair
* removeKeyPair
* setKeyGrantForApp
* generateKeyPair
* setKeyPairCertificate
* setKeepUninstalledPackages
* getKeepUninstalledPackages
* setApplicationRestrictions
* isNetworkLoggingEnabled
* getApplicationRestrictions
* setPackagesSuspended
* isPackageSuspended
* setApplicationHidden
* isApplicationHidden
* enableSystemApp
* enableSystemAppWithIntent
* installExistingPackage
* setNetworkLoggingEnabled
* retrieveNetworkLogs
* setUninstallBlocked
* setPermissionPolicy
* setPermissionGrantState
* getPermissionGrantState
* requestBugreport
* retrievePreRebootSecurityLogs
* retrieveSecurityLogs

Bug: 163732959
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
      atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testDelegatedCertInstaller
      atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testDelegatedCertInstallerDirectly
      atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testDelegationCertSelection
      atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testDelegation
      atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testApplicationRestrictionIsRestricted
      atest com.android.cts.devicepolicy.MixedProfileOwnerTest#testDelegatedCertInstaller
      atest com.android.cts.devicepolicy.MixedProfileOwnerTest#testDelegatedCertInstallerDirectly
      atest com.android.cts.devicepolicy.MixedProfileOwnerTest#testDelegationCertSelection
      atest com.android.cts.devicepolicy.MixedProfileOwnerTest#testDelegation
      atest com.android.cts.devicepolicy.MixedProfileOwnerTest#testApplicationRestrictionIsRestricted

Change-Id: Ifa0372021148d779d7b73034c3b51c9c903a4464
2020-09-11 14:28:49 +01:00
Sudheer Shanka
48e50a835d Include batterystats constants in the service dump.
Bug: 168268504
Test: manual
Change-Id: Ib5eb3d968c84146e45490e610508fa3b671fe23d
2020-09-10 19:58:55 -07:00
TreeHugger Robot
95425202db Merge "Quiet excessive logging of missing lambdas during preload" 2020-09-10 20:34:31 +00:00
Marcin Oczeretko
a1a00b9fa8 Log FrameTracker aggregated frame stats as trace counters
Bug: 162927074
Test: manual - collected perfetto trace and verified the counters are
available

Change-Id: If742a487aba1493828653b2a8bb8109ae92deacf
2020-09-10 13:41:16 +01:00
TreeHugger Robot
fe4f84bbe0 Merge "Remove Session#getDisplayFrame" 2020-09-10 05:29:20 +00:00
TreeHugger Robot
ce48d61c99 Merge "Fix up PackageSetting pkg and path documentation" 2020-09-10 01:37:52 +00:00
Jing Ji
b133074462 Merge "Untangle BatteryStats lock" 2020-09-10 00:18:36 +00:00
Winson
b92073c580 Fix up PackageSetting pkg and path documentation
Renames baseCodePath -> baseApkPath and codePath -> path to better
reflect their actual meanings. Their respective JavaDoc has also been
consolidated and updated.

Also explains why the pkg field can be null, as this has been the cause
of a significant number of bugs. Also hides it behind a getter to
preempt any mutation issues. Doesn't refactor existing usages. This can
be done inline with other changes that touch that code.

Bug: 164218844
Bug: 164488334

Test: atest com.android.server.pm

Change-Id: Ia254e7cebb0ab86165e5ec42e8f8bfcf8673884b
2020-09-09 16:19:44 -07:00
Riddle Hsu
ccaeffc03f Remove Session#getDisplayFrame
The frame won't be changed if there is no IWindow#resized or
IWindowSession#relayout. So it can be retrieved from these methods
directly instead of another binder transaction.

And because some parameters are usually used together for layout,
the parameters are consolidated into a new ClientWindowFrames.
That reduces changing the interface in the future if the frame
related information needs to be changed.

Also refine the resize handling in ViewRootImpl to make it easier
to read.

There should be no behavior change by this modification.

Bug: 161781274
Test: WmTests, DialogFrameTests

Change-Id: I9f711ad2023442046fa8582944320b98e7c4ecfa
2020-09-10 00:26:11 +08:00
Ben Lin
7c10e48b42 Implement pinch to resize.
Bug: 166478885
Test: adb shell cmd device_config put systemui pip_pinch_resize true
Change-Id: Ide6fecd7a26c040b533fb49d399744c5617bfc93
2020-09-08 17:53:42 -07:00
Andrii Kulian
e2bd80228d Don't default to 1.33 min aspect ratio for pre-Q apps
1.33 minAspectRatio requirement for legacy apps was removed from CDD.

Bug: 165945457
Test: Verify resolved minAspectRatio on pre-Q apps
Change-Id: Ib9e14c2986dd27f900bd8a5fc4d500da3381e73d
2020-09-04 16:01:54 -07:00
Tiger Huang
7053288de1 Merge "Make FLAG_LAYOUT_NO_LIMITS compatible" 2020-09-03 07:14:31 +00:00
Zoey Chen
0707378f06 Merge "[5G] Implement Physical Channel Listener" 2020-09-03 02:47:06 +00:00
Chris Wailes
a39a1cead7 Quiet excessive logging of missing lambdas during preload
This patch will change the logging behavior in the Zygote such that
lambdas from the preload list that aren't found during Zygote
initialization will be counted and a summary provided at the end rather
than logging them each individually.  These missing lambdas will only be
logged for userdebug builds.

Test: Compared logs before and after
Bug: 163602260
Change-Id: I4cd11d626d7e4f365c55f8458aac20cd442638ed
2020-09-02 17:47:57 -07:00
Darryl Johnson
148a9925fc Merge "Prevent DecorContext from creating DisplayContext for default display." 2020-09-02 17:39:34 +00:00
Zoey Chen
bcdb260b5f [5G] Implement Physical Channel Listener
To support the new listen event, use long instead of int for the new one then creat bitmask for old events.

Bug: 162300897
Test: manual - 5g testing

Change-Id: I002cb3579eb920ffc0b0a8dbf59e8d1153222411
2020-09-02 14:43:41 +08:00
Darryl L Johnson
eb039cc64e Prevent DecorContext from creating DisplayContext for default display.
The previous implementation of createDisplayContext() was essentially a
noop within ResourcesManager when the default display was passed. However,
the current implementation always overrides the configuration with the provided
display's metrics so when a DecorContext with the default display is
created a new ResourcesImpl object is also created due to the difference in
configuration. This CL changes the DecorContext logic to match the
previous implemenation where the configuration is only overriden for a
non-default display thus only creating a new ResourcesImpl object for
non-default displays.

Bug: 166174272
Test: atest google/perf/app-startup/benchmark-app-hermetic/cold-dropcache-test -v
Test: atest com.android.internal.policy.DecorContextTest

Change-Id: I05920c4f7987ffcaec8b197e8636606c04b418d4
2020-09-01 14:54:46 -07:00
Marcin Oczeretko
d68c208ed7 Merge "Log measurements from LatencyTracker to statsd" 2020-09-01 13:08:47 +00:00
Marcin Oczeretko
d4430329bc Report per-interaction frame statistics to statsd
Also reorganized the FrameTrackerTest a bit

Bug: 162927074
Test: manual - statsd_testdrive to verify statsd logging + run
FrameTrackerTest

Change-Id: Iec1fcafcd6c8373ebdeebbbd829eb94967c2bfb8
2020-08-28 16:08:36 +01:00
TreeHugger Robot
1e19bfb919 Merge "Introducing an interface to store alarms" 2020-08-28 02:33:49 +00:00
Suprabh Shukla
323fccc622 Introducing an interface to store alarms
The alarms inside alarm manager service are stored in a variety of
different lists, the main one being an array list of Batch objects. Over
time due to various policy changes, it has caused a lot of coupling
between the service's business logic and the management of these data
structures.

This change introduces an interface to store alarms (a.k.a. AlarmStore)
and attempts to create a well defined boundary across which the service
interacts with this data structure. The interface presently supports
the following operations:
- add: to add an alarm.
- remove: to remove any alarms described by a predicate.
- removePendingAlarms: to remove any alarms that are due at a given
time.
- getNextDeliveryTime: the next upcoming alarm's delivery time.
- getNextWakeupDeliveryTime: the next upcoming wakeup alarm's delivery
time.
- recalculateAlarmDeliveries: to adjust the alarm deliveries in a way
described by the caller.
All the times are interpreted in the elapsed timebase.

The details of how the alarms are stored and managed, such as their
relative ordering and the complexity of each of the supported operations
is left to the implementations to decide. The expectation is that
this will make it easier to change and optimize these aspects of the
data structure in the future, while also making it simpler to make
changes to the service side policies.

Apart from the above, some formatting was corrected, obsolete or dead
code was removed and a bug where we were missing a rebatch was fixed.

Test: atest FrameworksMockingServicesTests:com.android.server.alarm
atest CtsAlarmManagerTestCases

Bug: 161497385
Change-Id: I8ac475d6c6a827500bf93be982cd40897f6743ae
2020-08-27 17:41:19 -07:00
TreeHugger Robot
ef8ce9db9d Merge "Infrastructure of Always-on tracing" 2020-08-27 19:02:03 +00:00
Marcin Oczeretko
a6bf4dd0d5 Log measurements from LatencyTracker to statsd
Only on userdebug and eng builds for now.

Bug: 131859447
Test: manual - flashed the phone and verified the atoms with statsd_testdrive
Change-Id: I1a97dfe4ad062740f7c30558930de455cac07d9c
2020-08-27 19:14:38 +01:00
Ahan Wu
ba492039e1 Infrastructure of Always-on tracing
The aot infrastructure for instrumenting CUJs.
The usage is like below:
AlwaysOnTraceManager.init(view /* one in the view tree */);
AlwaysOnTraceManager.begin();
...
AlwaysOnTraceManager.end();

Bug: 158756171
Bug: 163514962
Bug: 162483077
Test: Manually
Test: atest FrameworksCoreTests
Change-Id: I570a760d4f3b71e86f19172d8f595e558369ff65
2020-08-28 00:10:42 +08:00
Mark Renouf
d6bcd0e1c8 Merge "Fix area rendered by ScrollCaptureViewSupport" 2020-08-27 14:52:26 +00:00
Jing Ji
32cf9dc836 Untangle BatteryStats lock
Make the BatteryStatsService's APIs asynced

Bug: 165378777
Bug: 157089413
Test: atest FrameworksCoreTests:BatteryStatsTests
Test: atest CtsIncidentHostTestCases
Test: atest BatteryStatsDumpsysTest
Test: atest CtsTelephonyTestCases:BatteryStatsManagerTest

Change-Id: Ief9d5a2dd8967814d4b66e9c3bd270778249c70b
2020-08-26 18:18:45 -07:00
Mark Renouf
af948d55d7 Fix area rendered by ScrollCaptureViewSupport
When rendering the requested image, the updated scrollDelta was not
being accounted for, resulting in rendering the wrong vertical
position. This would happen if the view scrolled as a result of the
request.

Also adds a call invalidate() on the target view after scrolling to
ensure that DisplayLists are correctly rebuilt when rendered here
since there is no synchronization with the render thread.

Test: atest ScrollViewCaptureHelperTest
Change-Id: I1e6aec8dd4352b4ae610657537581689a04b725b
2020-08-26 15:37:07 -04:00
Tiger Huang
e5a898a916 Make FLAG_LAYOUT_NO_LIMITS compatible
The content of a window with FLAG_LAYOUT_NO_LIMITS can extend into
system bar areas before android R, but not in R, which is not
compatible.

Fix: 166391803
Test: atest ImeInsetsSourceConsumerTest InsetsControllerTest
      InsetsStateTest
Change-Id: I2470a4eeb9f0f291321e21d42bc6e9c52e7a8e9d
2020-08-26 22:36:51 +08:00
TreeHugger Robot
c4d592c6a2 Merge "Revoke the uri permission when the file is deleted" 2020-08-26 01:06:18 +00:00
TreeHugger Robot
23b1690987 Merge "Add some protologs for window organizers & shell" 2020-08-25 22:00:02 +00:00
Miranda Kephart
6266f7979e Merge "Add a flag to change the screenshot keychord delay" 2020-08-25 18:19:49 +00:00
Winson Chung
b754f5281b Add some protologs for window organizers & shell
- Refactor out base protolog impl so that shell can have it's own
  implementation which takes a different viewer config (from the resources
  directly instead of a separate file in /system/etc)
- Setup the protolog transform for shell classes
- Add some basic protologs for displayarea/task organizer controller
  & shell task org (for now only text logging)

Bug: 161980327
Test: adb shell wm logging enable-text WM_DEBUG_WINDOW_ORGANIZER
Test: adb shell dumpsys activity service SystemUIService WMShell enable-text-logging WM_SHELL_TASK_ORG
Test: atest ProtoLogImplTest \
            ProtoLogViewerConfigReaderTest \
            WmTests:ProtoLogIntegrationTest \
            LogDataTypeTest \
            protologtool-tests
Change-Id: I4c3fd6aaea04987c26ac56e9baf9fc8ab75a3f34
Signed-off-by: Winson Chung <winsonc@google.com>
2020-08-25 10:07:55 -07:00
Ivan Chiang
9efd606f43 Revoke the uri permission when the file is deleted
When the file is deleted, renamed or moved, revoke all uri
permissions with the file

Bug: 157474195
Test: manual test with DocumentsUI
Test: atest DocumentsTest#testAfterMoveDocumentInStorage_revokeUriPermission
Change-Id: I4ffb183630aadb2d87b0965e8cecf88af15f4534
2020-08-25 14:49:44 +08:00
Diego Vela
08aaab16dd Merge "Convert logs to use protologs." 2020-08-24 21:50:49 +00:00
TreeHugger Robot
5f358680cf Merge "Handle NPE in LocalImageResolver to avoid crashing systemui" into rvc-qpr-dev am: 6bf25fdfc4 am: 8517455df4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12421224

Change-Id: I42f1a691785b5476e3f8957440c80656e8c54e8a
2020-08-24 04:05:56 +00:00
TreeHugger Robot
8517455df4 Merge "Handle NPE in LocalImageResolver to avoid crashing systemui" into rvc-qpr-dev am: 6bf25fdfc4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12421224

Change-Id: Ia1613a1a7e5524112b8221fbc608270d4dd87664
2020-08-24 03:55:46 +00:00
Robin Lee
dfd866daf7 Allow devices without SECURE_LOCK to *clear* PINs
Otherwise upgrade devices get stuck and can't possibly recover.

Bug: 165634310
Change-Id: Iff3115ae734cdfdba09939915f00c1ce02fe6272
2020-08-21 20:59:35 +00:00
Diego Vela
f58acf9e39 Convert logs to use protologs.
Migrate add remove debug log from debug config to protolog.
Migrate configuration debug log from debug config to protolog.
Update protolog file

Bug: 153162675
Test: manual
Change-Id: Ie97f77ce3fe165a9be2ff970da7e777962b0db31
2020-08-21 18:51:32 +00:00
Miranda Kephart
6e44e9d5b4 Add a flag to change the screenshot keychord delay
Allows overriding the configured keychord delay (the time it takes,
after both the power button and volume down have been pressed, for
a screenshot to be registered/taken). If not set, reads from the
config file (as before). Can be updated with

adb shell device_config put systemui screenshot_keychord_delay <n>

where <n> is the desired timeout, in ms.

Bug: 165267251
Test: manual -- tried setting multiple values, ensured that deleting
the override reverts to the configured value

Change-Id: I2f86abe0332f8072ab4f53baa55f1999aed3865a
2020-08-21 12:25:12 -04:00
Ahan Wu
1a1c93f964 Handle NPE in LocalImageResolver to avoid crashing systemui
ContentResolver#openInputStream may return null, and may lead to
systemui keeps crashing, handle null to avoid this case.

Bug: 163412636
Test: manually
Change-Id: Ie149b75d4445b37afac82c8351a32cb17442936d
2020-08-21 14:18:08 +08:00
Hall Liu
99f3dc8aee Merge "Expose onEmergencyNumberListChanged, semantics change" 2020-08-20 19:29:58 +00:00
Sudheer Shanka
16749d5430 Merge "Add BstatsCpuTimesValidationTest to TEST_MAPPING." 2020-08-20 18:32:00 +00:00
Kevin Chyn
106cfaacad Merge "Return handle to gatekeeper password instead of actual password" 2020-08-19 22:33:02 +00:00
Hall Liu
cebecc648b Expose onEmergencyNumberListChanged, semantics change
Expose the onEmergencyNumberListChanged method, which seems to have been
left hidden inadvertently when introduced.

Add a new version of onOutgoingEmergencyCall that supplies a
subscription ID and deprecate the old one. Along with this, send
emergency call events from any subscription to all listeners regardless
of which subscription the listener specified.

Test: atest CtsTelecomTestCases:OutgoingCallTest
Bug: 162647577
bug: 165660452
Change-Id: Ia0e10bfb3376ff82d03a6dbc4bf71c22b0ace366
2020-08-19 14:43:26 -07:00
Eran Messeri
346cee22ff Merge "DPMS refactoring: Get Profile / Device owner" 2020-08-19 10:01:11 +00:00
Vishnu Nair
5084fa3e83 Merge "Enable compositor shadows" 2020-08-18 23:50:19 +00:00