@ -87,7 +87,7 @@ public class PassphraseRequiredMixin {
}
}
private void removeServiceConnection ( Context context ) {
private void removeServiceConnection ( Context context ) {
if ( this . serviceConnection ! = null & & this . serviceConnection . isBound ( ) ) {
if ( this . serviceConnection ! = null ) {
context . unbindService ( this . serviceConnection ) ;
context . unbindService ( this . serviceConnection ) ;
}
}
}
}
@ -95,18 +95,14 @@ public class PassphraseRequiredMixin {
private static class KeyCachingServiceConnection implements ServiceConnection {
private static class KeyCachingServiceConnection implements ServiceConnection {
private final PassphraseRequiredActivity activity ;
private final PassphraseRequiredActivity activity ;
private boolean isBound ;
public KeyCachingServiceConnection ( PassphraseRequiredActivity activity ) {
public KeyCachingServiceConnection ( PassphraseRequiredActivity activity ) {
this . activity = activity ;
this . activity = activity ;
this . isBound = false ;
}
}
@Override
@Override
public void onServiceConnected ( ComponentName name , IBinder service ) {
public void onServiceConnected ( ComponentName name , IBinder service ) {
KeyCachingService keyCachingService = ( ( KeyCachingService . KeyCachingBinder ) service ) . getService ( ) ;
KeyCachingService keyCachingService = ( ( KeyCachingService . KeyCachingBinder ) service ) . getService ( ) ;
MasterSecret masterSecret = keyCachingService . getMasterSecret ( ) ;
MasterSecret masterSecret = keyCachingService . getMasterSecret ( ) ;
this . isBound = true ;
if ( masterSecret = = null ) {
if ( masterSecret = = null ) {
activity . onMasterSecretCleared ( ) ;
activity . onMasterSecretCleared ( ) ;
@ -117,12 +113,8 @@ public class PassphraseRequiredMixin {
@Override
@Override
public void onServiceDisconnected ( ComponentName name ) {
public void onServiceDisconnected ( ComponentName name ) {
this . isBound = false ;
}
}
public boolean isBound ( ) {
return this . isBound ;
}
}
}
}
}