use of com.lody.virtual.client.IVClient in project VirtualApp by asLody.
the class VActivityManagerService method attachClient.
private void attachClient(int pid, final IBinder clientBinder) {
final IVClient client = IVClient.Stub.asInterface(clientBinder);
if (client == null) {
killProcess(pid);
return;
}
IInterface thread = null;
try {
thread = ApplicationThreadNative.asInterface.call(client.getAppThread());
} catch (RemoteException e) {
// process has dead
}
if (thread == null) {
killProcess(pid);
return;
}
ProcessRecord app = null;
try {
IBinder token = client.getToken();
if (token instanceof ProcessRecord) {
app = (ProcessRecord) token;
}
} catch (RemoteException e) {
// process has dead
}
if (app == null) {
killProcess(pid);
return;
}
try {
final ProcessRecord record = app;
clientBinder.linkToDeath(new DeathRecipient() {
@Override
public void binderDied() {
clientBinder.unlinkToDeath(this, 0);
onProcessDead(record);
}
}, 0);
} catch (RemoteException e) {
e.printStackTrace();
}
app.client = client;
app.appThread = thread;
app.pid = pid;
synchronized (mProcessNames) {
mProcessNames.put(app.processName, app.vuid, app);
mPidsSelfLocked.put(app.pid, app);
}
}
Aggregations