| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.service.controls.actions; |
| 18 |
|
| 19 |
import android.annotation.NonNull; |
| 20 |
import android.os.Parcel; |
| 21 |
import android.os.Parcelable; |
| 22 |
|
| 23 |
import com.android.internal.util.Preconditions; |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
public final class ControlActionWrapper implements Parcelable { |
| 30 |
|
| 31 |
private final @NonNull ControlAction mControlAction; |
| 32 |
|
| 33 |
public ControlActionWrapper(@NonNull ControlAction controlAction) { |
| 34 |
Preconditions.checkNotNull(controlAction); |
| 35 |
|
| 36 |
mControlAction = controlAction; |
| 37 |
} |
| 38 |
|
| 39 |
@Override |
| 40 |
public void writeToParcel(@NonNull Parcel dest, int flags) { |
| 41 |
dest.writeBundle(mControlAction.getDataBundle()); |
| 42 |
} |
| 43 |
|
| 44 |
@NonNull |
| 45 |
public ControlAction getWrappedAction() { |
| 46 |
return mControlAction; |
| 47 |
} |
| 48 |
|
| 49 |
@Override |
| 50 |
public int describeContents() { |
| 51 |
return 0; |
| 52 |
} |
| 53 |
|
| 54 |
public static final @NonNull Creator<ControlActionWrapper> CREATOR = |
| 55 |
new Creator<ControlActionWrapper>() { |
| 56 |
@Override |
| 57 |
public ControlActionWrapper createFromParcel(@NonNull Parcel in) { |
| 58 |
return new ControlActionWrapper( |
| 59 |
ControlAction.createActionFromBundle(in.readBundle())); |
| 60 |
} |
| 61 |
|
| 62 |
@Override |
| 63 |
public ControlActionWrapper[] newArray(int size) { |
| 64 |
return new ControlActionWrapper[size]; |
| 65 |
} |
| 66 |
}; |
| 67 |
} |