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

Commit e904f46e authored by Kweku Adams's avatar Kweku Adams
Browse files

Switch to throw e.rethrowFromSystemServer().

The official guidance is to explicitly throw
RemoteException.rethrowFromSystemServer() instead of just calling the
method.

Bug: 141645789
Test: Android builds
Change-Id: I37c29eb3740141e91cae5e604b58fd419d837b33
parent 9d95b2bf
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -53,8 +53,7 @@ public class DeviceIdleManager {
        try {
            return mService.getSystemPowerWhitelistExceptIdle();
        } catch (RemoteException e) {
            e.rethrowFromSystemServer();
            return new String[0];
            throw e.rethrowFromSystemServer();
        }
    }

@@ -66,8 +65,7 @@ public class DeviceIdleManager {
        try {
            return mService.getSystemPowerWhitelist();
        } catch (RemoteException e) {
            e.rethrowFromSystemServer();
            return new String[0];
            throw e.rethrowFromSystemServer();
        }
    }

+4 −8
Original line number Diff line number Diff line
@@ -24,8 +24,6 @@ import android.annotation.SystemService;
import android.annotation.TestApi;
import android.content.Context;

import libcore.util.EmptyArray;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Collections;
@@ -97,7 +95,7 @@ public class PowerWhitelistManager {
        try {
            mService.addPowerSaveWhitelistApps(packageNames);
        } catch (RemoteException e) {
            e.rethrowFromSystemServer();
            throw e.rethrowFromSystemServer();
        }
    }

@@ -118,8 +116,7 @@ public class PowerWhitelistManager {
                return mService.getAppIdWhitelistExceptIdle();
            }
        } catch (RemoteException e) {
            e.rethrowFromSystemServer();
            return EmptyArray.INT;
            throw e.rethrowFromSystemServer();
        }
    }

@@ -136,7 +133,7 @@ public class PowerWhitelistManager {
            mService.addPowerSaveTempWhitelistApp(packageName, durationMs, mContext.getUserId(),
                    reason);
        } catch (RemoteException e) {
            e.rethrowFromSystemServer();
            throw e.rethrowFromSystemServer();
        }
    }

@@ -166,8 +163,7 @@ public class PowerWhitelistManager {
                            packageName, mContext.getUserId(), reason);
            }
        } catch (RemoteException e) {
            e.rethrowFromSystemServer();
            return 0;
            throw e.rethrowFromSystemServer();
        }
    }
}