下面列出了android.os.Parcel#readStrongBinder ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
private void initFromParcel(Parcel parcel) {
type = parcel.readInt();
layer = parcel.readInt();
token = parcel.readStrongBinder();
parentToken = parcel.readStrongBinder();
activityToken = parcel.readStrongBinder();
focused = (parcel.readInt() == 1);
boundsInScreen.readFromParcel(parcel);
title = parcel.readCharSequence();
accessibilityIdOfAnchor = parcel.readLong();
inPictureInPicture = (parcel.readInt() == 1);
final boolean hasChildren = (parcel.readInt() == 1);
if (hasChildren) {
if (childTokens == null) {
childTokens = new ArrayList<IBinder>();
}
parcel.readBinderList(childTokens);
}
}
private JobParameters(Parcel in) {
jobId = in.readInt();
extras = in.readPersistableBundle();
transientExtras = in.readBundle();
if (in.readInt() != 0) {
clipData = ClipData.CREATOR.createFromParcel(in);
clipGrantFlags = in.readInt();
} else {
clipData = null;
clipGrantFlags = 0;
}
callback = in.readStrongBinder();
overrideDeadlineExpired = in.readInt() == 1;
mTriggeredContentUris = in.createTypedArray(Uri.CREATOR);
mTriggeredContentAuthorities = in.createStringArray();
if (in.readInt() != 0) {
network = Network.CREATOR.createFromParcel(in);
} else {
network = null;
}
stopReason = in.readInt();
debugStopReason = in.readString();
}
private ContentProviderHolder(Parcel source) {
info = ProviderInfo.CREATOR.createFromParcel(source);
provider = ContentProviderNative.asInterface(
source.readStrongBinder());
connection = source.readStrongBinder();
noReleaseNeeded = source.readInt() != 0;
}
public Token createFromParcel(Parcel in) {
Object readParcelable;
if (VERSION.SDK_INT >= 21) {
readParcelable = in.readParcelable(null);
} else {
readParcelable = in.readStrongBinder();
}
return new Token(readParcelable);
}
protected PendingResultData(Parcel in) {
this.mType = in.readInt();
this.mOrderedHint = in.readByte() != 0;
this.mInitialStickyHint = in.readByte() != 0;
this.mToken = in.readStrongBinder();
this.mSendingUser = in.readInt();
this.mFlags = in.readInt();
this.mResultCode = in.readInt();
this.mResultData = in.readString();
this.mResultExtras = in.readBundle();
this.mAbortBroadcast = in.readByte() != 0;
this.mFinished = in.readByte() != 0;
}
private ParcelBinder(Parcel source) {
mBinder = source.readStrongBinder();
}
InputBinding(Parcel source) {
mConnection = null;
mConnectionToken = source.readStrongBinder();
mUid = source.readInt();
mPid = source.readInt();
}
public LayoutParams(Parcel in) {
width = in.readInt();
height = in.readInt();
x = in.readInt();
y = in.readInt();
type = in.readInt();
flags = in.readInt();
privateFlags = in.readInt();
softInputMode = in.readInt();
layoutInDisplayCutoutMode = in.readInt();
gravity = in.readInt();
horizontalMargin = in.readFloat();
verticalMargin = in.readFloat();
format = in.readInt();
windowAnimations = in.readInt();
alpha = in.readFloat();
dimAmount = in.readFloat();
screenBrightness = in.readFloat();
buttonBrightness = in.readFloat();
rotationAnimation = in.readInt();
token = in.readStrongBinder();
packageName = in.readString();
mTitle = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
screenOrientation = in.readInt();
preferredRefreshRate = in.readFloat();
preferredDisplayModeId = in.readInt();
systemUiVisibility = in.readInt();
subtreeSystemUiVisibility = in.readInt();
hasSystemUiListeners = in.readInt() != 0;
inputFeatures = in.readInt();
userActivityTimeout = in.readLong();
surfaceInsets.left = in.readInt();
surfaceInsets.top = in.readInt();
surfaceInsets.right = in.readInt();
surfaceInsets.bottom = in.readInt();
hasManualSurfaceInsets = in.readInt() != 0;
preservePreviousSurfaceInsets = in.readInt() != 0;
needsMenuKey = in.readInt();
accessibilityIdOfAnchor = in.readLong();
accessibilityTitle = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
mColorMode = in.readInt();
hideTimeoutMilliseconds = in.readLong();
}
@Nullable @Override public IBinder readFromParcel(@NonNull Parcel source) {
return source.readStrongBinder();
}
protected ParcelableIBinder(Parcel in) {
iBinder = in.readStrongBinder();
}
public PendingCallback(Parcel in) {
binder = in.readStrongBinder();
}
public PendingIntent createFromParcel(Parcel in) {
IBinder target = in.readStrongBinder();
return target != null
? new PendingIntent(target, in.getClassCookie(PendingIntent.class))
: null;
}
@Override
public IBinder nullSafeFromParcel(Parcel parcel) {
return parcel.readStrongBinder();
}
/** @hide */
public AssistStructure(Parcel in) {
mIsHomeActivity = in.readInt() == 1;
mReceiveChannel = in.readStrongBinder();
}
/**
* @hide
*/
private static KeySet readFromParcel(Parcel in) {
IBinder token = in.readStrongBinder();
return new KeySet(token);
}
BinderParcelable(Parcel source) {
mBinder = source.readStrongBinder();
}
/**
* Iterates over the map looking for the {@link #BUNDLE_KEY_CALLBACK} key to try and read the {@link IBinder}
* straight from the parcelled data. This is entirely dependent on the implementation of Parcel, but these specific
* parts of {@link Parcel} / {@link Bundle} haven't changed since 2008 and newer versions of Android will ship
* with newer versions of Google Play services which embed the IBinder directly into the {@link Bundle}
* (no need to deal with the {@link android.os.Parcelable} issues).
*/
GcmIntentParser(Bundle data) throws RuntimeException {
if (data == null) {
throw new IllegalArgumentException();
}
jobId = Integer.valueOf(data.getString(BUNDLE_KEY_TAG));
extras = data.getBundle(BUNDLE_KEY_EXTRAS);
triggeredContentUris = data.getParcelableArrayList(BUNDLE_KEY_TRIGGERED_URIS);
if (triggeredContentUris != null) {
triggeredContentAuthorities = new ArrayList<>();
for (Uri triggeredContentUri : triggeredContentUris) {
triggeredContentAuthorities.add(triggeredContentUri.getAuthority());
}
}
Parcel parcel = toParcel(data);
try {
int numEntries = checkNonEmptyBundleHeader(parcel);
for (int i = 0; i < numEntries; i++) {
String key = null;
if (shouldReadKeysAsStrings()) {
key = parcel.readString();
} else {
Object entryKeyObj = parcel.readValue(getClass().getClassLoader());
if (entryKeyObj instanceof String) {
key = (String) entryKeyObj;
}
}
if (key == null) {
continue;
}
if (BUNDLE_KEY_CALLBACK.equals(key)
&& parcel.readInt() == VAL_PARCELABLE
&& PENDING_CALLBACK_CLASS.equals(parcel.readString())) {
callback = parcel.readStrongBinder();
break;
}
}
} finally {
parcel.recycle();
}
if (extras == null || callback == null) {
throw new IllegalArgumentException();
}
}
@Override
public Acr1251UReader createFromParcel(Parcel in) {
String name = in.readString();
IBinder binder = in.readStrongBinder();
IAcr1251UReaderControl iin = IAcr1251UReaderControl.Stub.asInterface(binder);
return new Acr1251UReader(name, iin);
}
@Override
public Acr1222LReader createFromParcel(Parcel in) {
String name = in.readString();
IBinder binder = in.readStrongBinder();
IAcr1222LReaderControl iin = IAcr1222LReaderControl.Stub.asInterface(binder);
return new Acr1222LReader(name, iin);
}
@Override
public Acr1283LReader createFromParcel(Parcel in) {
String name = in.readString();
IBinder binder = in.readStrongBinder();
IAcr1283LReaderControl iin = IAcr1283LReaderControl.Stub.asInterface(binder);
return new Acr1283LReader(name, iin);
}