Commit Graph

16538 Commits

Author SHA1 Message Date
Nate Myren
06d07d54db Add attribution info to start callbacks
Add attribution flags and chain IDs to start callbacks, and have the
PermissionUsageHelper listen for starts. This ensures that, if another
start happens while an op is already running, and has chain information,
then this chain information will be recorded.

Test: manual
Bug: 194198234
Change-Id: I0ab1aa0969b70e18001f4a814ea5689f9329a019
2021-08-03 08:25:31 -07:00
Li Li
ef12967b75 Merge "Freezer: fix exception when parsing /proc/locks" into sc-dev 2021-07-30 16:35:16 +00:00
Li Li
bbe06e7b59 Freezer: fix exception when parsing /proc/locks
The original code is based on /proc/locks manpage. Unfortunately, that
manpage is never correctly updated to include the new field for blocked
locks. The new code detects the extra field. As StringTokenizer is too
heavy, ProcFileReader is used for better performance.

Bug: 194756340
Test: FrameworksUtilTests com.android.internal.util.ProcFileReaderTest
Test: FrameworksCoreTests com.android.internal.os.ProcLocksReaderTest
Test: No /proc/locks parsing exception with blocked locks
Change-Id: I4c9763f9d3091f7d84d2e4b672d7e5cb78b33f59
2021-07-29 09:18:53 -07:00
Daniel Solomon
d5e1458566 Merge "Revert "SCREEN_BRIGHTNESS - map 255 to current max"" into sc-dev 2021-07-28 17:42:43 +00:00
Daniel Solomon
792229b553 Revert "SCREEN_BRIGHTNESS - map 255 to current max"
This reverts commit 002e656a51.

Reason for revert: Setting brightness using adb (adb shell settings put system screen_brightness ...) results in different brightness being set by DisplayPowerController each time.

Bug: 194791517
Test: atest HighBrightnessModeControllerTest
Test: manually test `settings put system screen_brightness 23` yields
      consistent results
Change-Id: I6b49253b46e4d09a1f4129d3df950c9d36eb6ede
2021-07-28 17:17:15 +00:00
Hai Zhang
af04dd2ad5 Merge "Only construct real Throwable objects in AndroidFuture.readThrowable()." into sc-dev 2021-07-28 01:23:12 +00:00
Siim Sammul
6c852aeabc Merge "Do not make a getThreadTimeMicro() call when it is not needed. This was accidentally changed with https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15080830" into sc-dev 2021-07-26 09:14:43 +00:00
Alison Cichowlas
832779a555 Merge "Sharesheet: remove 2 separators, restyle the 3rd." into sc-dev 2021-07-24 05:53:04 +00:00
Alison Cichowlas
6e6455518c Sharesheet: remove 2 separators, restyle the 3rd.
Test: Manual
Bug: 178619070
Change-Id: I9a6797863be2d0220fb71b2b9ca1d04c1f279b02
2021-07-23 21:43:22 +00:00
Alison Cichowlas
a1d1a38269 Merge "Sharesheet: be more defensive about un-unparcelable intents." into sc-dev 2021-07-23 21:31:40 +00:00
Santos Cordon
e4e836a175 Merge "SCREEN_BRIGHTNESS - map 255 to current max" into sc-dev 2021-07-23 20:13:55 +00:00
Alison Cichowlas
417b15994a Sharesheet: be more defensive about un-unparcelable intents.
Test: atest ChooserActivityTest
Bug: 194359789
Change-Id: I2fb0c0e120f048042dea499e1ffc126989e0e2d2
2021-07-23 12:17:29 -04:00
Alison Cichowlas
9197f7b260 Merge "Sharesheet: action bar is independent of WP tabs, should always launch as primary user." into sc-dev 2021-07-23 14:54:12 +00:00
Alison Cichowlas
f0657fc49e Sharesheet: action bar is independent of WP tabs, should always launch
as primary user.

Bug: 193424706
Test: atest ChooserActivityTest; manual per bug steps

Change-Id: Ie680270fa6a62ec59f35715514bfc0232b0d12f9
2021-07-22 20:43:21 -04:00
Santos Cordon
002e656a51 SCREEN_BRIGHTNESS - map 255 to current max
Since the current max can change for brightness due to
high-brightnes-mode (HBM), make it so that 255 is always mapped
to the current max, which can be different when in HBM or normal
brightness mode.

Bug: 187784093
Test: atest HighBrightnessModeControllerTest
Test: manually verify 255 is used for max when in HBM or not.
Change-Id: Ib0631fc12de0e8e4c7c638901d82c362e79944c3
2021-07-22 18:34:37 +01:00
Siim Sammul
8f31e9d663 Do not make a getThreadTimeMicro() call when it is not needed. This was
accidentally changed with https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15080830

Bug: 193543224
Test: N/A no functionality change, just avoiding a method call
Change-Id: If4579e96cd5aab41a46f60b5133938e81d608cff
2021-07-22 09:22:56 +00:00
Nikita Ioffe
e501fd8379 Restrict what APEXes different installers can update
* Mainline APEXes can only be updated by a modulesInstaller (an entry
in whitelisted-staged-installer.xml with isModulesInstaller="true")

* The whitelisted-staged-installer.xml file can have only one entry with
isModulesInstaller="true"

* Vendor APEXes can only be updated by an installer defined in the
corresponding entry in vendor-apex-allowlist.xml.

BYPASS_INCLUSIVE_LANGUAGE_REASON=existing occurrences

Test: atest StagedInstallInternalTest
Test: atest GtsStagedInstallHostTestCases
Test: atest CtsRollbackManagerHostTestCases
Test: atest CtsStagedInstallHostTestCases
Bug: 190802380
Change-Id: I729abb5153df079fb6885016a4b41d0acc827e3c
2021-07-21 16:44:42 +01:00
Ahan Wu
65a3d5dfa4 Fix potential memory leak of FrameTracker
If begin and end invocations are at the same frame, the end vsync id
will be smaller than the begin vsync id, results in zero size jank info
array, the finish call will be missed as well, a leak happens.

Bug: 192140966
Test: atest FrameTrackerTest InteractionJankMonitorTest
Change-Id: I388558e60bdb84ad248a9afabe7776c4e6e67c57
2021-07-20 06:31:41 +00:00
Hai Zhang
2d6a545e30 Only construct real Throwable objects in AndroidFuture.readThrowable().
Bug: 186530450
Test: atest CtsSecurityTestCases:android.security.cts.AndroidFutureTest
Change-Id: Icc5ce702f0cd84e9136dee3c65f63619df697358
2021-07-16 19:02:23 +00:00
Dmitri Plotnikov
4162c032bf Merge "Fix BatteryStatsImplTest." into sc-dev 2021-07-16 00:26:16 +00:00
Dmitri Plotnikov
21dd5325fb Fix BatteryStatsImplTest.
Bug: 180015146
Test: atest FrameworksCoreTests:BatteryStatsImplTest

Change-Id: I6b43ca03ba816e12735ebd47d8cf61a6b1cee110
2021-07-15 14:51:18 -07:00
TreeHugger Robot
4820907a6b Merge "Make Verification text shrink to zero size for long names or large fonts." into sc-dev 2021-07-14 13:46:45 +00:00
Daniel Sandler
51204c444a Merge changes from topic "egg12" into sc-dev
* changes:
  Bubbling up some of these great new colors.
  AnalogClock: Allow subclasses to override the "now" instant.
2021-07-13 19:37:48 +00:00
Dan Sandler
28f8033d80 Bubbling up some of these great new colors.
Bug: 177962166
Test: adb shell am start -n android/com.android.internal.app.PlatLogoActivity
Change-Id: I92cfe3f9e2294d888dfaa5f30591885804d8302b
2021-07-13 09:52:29 -04:00
Jeff DeCew
b3f13370d4 Make Verification text shrink to zero size for long names or large fonts.
Fixes: 189723284
Test: manual
Change-Id: I19e327df59cd085870c04e266f053a87b35b8a54
2021-07-12 16:04:21 -04:00
Jeff DeCew
d14c60be51 Merge "Use SRC_ATOP instead of SRC_IN for blending the NotificationExpandButton" into sc-dev 2021-07-12 19:48:58 +00:00
Ahaan Ugale
e360fc69a7 Merge "Check/note ops when delivering HotwordDetectedResult" into sc-dev 2021-07-12 17:46:28 +00:00
Ahaan Ugale
c5e855a9d9 Check/note ops when delivering HotwordDetectedResult
This is partially a followup of
I80dabaf6ae0e781028dde16ead3321fbff319542 which removed these operations
from the SoundTrigger layer when the HotwordDetectionService is used.

Also fixes a race condition where the DSP event can go directly to the
Interactor if the DetectionService isn't connected.

Bug: 186164881
Test: atest HotwordDetectionServiceBasicTest
Test: manual - DSP and non-DSP
Change-Id: Iee3b00c6c08597ad1993fae677e9f8ae2f60744c
2021-07-12 17:42:24 +00:00
Jeff DeCew
8d6f3cc158 Use SRC_ATOP instead of SRC_IN for blending the NotificationExpandButton
Bug: 191969252
Bug: 193157438
Test: check for number of layers in the scene
Change-Id: I65bd80c71b55582347da1559cf707e9d023b7f13
2021-07-09 15:40:31 -04:00
Mark Renouf
84f80d152d Quiet down long screenshots logcat output
With this change, a long screen shot flow generates only
the following log entries:

D Screenshot: ScrollCapture: connected to window [com.example/.ExampleActivity]
D Screenshot: onCaptureStarted
D Screenshot: end()
I Screenshot: Completed: LongScreenshot{w=1080, h=5339}

Tags covered:

LongScreenshotActivity
Screenshot
ScrollCaptureConnection
ScrollCaptureInternal
ScrollCaptureViewSupport
ScrollCaptureController
ViewRenderer

Bug: 190399332
Test: observe logcat during long screenshot
Change-Id: Ia2b018224897ad1ca153967ff9f60340a64f4815
2021-07-09 01:25:50 +00:00
Matt Casey
5f5e03d3ef Merge "Revert RecyclerViewCaptureHelper changes from ag/15083160" into sc-dev 2021-07-07 15:19:41 +00:00
Fiona Campbell
2bb1f86a17 Merge "Clean up framework brightness system" into sc-dev 2021-07-05 17:22:46 +00:00
Michael Wachenschwanz
42f68a76f5 Merge "Move RPM stats collection out of BatteryStatsImpl.mLock" into sc-dev 2021-07-03 01:41:41 +00:00
Fiona Campbell
7e8d205424 Clean up framework brightness system
Remove brightness_float setting.
Delete unused code.
Use display manager sync root for BrightnessSetting

Bug: 191472484
Test: atest com.android.server.display

Change-Id: I0cc722949081ba5a3aaa9f7fa4ff4e874578925b
2021-07-03 00:10:33 +01:00
Matt Casey
fb0dea3d3c Revert RecyclerViewCaptureHelper changes from ag/15083160
Changes in shared code with ListView implementation seem to have
had negative side effects with Telegram. Revert the old onScrollRequested
implementation for now.

Bug: 189475409
Test: Verify gaps missing from telegram long screenshots
      (and they don't run out of tiles)

Change-Id: Iff81293c6ec34bf3e024e930fe61ba9a1fd95b7b
2021-07-02 23:03:28 +00:00
Michael Wachenschwanz
62a9ff6718 Move RPM stats collection out of BatteryStatsImpl.mLock
Querying RPM stats on device with a large number of StateResidency info
can take a long time. Move the query to outside of the BatteryStats
lock to reduce the chance of lock contention.

Bug: 185970842
Test: atest android.cts.statsd.validation.ValidationTests#testPartialWakelock

Change-Id: I1c69b3f9c071e5d758cf4b22855c4b0ec221a5cf
2021-07-02 15:58:27 -07:00
Song Hu
469f9d3253 Fix sharing shortcuts not showing for Work Profile. Check package by
using selected profile PackageManager.

Test: test on local device
Bug: 175240616
Fixes: 179798044
Change-Id: I30728705dbc60d0506b7d20a16bcc8f1eed9b6d0
(cherry picked from commit 0e4b75a215)
2021-07-02 17:16:28 +00:00
TreeHugger Robot
4e944d4634 Merge "Switch back to sync IInputMethodManager" into sc-dev 2021-07-02 15:22:21 +00:00
Tiger Huang
de8ea692b1 Merge "Remove the light flag if the bar isn't specified light in theme" into sc-dev 2021-07-02 09:39:40 +00:00
Yohei Yukawa
9dde701446 Switch back to sync IInputMethodManager
This CL logically reverts recent CLs [1][2][3][4][5][6][7][8][9] to
switch back to the previous sync IPC approach in IInputMethodManager
except for the following two IPCs.

 * reportPerceptibleAsync
 * removeImeSurfaceFromWindowAsync

Reason for revert:
We need more time to understand its performance implications.

 [1]: If4b40244a2e0e3b11c38c1da9340ba8e5166ad64
      b9590fa1e1
 [2]: If79e063641a01b325c63eb9f871f5b992d7c0b72
      5a5648dcb5
 [3]: I1547b98b2aacf764e33aadc9ab784f2013f58f2f
      d833f0dab4
 [4]: I646ef4ae0570aae1812ea267f309441fdec6938d
      38fd020616
 [5]: Iaa63e01453da4ff0e3f446eac036b3be3180cb73
      4a820ccc41
 [6]: Id516fd1c961f43ac3e139c88d7ed004c188d458b
      0a32fd21ef
 [7]: Icb396ae5d74060af69c4ecb16723b2e37b9f2067
      c4663ba6a9
 [8]: I3eafbc28ed3acf3ba859885bf201cb06b3149b94
      f226a79fee
 [9]: Ic584203c1221fbae17f5e2d8f09e3992df061646
      5e2d9f271d

Bug: 163453493
Bug: 174892351
Fix: 190486491
Test: atest CtsInputMethodTestCases
Change-Id: If16ac0de536d9089eb04f6e07b1ee47378124658
Merged-In: If16ac0de536d9089eb04f6e07b1ee47378124658
2021-07-02 07:06:07 +00:00
Lucas Lin
30d17bd9a1 Merge "Fix Ikev2 vpn cannot establish through startLegacyVpn()" into sc-dev 2021-07-02 05:27:30 +00:00
Tiger Huang
0eb56cb359 Remove the light flag if the bar isn't specified light in theme
Previously, PhoneWindow will add the light flag for the bar if it is
specified light in theme. It won't remove the light flag if the theme is
not light. The previous logic in PhoneWindow#generateLayout assumes the
decor view was newly created.

However, the decor view can be reused from the preserved window. This
happens if the activity is recreated. So if the previous activity was in
a light theme and the newly created activity is in a dark theme, we
should clear the light bar flags added in the previous activity.

Fix: 174502412
Test: 1. Set Dialer (Phone) to dark theme from Dialer's display options.
      2. Clear app data from Dialer's app info.
      3. Open Dialer again and see if the color of system bars are
         normal.
Change-Id: I3ea61322e4c3cfe26981e23792f42ab0b9a1e217
2021-07-01 23:25:51 +08:00
TreeHugger Robot
cfe4767b40 Merge changes I5bdc1f46,Idd24fd51 into sc-dev
* changes:
  Sharesheet style updates
  Update Edit icon.
2021-06-30 22:00:33 +00:00
Dmitri Plotnikov
ebf77ebc51 Merge "Fix boot time BatteryStats reset failure" into sc-dev 2021-06-30 18:53:20 +00:00
Dmitri Plotnikov
bcd46f1ed4 Fix boot time BatteryStats reset failure
We need some services to create a battery stats snapshot
captured at the time of battery reset.
The issue is that if the battery stats reset occurs during boot,
before the system is ready, those services may not be prepared.

The fix is to postpone battery stats reset until after the
system server is ready.

Also, we will now reset the stats if battery got partially charged
and discharged repeatedly without ever reaching the full charge.
This will prevent battery sessions from going on forever and
overflowing internal data structures.

This CL partially reverts 0ed84f1263

Bug: 192252233
Test: run PowerOnOffTest#testPowerOnOff repeatedly
Change-Id: Ib486e4caeeac7c933288c3a1055259c05f45c6c8
2021-06-30 17:07:58 +00:00
Yurii Zubrytskyi
337f73edc9 Pause watchdog monitor for incfs native lib extraction
Native library extraction potentially takes much longer time for
Incremental installations vs the regular ones: each page can
wait for up to 10s (adb) or 100ms (non-adb), adding up to the
full watchdog timeout of 1 min and triggering a reboot.

This CL pauses Watchdog for the thread that's running extraction
to make sure we don't try to fix a hanging single installation
with killing the OS.

Bug: 191166673
Fixes: 191166673
Test: atest package manager and incremental suites
Change-Id: I9c4c24f305e079f346a76b64d4841cdbd58734fa
2021-06-29 16:21:12 -07:00
TreeHugger Robot
0ac141c3ba Merge "Add global app op restrictions" into sc-dev 2021-06-29 19:53:50 +00:00
Orion Hodson
8e8cb4cb1f Merge changes from topic "system-server-images" into sc-dev
* changes:
  Fix JNI error
  Revert^2 "Zygote: Load system server code early"
2021-06-29 16:05:36 +00:00
lucaslin
64e5f3e6f7 Fix Ikev2 vpn cannot establish through startLegacyVpn()
Settings will also call startLegacyVpn() to bring up Ikev2 VPN,
so it's needed to add a vpn type check in startLegacyVpn().
Otherwise, UnsupportedOperationException will be thrown when
Settings tries to bring up Ikev2 VPN.

Bug: 191937302
Bug: 188749090
Bug: 189808606
Test: 1. make gts && gts-tradefed
      2. run gts --module GtsNetworkStackHostTestCases
Change-Id: I752c39bd1bf953a11bdf62e6f02f99f48fef23c4
2021-06-29 07:40:33 +00:00
TreeHugger Robot
9c8441c8af Merge "Disable the BatteryUsageStatsStore feature" into sc-dev 2021-06-29 00:25:22 +00:00