Commit Graph

14728 Commits

Author SHA1 Message Date
Fiona Campbell
af6cd6dc30 Persist screen brightness setting through upgrade
The screen brightness float setting initially did not exist when upgrading the device software. This change ensures the float and int values are synchronised on the system start-up.

Bug: 167651957
Test: manual - set autobrightness off, upgrade from Q to R, and check brightness value in settings.
Change-Id: I2a3b996c8747e3c5f1d181bbdd438c70bf23d08b
(cherry picked from commit 96f43f21b3a3021762c2d213d8958590127cae36)
2020-09-23 13:06:39 +01:00
TreeHugger Robot
34cb1e1519 Merge "Link wm shell command to enable protolog in shell" 2020-09-15 21:28:57 +00:00
Jeff Sharkey
4b5b0174d0 Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347 am: 741c0a78cc am: da7478b570 am: 487d394296
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: Id01f468b43fd5b2aada78608010625b392c1b647
2020-09-15 21:01:48 +00:00
Winson Chung
d2b6017684 Link wm shell command to enable protolog in shell
- Pass through unhandled logging commands to SysUI to simplify
  enabling/disabling logging for the shell.

Bug: 168497382
Test: adb shell wm logging enable-text WM_SHELL_TASK_ORG
Test: adb shell wm logging enable-text WM_DEBUG_RECENTS_ANIMATIONS
Change-Id: I37942eaee82fdcf545212b18375f3d3e2638b8ee
2020-09-15 12:18:50 -07:00
Jeff Sharkey
487d394296 Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347 am: 741c0a78cc am: da7478b570
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: I79488866c538bf9e76d0a6429e30262978f6fdab
2020-09-15 00:13:08 +00:00
Jeff Sharkey
da7478b570 Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347 am: 741c0a78cc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: I9b79dbf3e9983523db11599d8ae289b05aabf80c
2020-09-14 23:42:34 +00:00
Jeff Sharkey
741c0a78cc Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: I7da537200efe31e803234bd1a0236843064186c8
2020-09-14 23:10:42 +00:00
Jeff Sharkey
a8cec413b6 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Test: none
Bug: 168334533
Exempt-From-Owner-Approval: docs updates
Change-Id: I245b8d9cac722da76ea67983738a3cbb9deb68df
2020-09-14 10:00:07 -06:00
Jeff Sharkey
16dd960d6f Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Test: none
Bug: 168334533
Exempt-From-Owner-Approval: docs updates
Change-Id: Id1a0f2a38e41badee3a34bd71af240511f273a7b
2020-09-14 10:00:05 -06:00
Jeff Sharkey
6516a83886 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Test: none
Bug: 168334533
Exempt-From-Owner-Approval: docs updates
Change-Id: Ifce5239991e3b78dd4757712e3b88093ad7161f0
2020-09-14 10:00:02 -06:00
Jeff Sharkey
705f6bec2d Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Test: none
Bug: 168334533
Exempt-From-Owner-Approval: docs updates
Change-Id: I53003332717baf57dc088b2f6b969cdb1863f65e
2020-09-14 09:59:01 -06:00
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
Treehugger Robot
5ca2e8a44e Merge "Quiet excessive logging of missing lambdas during preload" am: 70b20ee0b8 am: 1f2781c323 am: f72a5498af am: d39fbcc29e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1424919

Change-Id: I4716c9349dd5db8cc4cb6d42e3f60e4897d5c88e
2020-09-11 21:46:22 +00:00
Treehugger Robot
d39fbcc29e Merge "Quiet excessive logging of missing lambdas during preload" am: 70b20ee0b8 am: 1f2781c323 am: f72a5498af
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1424919

Change-Id: Icaa3321c187b2c4f64fc7d56d9917fdb5b4e216b
2020-09-11 21:16:58 +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
Treehugger Robot
f72a5498af Merge "Quiet excessive logging of missing lambdas during preload" am: 70b20ee0b8 am: 1f2781c323
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1424919

Change-Id: I8f9b41ca6388fdeeda287e7919ef05e56f9da1a6
2020-09-11 20:39:22 +00:00
Sudheer Shanka
b60c823aab Merge "Include batterystats constants in the service dump." 2020-09-11 20:11:58 +00:00
Chris Wailes
5d29f49b7b 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
Merged-In: I4cd11d626d7e4f365c55f8458aac20cd442638ed
2020-09-11 10:55:02 -07: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
Xin Li
628590d7ec Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I3d92a6de21a938f6b352ec26dc23420c0fe02b27
Change-Id: Ifdb80563ef042738778ebb8a7581a97c4e3d96e2
2020-08-31 21:21:38 -07: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
TreeHugger Robot
c0c156979a Merge "Revoke the uri permission when the file is deleted" into rvc-qpr-dev am: 0827205ffa
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12455088

Change-Id: I4d9259997d3095cafcd3a981ba9d1c1b4dc1daab
2020-08-27 11:13:40 +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
Ivan Chiang
5afa764557 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
Merged-In: I4ffb183630aadb2d87b0965e8cecf88af15f4534
(cherry picked from commit 9efd606f43)
2020-08-26 06:29:00 +00:00