1 /* 2 * Copyright (C) 2022 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.window; 18 19 import android.os.Parcel; 20 import android.os.Parcelable; 21 22 /** 23 * Object that describes how to run a remote back animation. 24 * 25 * @hide 26 */ 27 public class BackAnimationAdaptor implements Parcelable { 28 29 private final IBackAnimationRunner mRunner; 30 @BackNavigationInfo.BackTargetType 31 private final int mSupportType; 32 BackAnimationAdaptor(IBackAnimationRunner runner, int supportType)33 public BackAnimationAdaptor(IBackAnimationRunner runner, int supportType) { 34 mRunner = runner; 35 mSupportType = supportType; 36 } 37 BackAnimationAdaptor(Parcel in)38 public BackAnimationAdaptor(Parcel in) { 39 mRunner = IBackAnimationRunner.Stub.asInterface(in.readStrongBinder()); 40 mSupportType = in.readInt(); 41 } 42 getRunner()43 public IBackAnimationRunner getRunner() { 44 return mRunner; 45 } 46 getSupportType()47 @BackNavigationInfo.BackTargetType public int getSupportType() { 48 return mSupportType; 49 } 50 51 @Override describeContents()52 public int describeContents() { 53 return 0; 54 } 55 56 @Override writeToParcel(Parcel dest, int flags)57 public void writeToParcel(Parcel dest, int flags) { 58 dest.writeStrongInterface(mRunner); 59 dest.writeInt(mSupportType); 60 } 61 62 public static final @android.annotation.NonNull Creator<BackAnimationAdaptor> CREATOR = 63 new Creator<BackAnimationAdaptor>() { 64 public BackAnimationAdaptor createFromParcel(Parcel in) { 65 return new BackAnimationAdaptor(in); 66 } 67 68 public BackAnimationAdaptor[] newArray(int size) { 69 return new BackAnimationAdaptor[size]; 70 } 71 }; 72 } 73