Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d709ec3d authored by Sandeep Bandaru's avatar Sandeep Bandaru Committed by Android (Google) Code Review
Browse files

Merge "Propagate exceptions during binder calls to ODIMS" into main

parents a68a090c 16814cc6
Loading
Loading
Loading
Loading
+4 −12
Original line number Diff line number Diff line
@@ -60,18 +60,10 @@ public final class InferenceServiceExecutor
            });
            return null;
        }
        if (!manager.ensureRemoteInferenceServiceInitialized(/* shouldThrow= */ false)) {
            Slog.w(OnDeviceIntelligenceManagerService.TAG, "Service not available");
            executeOnRemoteExecutor(() -> {
                try {
                    mFailureConsumer.accept(FailureType.SERVICE_UNAVAILABLE);
                } catch (RemoteException e) {
                    Slog.e(OnDeviceIntelligenceManagerService.TAG,
                            "Failed to call service unavailable callback", e);
                }
            });
            return null;
        }

        // Ensure the remote service is initialized.
        manager.ensureRemoteInferenceServiceInitialized(/* shouldThrow= */ true);

        AndroidFuture<?> future = manager.getRemoteInferenceService().postAsync(remoteCall::run);
        future.whenComplete(
                (res, ex) -> {
+4 −12
Original line number Diff line number Diff line
@@ -60,18 +60,10 @@ public final class IntelligenceServiceExecutor
            });
            return null;
        }
        if (!manager.ensureRemoteIntelligenceServiceInitialized(/* shouldThrow= */ false)) {
            Slog.w(OnDeviceIntelligenceManagerService.TAG, "Service not available");
            executeOnRemoteExecutor(() -> {
                try {
                    mFailureConsumer.accept(FailureType.SERVICE_UNAVAILABLE);
                } catch (RemoteException e) {
                    Slog.e(OnDeviceIntelligenceManagerService.TAG,
                            "Failed to call service unavailable callback", e);
                }
            });
            return null;
        }

        // Ensure the remote service is initialized.
        manager.ensureRemoteIntelligenceServiceInitialized(/* shouldThrow= */ true);

        AndroidFuture<?> future =
                manager.getRemoteOnDeviceIntelligenceService().postAsync(remoteCall::run);
        future.whenComplete(