summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndres Morales <anmorales@google.com>2015-04-17 19:42:59 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-04-17 19:43:00 +0000
commite0a31c8bab34ccf330590cc6768d7e371b767844 (patch)
tree1a1ed9df2873872f8e16c81013c24b4cb70ec6be
parent1dfab471ed50478b4f63552778c949a2f0d37521 (diff)
parent301ea449921663ffe5673fb5751a7185a40bd5ea (diff)
downloadframeworks_base-e0a31c8bab34ccf330590cc6768d7e371b767844.zip
frameworks_base-e0a31c8bab34ccf330590cc6768d7e371b767844.tar.gz
frameworks_base-e0a31c8bab34ccf330590cc6768d7e371b767844.tar.bz2
Merge "Recover from dead GateKeeperService Binder"
-rw-r--r--services/core/java/com/android/server/LockSettingsService.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/LockSettingsService.java b/services/core/java/com/android/server/LockSettingsService.java
index 16689ee..a31a1a7 100644
--- a/services/core/java/com/android/server/LockSettingsService.java
+++ b/services/core/java/com/android/server/LockSettingsService.java
@@ -134,7 +134,11 @@ public class LockSettingsService extends ILockSettings.Stub {
public void systemReady() {
migrateOldData();
- getGateKeeperService();
+ try {
+ getGateKeeperService();
+ } catch (RemoteException e) {
+ Slog.e(TAG, "Failure retrieving IGateKeeperService", e);
+ }
mStorage.prefetchUser(UserHandle.USER_OWNER);
}
@@ -695,7 +699,16 @@ public class LockSettingsService extends ILockSettings.Stub {
return null;
}
- private synchronized IGateKeeperService getGateKeeperService() {
+ private class GateKeeperDiedRecipient implements IBinder.DeathRecipient {
+ @Override
+ public void binderDied() {
+ mGateKeeperService.asBinder().unlinkToDeath(this, 0);
+ mGateKeeperService = null;
+ }
+ }
+
+ private synchronized IGateKeeperService getGateKeeperService()
+ throws RemoteException {
if (mGateKeeperService != null) {
return mGateKeeperService;
}
@@ -703,6 +716,7 @@ public class LockSettingsService extends ILockSettings.Stub {
final IBinder service =
ServiceManager.getService("android.service.gatekeeper.IGateKeeperService");
if (service != null) {
+ service.linkToDeath(new GateKeeperDiedRecipient(), 0);
mGateKeeperService = IGateKeeperService.Stub.asInterface(service);
return mGateKeeperService;
}