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

Commit 8ad94797 authored by Sooraj Sasindran's avatar Sooraj Sasindran
Browse files

Do not use hidden rethrowAsRuntimeException API

Do not use hidden rethrowAsRuntimeException API from
RemoteException.

Bug: 137202333
Test: Make
Change-Id: Idcb007465096f5b139585c7eb0f307fd40edac7f
parent 2e84d8f6
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ import android.telephony.data.IDataServiceCallback;
import android.text.TextUtils;

import com.android.internal.telephony.Phone;
import com.android.internal.telephony.util.TelephonyUtils;

import java.util.HashSet;
import java.util.List;
@@ -136,7 +137,7 @@ public class DataServiceManager extends Handler {
                UserHandle.myUserId(), pkgToGrant[0], AppOpsManager.MODE_ALLOWED);
        } catch (RemoteException e) {
            loge("Binder to package manager died, permission grant for DataService failed.");
            throw e.rethrowAsRuntimeException();
            throw TelephonyUtils.rethrowAsRuntimeException(e);
        }
    }

@@ -162,7 +163,7 @@ public class DataServiceManager extends Handler {
            }
        } catch (RemoteException e) {
            loge("Binder to package manager died; failed to revoke DataService permissions.");
            throw e.rethrowAsRuntimeException();
            throw TelephonyUtils.rethrowAsRuntimeException(e);
        }
    }

+10 −4
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
package com.android.internal.telephony.util;

import android.annotation.Nullable;
import android.os.RemoteException;

/**
 * This class provides various util functions
@@ -25,4 +26,9 @@ public final class TelephonyUtils {
    public static String emptyIfNull(@Nullable String str) {
        return str == null ? "" : str;
    }

    /** {@hide} */
    public static RuntimeException rethrowAsRuntimeException(RemoteException remoteException) {
        throw new RuntimeException(remoteException);
    }
  }