| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.view; |
| 18 |
|
| 19 |
import android.app.ActivityOptions; |
| 20 |
import android.app.IApplicationThread; |
| 21 |
import android.compat.annotation.UnsupportedAppUsage; |
| 22 |
import android.os.Build; |
| 23 |
import android.os.Parcel; |
| 24 |
import android.os.Parcelable; |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
public class RemoteAnimationAdapter implements Parcelable { |
| 52 |
|
| 53 |
private final IRemoteAnimationRunner mRunner; |
| 54 |
private final long mDuration; |
| 55 |
private final long mStatusBarTransitionDelay; |
| 56 |
private final boolean mChangeNeedsSnapshot; |
| 57 |
|
| 58 |
|
| 59 |
private int mCallingPid; |
| 60 |
private int mCallingUid; |
| 61 |
|
| 62 |
|
| 63 |
private IApplicationThread mCallingApplication; |
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) |
| 74 |
public RemoteAnimationAdapter(IRemoteAnimationRunner runner, long duration, |
| 75 |
long statusBarTransitionDelay, boolean changeNeedsSnapshot) { |
| 76 |
mRunner = runner; |
| 77 |
mDuration = duration; |
| 78 |
mChangeNeedsSnapshot = changeNeedsSnapshot; |
| 79 |
mStatusBarTransitionDelay = statusBarTransitionDelay; |
| 80 |
} |
| 81 |
|
| 82 |
@UnsupportedAppUsage |
| 83 |
public RemoteAnimationAdapter(IRemoteAnimationRunner runner, long duration, |
| 84 |
long statusBarTransitionDelay) { |
| 85 |
this(runner, duration, statusBarTransitionDelay, false ); |
| 86 |
} |
| 87 |
|
| 88 |
@UnsupportedAppUsage |
| 89 |
public RemoteAnimationAdapter(IRemoteAnimationRunner runner, long duration, |
| 90 |
long statusBarTransitionDelay, IApplicationThread callingApplication) { |
| 91 |
this(runner, duration, statusBarTransitionDelay, false ); |
| 92 |
mCallingApplication = callingApplication; |
| 93 |
} |
| 94 |
|
| 95 |
public RemoteAnimationAdapter(Parcel in) { |
| 96 |
mRunner = IRemoteAnimationRunner.Stub.asInterface(in.readStrongBinder()); |
| 97 |
mDuration = in.readLong(); |
| 98 |
mStatusBarTransitionDelay = in.readLong(); |
| 99 |
mChangeNeedsSnapshot = in.readBoolean(); |
| 100 |
mCallingApplication = IApplicationThread.Stub.asInterface(in.readStrongBinder()); |
| 101 |
} |
| 102 |
|
| 103 |
public IRemoteAnimationRunner getRunner() { |
| 104 |
return mRunner; |
| 105 |
} |
| 106 |
|
| 107 |
public long getDuration() { |
| 108 |
return mDuration; |
| 109 |
} |
| 110 |
|
| 111 |
public long getStatusBarTransitionDelay() { |
| 112 |
return mStatusBarTransitionDelay; |
| 113 |
} |
| 114 |
|
| 115 |
public boolean getChangeNeedsSnapshot() { |
| 116 |
return mChangeNeedsSnapshot; |
| 117 |
} |
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
public void setCallingPidUid(int pid, int uid) { |
| 123 |
mCallingPid = pid; |
| 124 |
mCallingUid = uid; |
| 125 |
} |
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
public int getCallingPid() { |
| 131 |
return mCallingPid; |
| 132 |
} |
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
public int getCallingUid() { |
| 138 |
return mCallingUid; |
| 139 |
} |
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
public IApplicationThread getCallingApplication() { |
| 147 |
return mCallingApplication; |
| 148 |
} |
| 149 |
|
| 150 |
@Override |
| 151 |
public int describeContents() { |
| 152 |
return 0; |
| 153 |
} |
| 154 |
|
| 155 |
@Override |
| 156 |
public void writeToParcel(Parcel dest, int flags) { |
| 157 |
dest.writeStrongInterface(mRunner); |
| 158 |
dest.writeLong(mDuration); |
| 159 |
dest.writeLong(mStatusBarTransitionDelay); |
| 160 |
dest.writeBoolean(mChangeNeedsSnapshot); |
| 161 |
dest.writeStrongInterface(mCallingApplication); |
| 162 |
} |
| 163 |
|
| 164 |
public static final @android.annotation.NonNull Creator<RemoteAnimationAdapter> CREATOR |
| 165 |
= new Creator<RemoteAnimationAdapter>() { |
| 166 |
public RemoteAnimationAdapter createFromParcel(Parcel in) { |
| 167 |
return new RemoteAnimationAdapter(in); |
| 168 |
} |
| 169 |
|
| 170 |
public RemoteAnimationAdapter[] newArray(int size) { |
| 171 |
return new RemoteAnimationAdapter[size]; |
| 172 |
} |
| 173 |
}; |
| 174 |
} |