-
-
Save makzimi/1a8ae70162010b2d6e09ff8a732dc3d9 to your computer and use it in GitHub Desktop.
TransactionTooLargeException_article_ActivityManagerNative.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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