Loading services/core/java/com/android/server/DynamicSystemService.java +19 −14 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ public class DynamicSystemService extends IDynamicSystemService.Stub implements private static IGsiService connect(DeathRecipient recipient) throws RemoteException { IBinder binder = ServiceManager.getService("gsiservice"); if (binder == null) { throw new RemoteException(NO_SERVICE_ERROR); return null; } /** * The init will restart gsiservice if it crashed and the proxy object will need to be Loading @@ -75,28 +75,33 @@ public class DynamicSystemService extends IDynamicSystemService.Stub implements private IGsiService getGsiService() throws RemoteException { checkPermission(); if (!"running".equals(SystemProperties.get("init.svc.gsid"))) { SystemProperties.set("ctl.start", "gsid"); for (int sleepMs = 64; sleepMs <= (GSID_ROUGH_TIMEOUT_MS << 1); sleepMs <<= 1) { try { Thread.sleep(sleepMs); } catch (InterruptedException e) { Slog.e(TAG, "Interrupted when waiting for GSID"); break; } if ("running".equals(SystemProperties.get("init.svc.gsid"))) { break; } } } for (int sleepMs = 64; sleepMs <= (GSID_ROUGH_TIMEOUT_MS << 1); sleepMs <<= 1) { synchronized (this) { if (mGsiService == null) { mGsiService = connect(this); } if (mGsiService != null) { return mGsiService; } } try { Slog.d(TAG, "GsiService is not ready, wait for " + sleepMs + "ms"); Thread.sleep(sleepMs); } catch (InterruptedException e) { Slog.e(TAG, "Interrupted when waiting for GSID"); return null; } } throw new RemoteException(NO_SERVICE_ERROR); } private void checkPermission() { if (mContext.checkCallingOrSelfPermission( android.Manifest.permission.MANAGE_DYNAMIC_SYSTEM) Loading Loading
services/core/java/com/android/server/DynamicSystemService.java +19 −14 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ public class DynamicSystemService extends IDynamicSystemService.Stub implements private static IGsiService connect(DeathRecipient recipient) throws RemoteException { IBinder binder = ServiceManager.getService("gsiservice"); if (binder == null) { throw new RemoteException(NO_SERVICE_ERROR); return null; } /** * The init will restart gsiservice if it crashed and the proxy object will need to be Loading @@ -75,28 +75,33 @@ public class DynamicSystemService extends IDynamicSystemService.Stub implements private IGsiService getGsiService() throws RemoteException { checkPermission(); if (!"running".equals(SystemProperties.get("init.svc.gsid"))) { SystemProperties.set("ctl.start", "gsid"); for (int sleepMs = 64; sleepMs <= (GSID_ROUGH_TIMEOUT_MS << 1); sleepMs <<= 1) { try { Thread.sleep(sleepMs); } catch (InterruptedException e) { Slog.e(TAG, "Interrupted when waiting for GSID"); break; } if ("running".equals(SystemProperties.get("init.svc.gsid"))) { break; } } } for (int sleepMs = 64; sleepMs <= (GSID_ROUGH_TIMEOUT_MS << 1); sleepMs <<= 1) { synchronized (this) { if (mGsiService == null) { mGsiService = connect(this); } if (mGsiService != null) { return mGsiService; } } try { Slog.d(TAG, "GsiService is not ready, wait for " + sleepMs + "ms"); Thread.sleep(sleepMs); } catch (InterruptedException e) { Slog.e(TAG, "Interrupted when waiting for GSID"); return null; } } throw new RemoteException(NO_SERVICE_ERROR); } private void checkPermission() { if (mContext.checkCallingOrSelfPermission( android.Manifest.permission.MANAGE_DYNAMIC_SYSTEM) Loading