Skip to content
Commit 17c1af43 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Fix a bug in RegisterStatusBarResult parceling

This is a follow up CL to my previous CL [1], which introduced
RegisterStatusBarResult to consolidate return values from
StatusBarManagerService#registerStatusBar().

It turns out that the following fields are not correctly unmarshalled.
 - RegisterStatusBarResult#mFullscreenStackBounds
 - RegisterStatusBarResult#mDockedStackBounds

This is because those two fields were written with
Parcel#writeParcelable() while we were reading them directly with
Rect.CREATOR#createFromParcel().  Parcel#writeParcelable() needs to be
used with Parcel#readParcelable() for null handling and custom
class-loader handling.

With this CL, we now read/write these two fields with the following
methods, which can also be used to write/read Parcelable objects in a
bit more simpler style unless as long as we can rely on the default
class-loader.
 - Parcel#writeTypedObject()
 - Parcel#readTypedObject()

This CL also adds unit tests for StatusBarIcon and
RegisterStatusBarResult to make sure that these classes can be sent
over Parcel.

 [1]: Ib1c0ae8f591ca09d0bce7a39f85ba57aad386e47
      49efa718

Bug: 122439339
Test: atest FrameworksCoreTests:StatusBarIconTest
Test: atest FrameworksCoreTests:RegisterStatusBarResultTest
Change-Id: I0f41cbcb4c2f1222f18e1e34e3cf40bb0dfdfdb3
parent 1ccf640d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment