Loading core/java/com/android/internal/infra/ServiceConnector.java +3 −3 Original line number Diff line number Diff line Loading @@ -246,7 +246,7 @@ public interface ServiceConnector<I extends IInterface> { implements ServiceConnector<I>, ServiceConnection, IBinder.DeathRecipient, Runnable { static final boolean DEBUG = false; static final String LOG_TAG = "ServiceConnector.Impl"; final String LOG_TAG = this.getClass().getSimpleName(); private static final long DEFAULT_DISCONNECT_TIMEOUT_MS = 15_000; private static final long DEFAULT_REQUEST_TIMEOUT_MS = 30_000; Loading Loading @@ -468,7 +468,7 @@ public interface ServiceConnector<I extends IInterface> { } } private void cancelTimeout() { protected void cancelTimeout() { if (DEBUG) { logTrace(); } Loading Loading @@ -662,7 +662,7 @@ public interface ServiceConnector<I extends IInterface> { dispatchOnBinderDied(); } private void dispatchOnBinderDied() { protected void dispatchOnBinderDied() { ServiceLifecycleCallbacks<I> serviceLifecycleCallbacks = mServiceLifecycleCallbacks; if (serviceLifecycleCallbacks != null) { serviceLifecycleCallbacks.onBinderDied(); Loading packages/NeuralNetworks/service/platform/java/com/android/server/ondeviceintelligence/RemoteOnDeviceIntelligenceService.java +18 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.server.ondeviceintelligence; import static android.content.Context.BIND_FOREGROUND_SERVICE; import static android.content.Context.BIND_INCLUDE_CAPABILITIES; import android.annotation.NonNull; import android.content.ComponentName; import android.content.Context; import android.content.Intent; Loading Loading @@ -63,4 +64,21 @@ public class RemoteOnDeviceIntelligenceService extends TimeUnit.SECONDS.toMillis(30), mContext.getUserId()); } @Override public void onBindingDied(@NonNull ComponentName name) { // When the binding dies, unbind to allow the service to be re-bound. unbind(); } @Override public void binderDied() { // When the binder dies, dispatch the event to the clients // and cancel pending jobs. getJobHandler().post(() -> { dispatchOnBinderDied(); cancelTimeout(); cancelPendingJobs(); // TODO:418214801 - Evaluate if this can be removed. }); } } packages/NeuralNetworks/service/platform/java/com/android/server/ondeviceintelligence/RemoteOnDeviceSandboxedInferenceService.java +18 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.server.ondeviceintelligence; import static android.content.Context.BIND_FOREGROUND_SERVICE; import static android.content.Context.BIND_INCLUDE_CAPABILITIES; import android.annotation.NonNull; import android.content.ComponentName; import android.content.Context; import android.content.Intent; Loading Loading @@ -73,4 +74,21 @@ public class RemoteOnDeviceSandboxedInferenceService extends TimeUnit.SECONDS.toMillis(30), mContext.getUserId()); } @Override public void onBindingDied(@NonNull ComponentName name) { // When the binding dies, unbind to allow the service to be re-bound. unbind(); } @Override public void binderDied() { // When the binder dies, dispatch the event to the clients // and cancel pending jobs. getJobHandler().post(() -> { dispatchOnBinderDied(); cancelTimeout(); cancelPendingJobs(); // TODO:418214801 - Evaluate if this can be removed. }); } } Loading
core/java/com/android/internal/infra/ServiceConnector.java +3 −3 Original line number Diff line number Diff line Loading @@ -246,7 +246,7 @@ public interface ServiceConnector<I extends IInterface> { implements ServiceConnector<I>, ServiceConnection, IBinder.DeathRecipient, Runnable { static final boolean DEBUG = false; static final String LOG_TAG = "ServiceConnector.Impl"; final String LOG_TAG = this.getClass().getSimpleName(); private static final long DEFAULT_DISCONNECT_TIMEOUT_MS = 15_000; private static final long DEFAULT_REQUEST_TIMEOUT_MS = 30_000; Loading Loading @@ -468,7 +468,7 @@ public interface ServiceConnector<I extends IInterface> { } } private void cancelTimeout() { protected void cancelTimeout() { if (DEBUG) { logTrace(); } Loading Loading @@ -662,7 +662,7 @@ public interface ServiceConnector<I extends IInterface> { dispatchOnBinderDied(); } private void dispatchOnBinderDied() { protected void dispatchOnBinderDied() { ServiceLifecycleCallbacks<I> serviceLifecycleCallbacks = mServiceLifecycleCallbacks; if (serviceLifecycleCallbacks != null) { serviceLifecycleCallbacks.onBinderDied(); Loading
packages/NeuralNetworks/service/platform/java/com/android/server/ondeviceintelligence/RemoteOnDeviceIntelligenceService.java +18 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.server.ondeviceintelligence; import static android.content.Context.BIND_FOREGROUND_SERVICE; import static android.content.Context.BIND_INCLUDE_CAPABILITIES; import android.annotation.NonNull; import android.content.ComponentName; import android.content.Context; import android.content.Intent; Loading Loading @@ -63,4 +64,21 @@ public class RemoteOnDeviceIntelligenceService extends TimeUnit.SECONDS.toMillis(30), mContext.getUserId()); } @Override public void onBindingDied(@NonNull ComponentName name) { // When the binding dies, unbind to allow the service to be re-bound. unbind(); } @Override public void binderDied() { // When the binder dies, dispatch the event to the clients // and cancel pending jobs. getJobHandler().post(() -> { dispatchOnBinderDied(); cancelTimeout(); cancelPendingJobs(); // TODO:418214801 - Evaluate if this can be removed. }); } }
packages/NeuralNetworks/service/platform/java/com/android/server/ondeviceintelligence/RemoteOnDeviceSandboxedInferenceService.java +18 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.server.ondeviceintelligence; import static android.content.Context.BIND_FOREGROUND_SERVICE; import static android.content.Context.BIND_INCLUDE_CAPABILITIES; import android.annotation.NonNull; import android.content.ComponentName; import android.content.Context; import android.content.Intent; Loading Loading @@ -73,4 +74,21 @@ public class RemoteOnDeviceSandboxedInferenceService extends TimeUnit.SECONDS.toMillis(30), mContext.getUserId()); } @Override public void onBindingDied(@NonNull ComponentName name) { // When the binding dies, unbind to allow the service to be re-bound. unbind(); } @Override public void binderDied() { // When the binder dies, dispatch the event to the clients // and cancel pending jobs. getJobHandler().post(() -> { dispatchOnBinderDied(); cancelTimeout(); cancelPendingJobs(); // TODO:418214801 - Evaluate if this can be removed. }); } }