List of usage examples for android.os IBinder pingBinder
public boolean pingBinder();
From source file:edu.umich.flowfence.service.Sandbox.java
private void unbind() { if (localLOGD) { Log.d(TAG, "unbind: " + this); }//from w ww .j av a 2 s .co m onBeforeDisconnect.fire(this, null); ISandboxService sandbox; synchronized (mSync) { sandbox = mSandboxService; mApplication.unbindService(mConnection); } if (sandbox != null) { handleDisconnected(); } else { return; } synchronized (mSync) { // Ask it to terminate itself. try { IBinder binder = sandbox.asBinder(); sandbox.kill(); if (!binder.isBinderAlive()) { return; } int timeout = DEATH_PING_MAX; while (--timeout >= 0) { if (!binder.pingBinder() || !binder.isBinderAlive()) { return; } SystemClock.sleep(DEATH_PING_INTERVAL); } throw new SecurityException("Sandbox process has not died"); } catch (RemoteException e) { // Object's already dead, or we're getting a spurious TransactionTooLarge. } } }