diff options
| author | Bernardo Rufino <brufino@google.com> | 2022-01-14 17:35:36 +0000 |
|---|---|---|
| committer | Bernardo Rufino <brufino@google.com> | 2022-01-19 11:13:18 +0000 |
| commit | 2ace102c5ebe0efdc0943e2c3f3419b5aa451e7a (patch) | |
| tree | fca47d83edc1cc4879aa8d508f6a4a2e8af083f4 /framework-t/src/android/net/DataUsageRequest.java | |
| parent | f765d93862231b595915df3edf74ddf0170751a2 (diff) | |
Revert "Revert "Migrate unsafe parcel APIs in framework-minus-apex""
This reverts commit 7fe4f60b74b643507a8ec495bfde43a746994aa6.
Reintroducing ag/16366278 since it seems unrelated to b/214053959 (more details on b/214053959#comment55).
Original commit message:
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
Change-Id: I272432e6e082a973f7a50492ec35d79c2b577c93
Test: TH passes
Diffstat (limited to 'framework-t/src/android/net/DataUsageRequest.java')
| -rw-r--r-- | framework-t/src/android/net/DataUsageRequest.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/framework-t/src/android/net/DataUsageRequest.java b/framework-t/src/android/net/DataUsageRequest.java index b06d515b3a..f0ff46522d 100644 --- a/framework-t/src/android/net/DataUsageRequest.java +++ b/framework-t/src/android/net/DataUsageRequest.java @@ -75,7 +75,7 @@ public final class DataUsageRequest implements Parcelable { @Override public DataUsageRequest createFromParcel(Parcel in) { int requestId = in.readInt(); - NetworkTemplate template = in.readParcelable(null); + NetworkTemplate template = in.readParcelable(null, android.net.NetworkTemplate.class); long thresholdInBytes = in.readLong(); DataUsageRequest result = new DataUsageRequest(requestId, template, thresholdInBytes); |
