Reset binder during unbinding

On some rare case, we may encounter a DeadObjectException on wrap()
when a new test app is installed. This happens because we reuse the
binder from the previous bindToService() call. Always reset the
binder to make sure this doesn't happen.

Bug: 172780686
Test: run storeRebootEscrowKey twice

Change-Id: I36150ef39f870e38a5f1b4bd814465d70f8dbf85
This commit is contained in:
Tianjie
2021-02-08 15:43:06 -08:00
committed by Tianjie Xu
parent 073c6fa957
commit dc2b792589

View File

@@ -120,6 +120,7 @@ public class ResumeOnRebootServiceProvider {
if (mServiceConnection != null) {
mContext.unbindService(mServiceConnection);
}
mBinder = null;
}
/** Bind to the service */