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

Commit df224430 authored by Rafael Higuera Silva's avatar Rafael Higuera Silva Committed by Android (Google) Code Review
Browse files

Merge "Fix exception crashing euiccService process" into main

parents 4eaf2463 d438cfd6
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -856,10 +856,22 @@ public abstract class EuiccService extends Service {
                int slotId, IGetAvailableMemoryInBytesCallback callback) {
            mExecutor.execute(
                    () -> {
                        long availableMemoryInBytes =
                        long availableMemoryInBytes = EuiccManager.EUICC_MEMORY_FIELD_UNAVAILABLE;
                        String unsupportedOperationMessage = "";
                        try {
                            availableMemoryInBytes =
                                    EuiccService.this.onGetAvailableMemoryInBytes(slotId);
                        } catch (UnsupportedOperationException e) {
                            unsupportedOperationMessage = e.getMessage();
                        }

                        try {
                            if (!unsupportedOperationMessage.isEmpty()) {
                                callback.onUnsupportedOperationException(
                                        unsupportedOperationMessage);
                            } else {
                                callback.onSuccess(availableMemoryInBytes);
                            }
                        } catch (RemoteException e) {
                            // Can't communicate with the phone process; ignore.
                        }
+1 −0
Original line number Diff line number Diff line
@@ -19,4 +19,5 @@ package android.service.euicc;
/** @hide */
oneway interface IGetAvailableMemoryInBytesCallback {
    void onSuccess(long availableMemoryInBytes);
    void onUnsupportedOperationException(String message);
}