| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.app.servertransaction; |
| 18 |
|
| 19 |
import android.annotation.NonNull; |
| 20 |
import android.annotation.Nullable; |
| 21 |
import android.app.ActivityThread; |
| 22 |
import android.app.ClientTransactionHandler; |
| 23 |
import android.os.Parcel; |
| 24 |
import android.view.SurfaceControl; |
| 25 |
import android.window.SplashScreenView.SplashScreenViewParcelable; |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
public class TransferSplashScreenViewStateItem extends ActivityTransactionItem { |
| 32 |
|
| 33 |
private SplashScreenViewParcelable mSplashScreenViewParcelable; |
| 34 |
private SurfaceControl mStartingWindowLeash; |
| 35 |
|
| 36 |
@Override |
| 37 |
public void execute(@NonNull ClientTransactionHandler client, |
| 38 |
@NonNull ActivityThread.ActivityClientRecord r, |
| 39 |
PendingTransactionActions pendingActions) { |
| 40 |
client.handleAttachSplashScreenView(r, mSplashScreenViewParcelable, mStartingWindowLeash); |
| 41 |
} |
| 42 |
|
| 43 |
@Override |
| 44 |
public void recycle() { |
| 45 |
ObjectPool.recycle(this); |
| 46 |
} |
| 47 |
|
| 48 |
@Override |
| 49 |
public void writeToParcel(Parcel dest, int flags) { |
| 50 |
dest.writeTypedObject(mSplashScreenViewParcelable, flags); |
| 51 |
dest.writeTypedObject(mStartingWindowLeash, flags); |
| 52 |
} |
| 53 |
|
| 54 |
private TransferSplashScreenViewStateItem() {} |
| 55 |
private TransferSplashScreenViewStateItem(Parcel in) { |
| 56 |
mSplashScreenViewParcelable = in.readTypedObject(SplashScreenViewParcelable.CREATOR); |
| 57 |
mStartingWindowLeash = in.readTypedObject(SurfaceControl.CREATOR); |
| 58 |
} |
| 59 |
|
| 60 |
|
| 61 |
public static TransferSplashScreenViewStateItem obtain( |
| 62 |
@Nullable SplashScreenViewParcelable parcelable, |
| 63 |
@Nullable SurfaceControl startingWindowLeash) { |
| 64 |
TransferSplashScreenViewStateItem instance = |
| 65 |
ObjectPool.obtain(TransferSplashScreenViewStateItem.class); |
| 66 |
if (instance == null) { |
| 67 |
instance = new TransferSplashScreenViewStateItem(); |
| 68 |
} |
| 69 |
instance.mSplashScreenViewParcelable = parcelable; |
| 70 |
instance.mStartingWindowLeash = startingWindowLeash; |
| 71 |
|
| 72 |
return instance; |
| 73 |
} |
| 74 |
|
| 75 |
public static final @NonNull Creator<TransferSplashScreenViewStateItem> CREATOR = |
| 76 |
new Creator<TransferSplashScreenViewStateItem>() { |
| 77 |
public TransferSplashScreenViewStateItem createFromParcel(Parcel in) { |
| 78 |
return new TransferSplashScreenViewStateItem(in); |
| 79 |
} |
| 80 |
|
| 81 |
public TransferSplashScreenViewStateItem[] newArray(int size) { |
| 82 |
return new TransferSplashScreenViewStateItem[size]; |
| 83 |
} |
| 84 |
}; |
| 85 |
} |