Commit Graph

10149 Commits

Author SHA1 Message Date
Lee Shombert
9a686c07ba Merge "Prepare PropertyInvalidatedCache for SystemApi" 2022-01-06 23:14:05 +00:00
Mayank Garg
bb50683599 Merge "Converted NewUserResponse constructor to testAPI" 2022-01-06 22:22:58 +00:00
Dmitri Plotnikov
19196aff5c Merge "Add BatteryStatsManager.getWakeLockStats() API" 2022-01-06 18:05:14 +00:00
Junyu Lai
fb715a951d Merge changes from topics "ms34-tm", "ms40-clock" am: beb9fb3cc8 am: 08c51b04ca am: d312550ff8 am: f23caacaf1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1914533

Change-Id: I7db7bdf217c982ef6011a948b68d238c54e2a47e
2022-01-06 14:39:44 +00:00
Junyu Lai
f23caacaf1 Merge changes from topics "ms34-tm", "ms40-clock" am: beb9fb3cc8 am: 08c51b04ca am: d312550ff8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1914533

Change-Id: I13c1439933d33c81e3f8668ad0b86bea2b6b68a7
2022-01-06 14:23:37 +00:00
Junyu Lai
d312550ff8 Merge changes from topics "ms34-tm", "ms40-clock" am: beb9fb3cc8 am: 08c51b04ca
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1914533

Change-Id: I244779c19fab00eede1b7e9f3980679131e75cbb
2022-01-06 14:09:31 +00:00
Junyu Lai
beb9fb3cc8 Merge changes from topics "ms34-tm", "ms40-clock"
* changes:
  [MS09] Expose NetworkTemplate APIs which are needed by NetworkPolicy
  [MS34.1] Replace TelephonyManager#getSubscriberId(subId) with public API
  [MS40.1] Remove Clock dependencies from NetworkStatsService
  [MS27] Expose noteUntaggedSocket SystemApi
2022-01-06 13:56:39 +00:00
Neharika Jali
1d55f7bf2d Merge "Fix numerical overflow in result in computeStorageCacheBytes" 2022-01-06 11:23:19 +00:00
Junyu Lai
2aa7b9ec4d [MS40.1] Remove Clock dependencies from NetworkStatsService
This includes:
1. Re-implement the BestClock in the static library.
2. Expose SystemClock#currentNetworkTimeClock as public Api

Test: TH
Bug: 204830222
CTS-Coverage-Bug: 213393821
Exempt-From-Owner-Approval: 1. Owner approved the change with
  explicitly granted submission after adderessing the
  straight-forward comment. 2. Owner is OOO for 3 months.
Change-Id: I08c0162a7101cc6184f3eca3d4a59211183fb843
2022-01-06 08:49:59 +00:00
Junyu Lai
0cf9e87c79 [MS27] Expose noteUntaggedSocket SystemApi
While Data usage related codes are moving to mainline module,
StrictMode#vmUntaggedSocketEnabled() and onUntaggedSocket()
can no longer be accessed from NetworkManagementSocketTagger.

Thus, expose alternative SystemApi to allow invocations from
the module.

Test: TH
Bug: 204830222
Exempt-From-Owner-Approval: 1. Owner approved the change with
  explicitly granted submission after adderessing the
  straight-forward comment. 2. Owner is OOO for 3 months.
Change-Id: Ib54ff54ce3617ae0d04080a1740e78b086bbb039
2022-01-06 08:49:46 +00:00
Neharika Jali
4bf22b5e9a Fix numerical overflow in result in computeStorageCacheBytes
Bug: 211756656
Test: atest atest
frameworks/base/core/tests/coretests/src/android/os/storage/StorageManagerBaseTest#testGetStorageCacheBytesUnderModerateStorage

Change-Id: I89fd358536708389d33e3077dcd0928332f5182f
2022-01-06 08:01:42 +00:00
Dmitri Plotnikov
e07408d447 Include saved battery history buffers into BatteryUsageStats parcel
Bug: 209297031
Test: atest FrameworksCoreTests:BatteryUsageStatsTest FrameworksCoreTests:BatteryUsageStatsProviderTest
Change-Id: I369d863b6f6fd488030aa031cc465bef6ce99ab8
2022-01-05 19:45:43 +00:00
Dmitri Plotnikov
42fec8dfa2 Merge "Add BATTERY_STATS_OWNERS to all *Stats files" am: 884e5d8456 am: b759da54a3 am: c8eaba313f am: 5ae5ccf9e3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1936287

Change-Id: I909ed3369c4b28e5dfe709e0cff333dcd665d87a
2022-01-05 19:39:28 +00:00
Dmitri Plotnikov
5ae5ccf9e3 Merge "Add BATTERY_STATS_OWNERS to all *Stats files" am: 884e5d8456 am: b759da54a3 am: c8eaba313f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1936287

Change-Id: I7a4e5bb0afdfbee2de431bb17b161225909bb5fc
2022-01-05 19:09:53 +00:00
Dmitri Plotnikov
c8eaba313f Merge "Add BATTERY_STATS_OWNERS to all *Stats files" am: 884e5d8456 am: b759da54a3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1936287

Change-Id: I5fc46af02882bd65a5359705e67240809731d4f5
2022-01-05 00:09:15 +00:00
Dmitri Plotnikov
884e5d8456 Merge "Add BATTERY_STATS_OWNERS to all *Stats files" 2022-01-04 23:42:08 +00:00
Dmitri Plotnikov
5e85751023 Add BATTERY_STATS_OWNERS to all *Stats files
Test: N/A
Change-Id: Ifb1865b2db902bf0cca1bde48a7381903dca229c
2022-01-04 15:31:01 -08:00
Lee Shombert
0cece3898b Prepare PropertyInvalidatedCache for SystemApi
Bug: 152453213
Tag: #refactor

This commit prepares PropertyInvalidatedCache to function as a system
api.  Specifically, the methods recompute() and bypass() which may be
overridden by clients are now public (instead of protected).  This
forces an update to all existing clients, to accommodate the change in
method visibility.

Two small changes have been made as cleanup:

 1. The awkwardly named debugCompareQueryResults() is now
    resultEquals(), which is more or less consistent with how other
    equality tests are named in Android.  This name change affects two
    clients.

 2. PackageManager has changed to use resultEquals() instead of
    maybeCheckConsistency().  This provides a simpler and more
    consistent use of the APIs.  maybeCheckConsistency() has been made
    private.

Test: atest PropertyInvalidatedCacheTests

Change-Id: I4110f8e887a4fd8c784141e8892557a9d1b80a94
2022-01-04 08:13:59 -08:00
Mayank Garg
59a27ff1ed Converted NewUserResponse constructor to testAPI
Bug: 199446283
Test: m
Change-Id: I550c05a3c1e35adba911b1fcf48cc6c072280c14
2021-12-21 10:13:34 -08:00
Treehugger Robot
ec1801d37e Merge "Fix for run cts-on-gsi -m CtsOsTestCases -t android.os.cts.VibratorTest" am: c9ed425df2 am: 1b148ed131 am: 130599d186 am: 15ccd2c588
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1918645

Change-Id: I8ca688eaeb2f3f4a34a5bcffa40fca88051e341c
2021-12-20 16:04:13 +00:00
Treehugger Robot
15ccd2c588 Merge "Fix for run cts-on-gsi -m CtsOsTestCases -t android.os.cts.VibratorTest" am: c9ed425df2 am: 1b148ed131 am: 130599d186
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1918645

Change-Id: Ib3847acbafea7e24c97d4577ff1dc1de0b4dfed6
2021-12-20 15:47:39 +00:00
Treehugger Robot
130599d186 Merge "Fix for run cts-on-gsi -m CtsOsTestCases -t android.os.cts.VibratorTest" am: c9ed425df2 am: 1b148ed131
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1918645

Change-Id: I0260a0c7e994d4186dda7553fe5fa44b39c7de2e
2021-12-20 15:15:33 +00:00
Treehugger Robot
c9ed425df2 Merge "Fix for run cts-on-gsi -m CtsOsTestCases -t android.os.cts.VibratorTest" 2021-12-20 14:33:41 +00:00
Dmitri Plotnikov
a633941cec Add BatteryStatsManager.getWakeLockStats() API
Bug: 200753927
Test: atest FrameworksCoreTests:BatteryStatsImplTest
Change-Id: Iafb216250e26b93cec5106d1305fa68c6f20282f
2021-12-17 23:14:36 +00:00
Yasin Kilicdere
5f8f93b97e Merge "Add settings entrypoint to add a supervised user" 2021-12-16 19:45:24 +00:00
Dmitri Plotnikov
553429ae39 Merge "Attribution of modem power per process state" 2021-12-16 18:59:50 +00:00
Steven Moreland
dc63dc4d57 Merge "Binder: recycle Parcel in finally block" am: 8581d27415 am: 0c1dac2572 am: b4f0710e19 am: 2cc9570c3b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1926857

Change-Id: Ibeb6d54f6be510c6800c57c28a32398f084be89a
2021-12-16 18:25:52 +00:00
Steven Moreland
2cc9570c3b Merge "Binder: recycle Parcel in finally block" am: 8581d27415 am: 0c1dac2572 am: b4f0710e19
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1926857

Change-Id: I83621e2ea9fbb09dfea582c81516dc6ebc1118bf
2021-12-16 18:02:12 +00:00
Steven Moreland
b4f0710e19 Merge "Binder: recycle Parcel in finally block" am: 8581d27415 am: 0c1dac2572
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1926857

Change-Id: I822c72fb027da80e39762c03b228e7c966bbe253
2021-12-16 17:46:12 +00:00
Steven Moreland
8581d27415 Merge "Binder: recycle Parcel in finally block" 2021-12-16 17:16:31 +00:00
Neharika Jali
fa21499347 Merge "Change reserved cache space as sum of cache quotas of all uids" 2021-12-16 05:57:46 +00:00
Steven Moreland
713c258edc Binder: recycle Parcel in finally block
If other types of exceptions happen here, we should still recycle the Parcel.

Bug: 207778694
Test: boot
Change-Id: I3375b87a674c45f8bc66848dfaf899497f5acaa8
2021-12-16 01:03:54 +00:00
Treehugger Robot
1ebda598ca Merge "Log UI events to traces" am: a9666fccb9 am: 6e713ddc1e am: 8b81ff8dbc am: 891c20d026
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1920746

Change-Id: I5ed8fc8d20463550a043443b2e03e73b3d103a52
2021-12-15 19:31:26 +00:00
Bernardo Rufino
3d10fb4b83 Merge "Migrate unsafe parcel APIs in framework-minus-apex" 2021-12-15 19:15:58 +00:00
Treehugger Robot
891c20d026 Merge "Log UI events to traces" am: a9666fccb9 am: 6e713ddc1e am: 8b81ff8dbc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1920746

Change-Id: I6f667d1c10b476abd96a85971f421bad0e17e71d
2021-12-15 19:02:48 +00:00
Treehugger Robot
8b81ff8dbc Merge "Log UI events to traces" am: a9666fccb9 am: 6e713ddc1e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1920746

Change-Id: Ica852f77a0771b6a44bbaffbe019a634f0dc4622
2021-12-15 18:48:31 +00:00
Bernardo Rufino
90bb3709dc Migrate unsafe parcel APIs in framework-minus-apex
Migrate the following unsafe parcel APIs in framework-minus-apex:
* Parcel.readSerializable()
* Parcel.readArrayList()
* Parcel.readList()
* Parcel.readParcelable()
* Parcel.readParcelableList()
* Parcel.readSparseArray()

This CL was generated by applying lint fixes that infer the expected
type from the caller code and provide that as the type parameter
(ag/16365240).

A few observations:
* In some classes we couldn't migrate because the class also belonged to
another build module whose min SDK wasn't current (as is the case for
framework-minus-apex), hence I suppressed the lint check
(since I'll eventually submit the lint check to the tree).
* In some cases, I needed to do the cast in
https://stackoverflow.com/a/1080525/5765705 to make the compiler happy
since there isn't another way of providing a class of type
Class<MyClassWithGenerics<T>>.
* In the readSerializable() case, the new API also requires the class
loader, that was inferred to by InferredClass.class.getClassLoader().
* Note that automatic formatting and import rely on running hooked up
to the IDE, which wasn't the case here.

Bug: 195622897
Test: TH passes
Change-Id: I11a27b9bdab7959ee86e90aa1e1cbebd7aaf883c
2021-12-15 18:21:38 +00:00
Treehugger Robot
a9666fccb9 Merge "Log UI events to traces" 2021-12-15 18:11:52 +00:00
Lucas Dupin
2f72aa0bd1 Log UI events to traces
Add LogBuffer tags to perfetto traces in order to simplify the process
of reading them.

A new track will indicate the state of notification, lock screen, AOD,
etc.

Bug: 207049735
Test: atest TraceDevTest
Change-Id: I3253c0f5a369ad4a25d6646daa62810644553a36
2021-12-14 21:35:19 +00:00
Terry Wang
7cba364933 Merge "Add @SystemApi annotation to parcel.writeBlob and readBlob." 2021-12-14 21:13:06 +00:00
Dmitri Plotnikov
9bf5b2f104 Attribution of modem power per process state
Bug: 191921016
Test: atest FrameworksCoreTests:BatteryStatsTests

Change-Id: I43bde25785e246340dffe87a15fa960771fa1ec5
2021-12-14 10:23:03 -08:00
Yasin Kilicdere
a8fdfa389b Add settings entrypoint to add a supervised user
Bug: 205101183
Bug: 199868785
Test: croot && make RunSettingsRoboTests -j40 ROBOTEST_FILTER="com.android.settings.users.UserSettingsTest"
Change-Id: Ief48a9d974f3a40191161e02bbed605e4327c454
2021-12-14 15:01:18 +00:00
Tim Van Patten
2954689c4f Merge "ANGLE: Global.Settings should override GameManagerService" 2021-12-13 23:40:55 +00:00
TreeHugger Robot
a7cc168d0e Merge "Add cheap aidl tracing suitable for always-on-tracing (1/3)" 2021-12-13 13:55:32 +00:00
hupengcheng
b166fcedac Fix for run cts-on-gsi -m CtsOsTestCases -t android.os.cts.VibratorTest
For dual vibrator device, the AOSP code needs to be adjusted as follow.

Bug: 209932477
Test:
run cts-on-gsi -m CtsOsTestCases -t android.os.cts.VibratorTest#testVibrateComposed
run cts-on-gsi -m CtsOsTestCases -t android.os.cts.VibratorTest#testVibratorIsVibrating
run cts-on-gsi -m CtsOsTestCases -t android.os.cts.VibratorTest#testVibrateMultiThread
run cts-on-gsi -m CtsOsTestCases -t android.os.cts.VibratorTest#testVibratorVibratesNoLongerThanDuration
run cts-on-gsi -m CtsOsTestCases -t android.os.cts.VibratorTest#testVibrateOneShot
run cts-on-gsi -m CtsOsTestCases -t android.os.cts.VibratorTest#testVibratorStateCallback
run cts-on-gsi -m CtsOsTestCases -t android.os.cts.VibratorTest#testVibratePattern
run cts-on-gsi -m CtsOsTestCases -t android.os.cts.VibratorTest#testVibratePredefined
run cts-on-gsi -m CtsOsTestCases -t android.os.cts.VibratorTest#testVibrateWaveform
run cts-on-gsi -m CtsOsTestCases -t android.os.cts.VibratorTest#testVibratorCancel

Change-Id: I31afc8179acb4f7749b1208f3abd13a1941a01b2
2021-12-13 09:38:05 +00:00
Kholoud Mohamed
8199ec0d7e Merge changes from topic "queryUser"
* changes:
  Add QUERY_USERS permission to some UserManager APIs
  Create new QUERY_USERS permission
2021-12-10 21:54:34 +00:00
Jorim Jaggi
794720fbd2 Add cheap aidl tracing suitable for always-on-tracing (1/3)
Instead of having only one switch to enable all binder tracing,
we seperate between stack tracking and tracing. Stack tracking
still works as before. However, the more lightweight option,
tracing using android.os.Trace, is toggleable separately and will
work on the receiver side without dumping the entire stack trace.

We also make the tracing more efficient by caching
getTransactionName and concatting the class name.

Also, enable this selectively for SysUI+Launcher, which is
currently the focus of always-on-tracing effort to figure out
what kind of binder calls these processes are calling which seems
to contribute a huge amount of jank (long binder calls are in
>= 50% of janky traces).

Test: external/perfetto/tools/record_android_trace gfx view freq sched wm am aidl
Test: atest aidl_unittests
Bug: 202278427
Change-Id: I4d803d073cc4b69d07fa433bfef7e1c7f45132b7
2021-12-10 17:03:24 +01:00
Tim Van Patten
ef7aedfce6 ANGLE: Global.Settings should override GameManagerService
If ANGLE is enabled by the Game Dashboard (GameManagerService), but the
user has specified the native driver should be loaded,
GraphicsEnvironment::shouldUseAngle() will still return 'true' and ANGLE
will be loaded.

This CL updates GraphicsEnvironment::shouldUseAngle() to not return true
if the user has forced the native driver.

This CL also updates GameManagerService to allow config values that only
specify 'useAngle', rather than requiring 'downscaleFactor' also.

Tested with the following adb commands:
1.) Enable ANGLE via DeviceConfig for Angry Birds 2:
    adb shell device_config put game_overlay com.rovio.baba mode=3,downscaleFactor=0.7,useAngle=true
2.) Force the native driver:
    adb shell settings put global angle_gl_driver_selection_pkgs com.rovio.baba
    adb shell settings put global angle_gl_driver_selection_values native

Test: adb commands
Test: atest CtsAngleIntegrationHostTestCases
Bug: b/209519090
Change-Id: Ic1fb867129e0707a38470250d333fcbf486cab76
2021-12-09 18:45:28 -07:00
Treehugger Robot
ae84a4a4c9 Merge "Don't require T to extend Parcelable or Serializable in Parcel" am: 6a2f196dca am: 425b8699bb am: f64706cd2f am: fa693ff4c0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1914047

Change-Id: I867b8b319428d512ddc6b5f222110cc9e65aee5f
2021-12-10 01:12:14 +00:00
Treehugger Robot
fa693ff4c0 Merge "Don't require T to extend Parcelable or Serializable in Parcel" am: 6a2f196dca am: 425b8699bb am: f64706cd2f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1914047

Change-Id: I36c2b5a97a67dbcde85ed9eea63111391870234c
2021-12-10 00:55:09 +00:00