Commit Graph

9555 Commits

Author SHA1 Message Date
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
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
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
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
Steven Moreland
8581d27415 Merge "Binder: recycle Parcel in finally block" 2021-12-16 17:16:31 +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
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
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
Treehugger Robot
425b8699bb Merge "Don't require T to extend Parcelable or Serializable in Parcel" am: 6a2f196dca
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1914047

Change-Id: Ie78e98103a3313414fbef82a808e2a0b3fdeba91
2021-12-10 00:11:01 +00:00
Hao Ke
31fa514400 Don't require T to extend Parcelable or Serializable in Parcel
This is because we want to support the use-case where the caller
enforces a specific class type that doesn't implement Parcelable
or Serializable but the child classes written on the payload implement them.

One such use-case that needs this before migrating is
https://cs.android.com/android/platform/superproject/+/master:frameworks/base/core/java/com/android/internal/infra/AndroidFuture.java;l=596;drc=2d6a545e3042d7cc91b54746e774681a05e0ff22:
we need to enforce Throwable class but it doesn't implement Parcelable itself,
while its children written on the wire are expected to.

Test: atest -d android.os.cts.ParcelTest
Bug: 195622897
Change-Id: I150416d0cfb0b87ddbaff1041d8d60aa205f6f39
2021-12-09 15:40:04 +00:00
Bernardo Rufino
91e53b04aa Merge "Deprecate unsafe Parcel.readParcelableArray(ClassLoader)" am: 2ee662c767
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1910046

Change-Id: I3f12c9a32b1b2146ec83f0a04eb5768cafd2eecd
2021-12-09 10:54:30 +00:00
Bernardo Rufino
2ee662c767 Merge "Deprecate unsafe Parcel.readParcelableArray(ClassLoader)" 2021-12-09 10:35:34 +00:00
Tim Van Patten
4d3d322f09 Merge "Correctly call setGpuStats() for ANGLE/system driver" am: c6d9eda8c0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1906687

Change-Id: I93a7c79612c189198ef1200d471b685c35664694
2021-12-08 17:10:36 +00:00
Tim Van Patten
c6d9eda8c0 Merge "Correctly call setGpuStats() for ANGLE/system driver" 2021-12-08 16:52:44 +00:00
Evgenii Stepanov
7842e7f363 Merge "Pass MTE RuntimeFlags to AppZygote." am: 1db942e761
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1910277

Change-Id: If16ed953afd35c4c58ee7ea966b889a1a3ca62fb
2021-12-07 19:19:15 +00:00
Evgenii Stepanov
1db942e761 Merge "Pass MTE RuntimeFlags to AppZygote." 2021-12-07 19:03:17 +00:00
Hao Ke
d0ba47450c Merge "Set default ClassLoader for Parcel readSerializable API." am: 3760188d11
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1899432

Change-Id: I2a3c070553f6f198a8b34f0e3aa0a7cd64d4ee98
2021-12-06 17:21:29 +00:00
Hao Ke
3760188d11 Merge "Set default ClassLoader for Parcel readSerializable API." 2021-12-06 17:03:50 +00:00
Hao Ke
e214082cb0 Set default ClassLoader for Parcel readSerializable API.
Set the default ClassLoader for the readSerializable(ClassLoader,
Class) API, when the ClassLoader parameter is null.

Doing so could enhance the security of Parcel deserialization,
as it would prevent resolving the Serializable class using unexpected
ClassLoaders.

Test: atest -d android.os.cts.ParcelTest
Bug: 195622897
Change-Id: I6da4b4f817c33e4464d90d1e9775b54793835c92
2021-12-06 14:34:03 +00:00
Bernardo Rufino
e3d8a1a299 Deprecate unsafe Parcel.readParcelableArray(ClassLoader)
Forgot this one.

Test: Builds
Bug: 195622897
Change-Id: Ia258f77fd2e706d2071c853c20d6ec3baa170a1f
2021-12-06 13:40:08 +00:00
Evgenii Stepanov
8895ef1256 Pass MTE RuntimeFlags to AppZygote.
Fix AppZygote process and its children (the actual service processes)
ignoring android:memtagMode attribute in the app manifest.

When starting a new AppZygote process, apply memtag-related flags as
determined by the app manifest (and modified by compat features and
actual h/w capabilities). If this is not done, MTE is always disabled in
an AppZygote process, which makes it impossible to enable it in the
AppZygote's children.

This change has no effect unless MTE is supported in the hardware
(ARMv9) and enabled in the system.

Bug: 207557677
Test: CtsTaggingHostTestCases
Change-Id: I8805958545fd790e4ca857184b749a21e58d68cd
2021-12-03 17:20:05 -08:00
Hao Ke
479f10d9b7 Merge "Added End-of-Parcel check API." am: 93b3eb84ec
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1876569

Change-Id: I49bf528e536c18c64beb464d1021c5779d9f6325
2021-12-04 00:24:10 +00:00
Hao Ke
93b3eb84ec Merge "Added End-of-Parcel check API." 2021-12-03 23:54:12 +00:00
Hao Ke
ffabccb807 Merge "Deprecate unsafe readParcelableList API." am: f75e459db0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1909291

Change-Id: I3178b1085d729e7ce9fdb13f47fb8bdbf2bd06c8
2021-12-02 21:45:22 +00:00
Hao Ke
f75e459db0 Merge "Deprecate unsafe readParcelableList API." 2021-12-02 21:17:21 +00:00
Treehugger Robot
0d39f92360 Merge "Check for initialization of mUpdateEngine" am: e3a84af1a7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1907970

Change-Id: Ic6dd9dcbc427d9c867f2b1ccb447a591deb05c96
2021-12-02 19:11:39 +00:00
Treehugger Robot
e3a84af1a7 Merge "Check for initialization of mUpdateEngine" 2021-12-02 18:44:59 +00:00
Hao Ke
d117f6f6d5 Added End-of-Parcel check API.
Added End-of-Parcel check API, that verifies there are no
bytes left to be read on the Parcel.

Test: atest -d android.os.cts.ParcelTest#testEnforceNoDataAvail
Bug: 195622897
Bug: 204990745
Change-Id: I3068568d8d4371b071aecd357adeb45a2d7103e4
2021-12-02 16:16:54 +00:00
Hao Ke
aa4e9dfda8 Deprecate unsafe readParcelableList API.
Deprecate unsafe parcel APIs and point to the safer ones that take the
expected type as parameter. Also mentioned the typed ones
that take the creator as argument since those are also more performant.

Test: Builds
Bug: 195622897
Bug: 199275680
Bug: 205985058
Change-Id: I77a1a925d8759fd122936780587e3488705d4c56
2021-12-02 15:43:40 +00:00
Tim Van Patten
6e2a6588aa Correctly call setGpuStats() for ANGLE/system driver
In GraphicsEnvironment, correctly indicate if the loaded driver is ANGLE
or the system driver. This allows the 'dumpsys gpu' command to have the
correct value in the angleInUse field.

Bug: b/154955572
Test: adb shell dumpsys gpu
Test: atest CtsAngleIntegrationHostTestCases
Change-Id: I6db466b796e216367b0a220e432067b9ae6f485b
2021-12-01 12:50:59 -07:00
Kelvin Zhang
8af2abfcc7 Check for initialization of mUpdateEngine
Bug: 207768409
Test: th

Change-Id: Idc702658ab542566d775b296f1e82b63b0c1c2a4
2021-12-01 10:56:34 -08:00
Hao Ke
42cd062e7b Merge "Adding typed Parcel readParcelableList API." am: edbe912fd3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1899430

Change-Id: Ie32cabcd2e878e9b56c2259a30146ad85202f751
2021-12-01 00:31:44 +00:00
Hao Ke
edbe912fd3 Merge "Adding typed Parcel readParcelableList API." 2021-12-01 00:16:28 +00:00
Treehugger Robot
537fa65325 Merge "Add OWNERS file to android.os.vibrator" am: 8e054179ea
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1906510

Change-Id: I0fb0d1136ef37b2966ce1abd522c0110fcf029d6
2021-11-30 18:48:40 +00:00
Lais Andrade
ffe9e9154a Add OWNERS file to android.os.vibrator
Change-Id: I1b8cd5446e8909bf20f4436a450bd7a0199ab508
2021-11-30 11:38:21 +00:00
Treehugger Robot
4c1e2a20ca Merge "Update vibrator file owners" am: fcab8baf60
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1905230

Change-Id: Ie0f0dc75410cec10173fdb99e8eebb50b24c04ea
2021-11-29 14:53:50 +00:00
Hao Ke
b67fc38355 Adding typed Parcel readParcelableList API.
Added typed Parcel readParcelableList API that takes extra clazz
parameters check that the class written on the wire is the same,
or a descendant from the one provided as the key and value arguments.

Doing so could enhance the security of Parcel deserialization,
as it would prevent unexpected types of objects being deserialized.
More details can be found at go/safer-parcel.

Test: atest -d android.os.cts.ParcelTest
Bug: 195622897
Change-Id: Ibdb90fa622ef6eaa0bd2b9de629f51fc4fa7091a
2021-11-29 14:48:25 +00:00
Lais Andrade
2447152914 Update vibrator file owners
This should include the missing file VibrationAttributes as well.

Change-Id: I041fc01bba70da46004f27e9dd4fafdef7768ba3
2021-11-29 13:13:14 +00:00
Treehugger Robot
5dc7e50d24 Merge "Split MOUNT_FLAG_VISIBLE into MOUNT_FLAG_VISIBLE_FOR_{READ, WRITE}" am: b6f19328d5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1891615

Change-Id: I2aaee0d7eae200481bafd21d3082222412c998bd
2021-11-26 03:23:23 +00:00
Youkichi Hosoi
9b033785ae Split MOUNT_FLAG_VISIBLE into MOUNT_FLAG_VISIBLE_FOR_{READ, WRITE}
Currently, VolumeInfo.isVisibleForUser(), VolumeInfo.isVisibleForRead(),
and VolumeInfo.isVisibleForWrite() are all equivalent; all of them just
mean that the volume has MOUNT_FLAG_VISIBLE.

This CL splits MOUNT_FLAG_VISIBLE into MOUNT_FLAG_VISIBLE_FOR_READ and
MOUNT_FLAG_VISIBLE_FOR_WRITE. They correspond to isVisibleForRead() and
isVisibleForWrite(), respectively, whereas isVisibleForUser() is now
defined as isVisibleForRead() || isVisibleForWrite().

Accordingly, all usages of MOUNT_FLAG_VISIBLE are replaced with
MOUNT_FLAG_VISIBLE_FOR_WRITE, and all usages of isVisibleForRead() are
replaced with isVisibleForUser().

Bug: 206019156
Test: m
Change-Id: I576430680620363f4fbe49787035bd52445b3554
Merged-In: I576430680620363f4fbe49787035bd52445b3554
2021-11-25 13:04:34 +09:00
Treehugger Robot
c2566e6582 Merge "Create StatsBootstrapAtomService" am: e9f913aee8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1885469

Change-Id: I9fe270fa5bffb2edd912ba59fbc6c002497e76b4
2021-11-18 23:48:16 +00:00
Treehugger Robot
e9f913aee8 Merge "Create StatsBootstrapAtomService" 2021-11-18 23:25:21 +00:00
Tej Singh
da79f2a110 Create StatsBootstrapAtomService
Design doc is at go/statsd-bootstrap-logging. Creates a proxy service for
logging atoms from bootstrap processes to statsd. Service has one API,
which converts StatsBootstrapAtom into StatsEvent and logs to statsd.
This should only used by processes that start in the bootstrap namespace
and cannot directly link statsd's libraries to log to statsd.

Bug: 204889815
Test: booted, made sure binder service was published.
Change-Id: I09709a30a42a7a398234c995324f62a0d62ad24f
2021-11-18 13:27:21 -08:00
Xin Li
10d9972786 Merge sc-qpr1-dev-plus-aosp-without-vendor@7810918
Bug: 205056467
Merged-In: I13199bc39e9445929195f3d15579cbffe94e92b0
Change-Id: I35fa3c6c2abf679c51033f1395a08d511ed8739f
2021-11-18 17:00:37 +00:00
Bernardo Rufino
9f8b914c9f Merge "Deprecate unsafe parcel APIs" 2021-11-17 09:43:11 +00:00
Yifan Hong
6a2929d6ce Add ServiceManager.registerForNotifications
Add the API to call into IServiceManager.registerForNotifications.

Test: pass
Change-Id: Ia74d8a1bd5be767a076560bf8ee4af3095b4623a
2021-11-12 19:36:52 -08:00
Bernardo Rufino
36cf3994ed Deprecate unsafe parcel APIs
Deprecate unsafe parcel APIs and point to the safer ones that take the
expected type as parameter. Where applicable also mention the typed ones
that take the creator as argument since those are also more performant.

APIs deprecated here are:
* readMap(Map, ClassLoader)
* readList(List, ClassLoader)
* readHashMap(ClassLoader)
* readArrayList(ClassLoader)
* readArray(ClassLoader)
* readSparseArray(ClassLoader)
* readParcelable(ClassLoader)
* readParcelableCreator(ClassLoader)
* readSerializable()

Test: Builds
Bug: 195622897
Bug: 199275680
Bug: 205985058
Change-Id: Ic41ae13e0d965b1fd346985c77c1eecc605285b2
2021-11-12 17:56:53 +00:00