Skip to content

Instantly share code, notes, and snippets.

@makzimi
Created November 2, 2022 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save makzimi/1a8ae70162010b2d6e09ff8a732dc3d9 to your computer and use it in GitHub Desktop.
Save makzimi/1a8ae70162010b2d6e09ff8a732dc3d9 to your computer and use it in GitHub Desktop.
TransactionTooLargeException_article_ActivityManagerNative.java
private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() {
protected IActivityManager create() {
IBinder b = ServiceManager.getService("activity");
...
// that is, gDefault is the IActivityManager
IActivityManager am = asInterface(b);
...
return am;
}
};
static public IActivityManager asInterface(IBinder obj) {
...
return new ActivityManagerProxy(obj);
}
class ActivityManagerProxy implements IActivityManager
{
...
public int startActivity(...) throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
// put a lot of things into data
...
// Call transact binder’s method (mRemote - is the IBinder in this case)
mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
reply.readException();
int result = reply.readInt();
reply.recycle();
data.recycle();
return result;
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment