Reputation: 37
While tracing the install procedure on AOSP I came across these lines and I am unable to understand what they do. (I am not a complete novice in java programming, neither am I a fully professional java developer)
@Override public void installPackage(java.lang.String originPath, android.content.pm.IPackageInstallObserver2 observer, int flags, java.lang.String installerPackageName, android.content.pm.VerificationParams verificationParams, java.lang.String packageAbiOverride) throws android.os.RemoteException
{
android.os.Parcel _data = android.os.Parcel.obtain();
android.os.Parcel _reply = android.os.Parcel.obtain();
try {
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeString(originPath);
_data.writeStrongBinder((((observer!=null))?(observer.asBinder()):(null)));
_data.writeInt(flags);
_data.writeString(installerPackageName);
if ((verificationParams!=null)) {
_data.writeInt(1);
verificationParams.writeToParcel(_data, 0);
}
else {
_data.writeInt(0);
}
_data.writeString(packageAbiOverride);
mRemote.transact(Stub.TRANSACTION_installPackage, _data, _reply, 0);
_reply.readException();
}
finally {
_reply.recycle();
_data.recycle();
}
}
In this code above what do the lines inside the try block work? Especially what does the line _data.writeStrongBinder... do? Any pointers to help understand this code is appreciated!
Upvotes: 0
Views: 118
Reputation: 803
_data is an Parcel object. You can look at the API documentation here
ps.: You could install Codota. I actually can click at your code and see the documentation. So you kinda answered your own question already ;)
Upvotes: 1