Commit Graph

111071 Commits

Author SHA1 Message Date
Sarah Chin
e34b1b8735 Merge "Expose requestModemActivityInfo" 2021-09-08 16:12:28 +00:00
Treehugger Robot
42d6f9b7b2 Merge "Fix guide link to bg execution limits" 2021-09-08 06:20:52 +00:00
Steven Moreland
0f2729a96e Merge "Parcel: markForBinder" 2021-09-08 00:29:29 +00:00
Hall Liu
1c8976b843 Expose requestModemActivityInfo
Expose requestModemActivityInfo in TelephonyManager using the Executor +
Consumer pattern, and modify clients to use it.

Test: atest TelephonyManagerTest#testRequestModemActivityInfo
Fixes: 170427831
Change-Id: I7e8134c8058017b888c324a9f85d473fc3cdd8f5
Merged-In: I7e8134c8058017b888c324a9f85d473fc3cdd8f5
2021-09-07 15:30:36 -07:00
Hall Liu
f4fe3ac665 Update and expose ModemActivityInfo
Update ModemActivityInfo to present a nicer API surface and expose it as
a SystemApi. Also change clients in BatteryStats to match the new
surface.

This is part 1. Part 2 will modify the methods in TelephonyManager to
use a more up-to-standards threading model.

Bug: 170427831
Test: atest ModemActivityInfoTest
Change-Id: I762ed949342861c75d94eafce88335e7bd8c9139
Merged-In: I762ed949342861c75d94eafce88335e7bd8c9139
2021-09-07 11:40:55 -07:00
Christopher Tate
7ad31eb3f4 Fix guide link to bg execution limits
Bug: 157788333
Test: m offline-sdk-docs
Change-Id: I9258aeaa549b63960669d4bed9ea8fb03392146b
2021-09-07 11:36:20 -07:00
Bernardo Rufino
6ae29f70d7 Merge "Don't throw for LazyValue in Parcel.hasFileDescriptors()" 2021-09-06 10:12:59 +00:00
Bernardo Rufino
c087f62482 Don't throw for LazyValue in Parcel.hasFileDescriptors()
In aosp/1819733 we extracted Parcel.hasFileDescriptor() for types
produced by Parcel.writeValue() and consumed by Parcel.readValue() out
of Bundle into Parcel. It's supposed to handle LazyValue too.

However, we put a check to verify that it was a type supported by
readValue()/writeValue() by retrieving the VAL_XXX type of the value via
Parcel.getValueType(), however, that method throws for LazyValue since
we don't actually write that special type on the wire. However, we still
want Parcel.hasFileDescriptor() to support it, so moving the check into
a last 'else' statement, making sure we don't throw in case the value is
a LazyValue.

Bug: 195622897
Bug: 198433827
Test: atest CtsNetTestCases android.net.cts.CaptivePortalTest#testCaptivePortalIsNotDefaultNetwork
Change-Id: I1e6ec122557c12e74db6890e1631fec3cefe31f6
2021-09-06 08:51:21 +01:00
Jakub Pawlowski
fe2fd0e0ad Merge "le_audio: Introduce connection state handling for LE Audio group" 2021-09-03 20:03:15 +00:00
Steven Moreland
580ab91411 Parcel: markForBinder
Allow Parcel data to be dependent on the binder in question. This
exposes the API in Java which is previously only available in native.

There are two main usecases for this:
- provide an alternative route to implement features like markSensitive
  (which requires only 1 function call per class, rather than a
  function call and flag per transaction type)
- support RPC format transactions

Bug: 175814583
Test: atest android.os.ParcelTest, boot, manual
Change-Id: I134b6e23da83699195a8f075b9f50b6409ecff86
2021-09-03 11:50:58 -07:00
Michael Groover
1e5f1a293a Merge "Update APK sig scheme verification OWNERS" 2021-09-03 17:07:40 +00:00
Grzegorz Kołodziejczyk
46aba35609 le_audio: Introduce connection state handling for LE Audio group
Patch implements connection state handling for LE Audio device group.

Tag: #feature
Test: Set LE audio device as active
Sponsor: jpawlowski@
Bug: 150670922
Merged-In: I11222ca07e265ac8b6dc3c21650874ebeffa473c
Change-Id: I11222ca07e265ac8b6dc3c21650874ebeffa473c
2021-09-03 11:58:32 +00:00
Michael Groover
9688bab011 Update APK sig scheme verification OWNERS
Bug: 198670656
Test: Builds
Change-Id: I2dd8de24baf29759a9000213650e4de49d2bb521
2021-09-02 13:20:14 -07:00
Jooyung Han
01da4566ee Merge "Revert "AIDL: use typed Map"" 2021-09-01 00:20:02 +00:00
Bernardo Rufino
93b4b55ee7 Merge "Lazy bundle" 2021-08-31 09:18:47 +00:00
Treehugger Robot
c2cbf5d420 Merge "devicepolicy: use typed List<String> in AIDL" 2021-08-31 09:16:30 +00:00
Jooyung Han
f306e46365 Revert "AIDL: use typed Map"
This reverts commit 553c027bbf.

Reason for revert: b/197550396

Change-Id: I3c59d132985a3d21a11b55ba1546ed9f46f6e474
2021-08-31 00:49:37 +00:00
Jakub Pawlowski
54beaf2012 Merge "csip: Add constants for the Coordinated Set Identification Profile" 2021-08-30 20:56:25 +00:00
Bernardo Rufino
9ca6a5e21a Lazy bundle
Implement lazy deserialization for custom types in bundle:
* Parcelable (VAL_PARCELABLE)
* Serializable (VAL_SERIALIZABLE)
* Parcelable array (VAL_PARCELABLEARRAY)
* Lists (VAL_LIST)
* Sparse array (VAL_SPARSEARRAY)
* Bundle (VAL_BUNDLE)

This enhances security, makes bundles more robust to deserialization
errors and avoid deserializing unneeded objects in some cases*, for more
details check go/lazy-bundle.

To do that, we prefix those types with their length when writing them on
the wire. Map serialization and deserialization now happens inside
Bundle (instead of calling Parcel's readArrayMapInternal() /
writeArrayMapInternal()) and we use an intermediary object - LazyValue -
that holds information about the position and length of the value we
will deserialize when queried.

So, there are basically 3 states:

1. We received the bundle but haven't queried anything about it (not
   even isEmpty()): in this case the original parcel is held inside and
   we haven't attempted any deserialization (except for the metadata at
   the beginning such as the magic, etc)

2. We queried something on it (eg. isEmpty()): Now we deserialize the
   bundle skipping the custom values above (we're able to do this now
   with the length written on the wire) and instead placing LazyValue
   objects for them in the map.

3. We query one of the lazy values: Now, we deserialize the object
   represented by LazyValue and replace it on the map.

Since after (2) LazyValue objects are the only ones holding references
to the original Parcel, when all LazyValues are deserialized, the
original Parcel is available for GC.

Inside bundle now we differentiate between unparcel(itemwise = true) and
unparcel(itemwise = false) where the first also deserializes each item
(such that there are no LazyValues in the map). This is because some
operations such as kindofEquals() need all items deserialized.

I had to break a few methods in parcel into multiple methods in parcel
to be able to control the format in bundle. They are all @hide.

* In quick local experiments, counting the bytes that didn't need to be
deserialized after the change. Roughly 10% of bytes from custom-type
items in Bundle are not deserialized in the testing scenario (if I
haven't messed up the stats :). That's on a sdk_gphone_x86_64_arm64 a
few minutes after boot. Check
https://screenshot.googleplex.com/53uXrrqDMYahzg3, stats collection is
on ag/15403076.

Test: atest -d android.os.cts.ParcelTest android.os.cts.BundleTest android.os.BundleTest android.os.ParcelTest
Test: Boot device
Bug: 195622897
Change-Id: Icfe8880cad00c3cd2afcbe4b92400ad4579e680e
2021-08-27 14:53:24 +01:00
Treehugger Robot
2c0b1b672e Merge "Correct comments" 2021-08-25 07:04:22 +00:00
Łukasz Rymanowski
c1b80e05e8 csip: Add constants for the Coordinated Set Identification Profile
Bug: 150670922
Tag: #feature
Test: compilation
Sponsor: jpawlowski@
Change-Id: I331fe270b75f306d57a15933ab4afa2e48c8bf50
2021-08-24 08:35:01 +00:00
Treehugger Robot
497e28ecf3 Merge "OverlayManager: use typed collection type in AIDL" 2021-08-24 01:47:11 +00:00
Jooyung Han
4d9fc0aea9 devicepolicy: use typed List<String> in AIDL
Bug: 192615532
Test: m
Merged-In: I0ea1c35f7ce4dd6f6bde02874e02ed190fa2e904
Change-Id: I0ea1c35f7ce4dd6f6bde02874e02ed190fa2e904
2021-08-24 09:11:54 +09:00
Treehugger Robot
0ce930a02e Merge "ServiceManager APIs for Wi-Fi mainline module" 2021-08-23 19:25:20 +00:00
Treehugger Robot
95d77312a9 Merge "Add a system api to fetch uuids by the specific transport" 2021-08-23 19:23:26 +00:00
Makoto Onuki
f4d7116b49 Merge "Change Shallow Copy to Deep Copy in UsageStats" 2021-08-23 19:17:38 +00:00
Steven Moreland
ce81994f5f ServiceManager APIs for Wi-Fi mainline module
ServiceManager.waitForDeclaredService and .isDeclared needed for Wi-Fi mainline module.

Test: boot
Change-Id: I9e82dd1a6663396f1c79bc3f27c36711b0b6f3eb
2021-08-20 22:21:35 +00:00
Keun young Park
39c4f40746 Add SharedMemory.fromFileDescriptor
- Rename existing SharedMemory.create and make it public
- Passed file is now detached after creating shared memory and is
  not usable any more.

Bug: 188780895
CTS-Coverage-Bug: 197226773
Test: atest com.android.car.internal.test.LargeParcelableJavaStableAIDLTest
      (runs only in auto. will add matching CTS tests for non-auto devices)

(This combines two CL in internal tree, so Change-Id and Merged-In id are
different)
Change-Id: I8a634062d10ff0c114f3add1d2a5e8056f17b788
Merged-In: I11381e78580b97982b25a52aa06f2192def7353f
2021-08-20 01:18:11 +00:00
Alice Kuo
ee29136541 Add a system api to fetch uuids by the specific transport
The functionality is similar with fetchUuidsWithSdp which uses TRANSPORT_AUTO. Bt stack depends on the devie type and address type to do sdp or gatt service discovery. Add an api to specific the transport. It would be fexible to handle the dual mode device.

Tag: #feature
Bug: 197195548
Test: atest BluetoothInstrumentationTests
Test: Take two headphone to test the dual mode behavior
Change-Id: I32c8dde68969e0bdc42e4e898c43a4f2c1d3379a
Merged-In: I32c8dde68969e0bdc42e4e898c43a4f2c1d3379a
2021-08-19 15:29:32 +00:00
Jooyung Han
8ed699e610 OverlayManager: use typed collection type in AIDL
Use Map<K,V> and List<V>.

Bug: 192615532
Test: m
Change-Id: I5ad7f67b4b08b646362a58214c3b62cd1ada28c0
2021-08-19 15:56:48 +09:00
Jooyung Han
54a1fd2e0f tuner: use typed Map<String, String>
Bug: 192615532
Test: m
Change-Id: Ifa4c9c56d642e1047397cc185872f76a5970f944
2021-08-19 15:29:23 +09:00
Treehugger Robot
6e3ea69863 Merge "Update OWNERS for Intent* and Content*" 2021-08-17 23:14:07 +00:00
Makoto Onuki
ea8407635c Update OWNERS for Intent* and Content*
Test: Build
Change-Id: I2232342d3e68cc8e1eea14bfa999f32b15ba5789
2021-08-17 14:27:35 -07:00
Treehugger Robot
dee731ad0b Merge "Suppress AIDL warnings: untyped-collection" 2021-08-17 11:46:23 +00:00
zhuyunyi
afcd22acaa Change Shallow Copy to Deep Copy in UsageStats
There are three reference type members in UsageStats's constructor, when using "new UsageStats(stats)" to copy, it will be a Shallow Copy, which may cause concurrent modify problem.

For example, in UserUsageStatsService.java, the sUsageStatsCombiner is using "new UsageStats(stats.packageStats.valueAt(i)" to copy, and the value is passing to the computeCacheQuotaHints in
CacheQuotaStrategy.java. If we change the UsageStats.mForegroundServices at the same time, IndexOutOfBounds Exception will happen.

Therefore, it is necessary to modify the way of copying of the UsageStats.

Signed-off-by: zhuyunyi <zhuyunyi@xiaomi.com>
Change-Id: I58a54d17aad6ef5213e52658ee3387f3069339af
2021-08-17 14:10:39 +08:00
Treehugger Robot
bfc5088c1d Merge "Update OWNERS." 2021-08-17 03:57:07 +00:00
Joe Bolinger
2fc9e3fa0a Update OWNERS.
Test: N/A
Change-Id: I3da6e85dd944ca19ecfabfacb2e6928500ee0c49
2021-08-16 17:11:15 -07:00
Jooyung Han
553c027bbf AIDL: use typed Map
AIDL supports typed maps, so use it instead of untyped one.

Bug: 192615532
Test: m, TH presubmit
Change-Id: I0fedf05872cbe2025e04ca07ce6c90bc9067b331
2021-08-12 08:38:10 +00:00
Jooyung Han
fb8ebe9f44 Suppress AIDL warnings: untyped-collection
For now AIDL doesn't support Map<String,Integer>, there's no way to fix
it with typed map.

Bug: 192615532
Test: m
Change-Id: Id0011372a0997b4ab9aa700a7c4f8746bff29189
2021-08-12 17:30:32 +09:00
Suren Baghdasaryan
9a740a18df Adding native flag namespace for lmkd.
For experiment flag testing, adding lmkd flag in DeviceConfig.

Bug: 194316048
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I1f13d6bbb4a9a7fd8825d7e5acde416750271df4
Merged-In: I1f13d6bbb4a9a7fd8825d7e5acde416750271df4
2021-08-11 17:41:41 +00:00
Steven Moreland
b801a513d1 Merge "ServiceManager: waitForService uses allowBlocking" 2021-08-11 17:16:42 +00:00
Steven Moreland
d247e417a2 ServiceManager: waitForService uses allowBlocking
For parity with getService and checkService.

Bug: 194806512
Test: boot
Change-Id: Iecc3f1c6d6ae9bee94252281b416d62f3bf30afd
2021-08-11 17:16:32 +00:00
Treehugger Robot
cf2ef57519 Merge "Require calls to BluetoothA2dp#setBufferLengthMillis to pass a non-negative value" 2021-08-11 04:44:53 +00:00
Rahul Sabnis
465f489430 Require calls to BluetoothA2dp#setBufferLengthMillis to pass a
non-negative value

Tag: #feature
Bug: 194837771
Test: Manual
Merged-In: I3c1d2da1d28a494d8b393c4502521b3f0699adf6
Change-Id: I3c1d2da1d28a494d8b393c4502521b3f0699adf6
2021-08-10 13:57:57 -07:00
Treehugger Robot
6efa908b95 Merge "AdbService sends callback on adb debugging enabled / disabled." 2021-08-10 04:03:11 +00:00
Treehugger Robot
e9e1f5afa7 Merge "IAdbManager.getPairDevices returns FingerprintAndPairDevice[]." 2021-08-10 02:54:06 +00:00
Treehugger Robot
afce05e2e5 Merge changes Icabed06e,I25bc13c6
* changes:
  Bluetooth: Add Media Control Profile
  Bluetooth: Add GATT_INSUFFICIENT_AUTHORIZATION error code
2021-08-10 02:14:33 +00:00
Jakub Tyszkowski
723fe23ce8 Bluetooth: Add Media Control Profile
Tag: #feature
Bug: 150670922
Sponsor: jpawlowski@
Test: compilation
Change-Id: Icabed06e6b1973ecee9cd1d6eeec80c6d2a9d72e
2021-08-09 15:37:52 +00:00
Jakub Tyszkowski
c74aebb4db Bluetooth: Add GATT_INSUFFICIENT_AUTHORIZATION error code
Bug: 150670922
Sponsor: jpawlowski@
Tag: #feature
Test: compilation
Change-Id: I25bc13c658caba48cc37b0f1f253a77fd1336b29
2021-08-09 15:34:22 +00:00
Tom Cherry
92889d10fe Merge "DropBoxManager: use BufferedInputStream when using GZIPInputStream" 2021-08-05 21:56:02 +00:00