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

Commit 454b687a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Do not use hidden rethrowAsRuntimeException API"

parents bdc07de5 8ad94797
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);
    }
  }