Merge "When system server goes down, crash apps more." into nyc-dev
diff --git a/core/java/android/app/AlarmManager.java b/core/java/android/app/AlarmManager.java
index b569416..455f869 100644
--- a/core/java/android/app/AlarmManager.java
+++ b/core/java/android/app/AlarmManager.java
@@ -201,6 +201,7 @@
try {
mService.remove(null, this);
} catch (RemoteException ex) {
+ throw ex.rethrowFromSystemServer();
}
synchronized (AlarmManager.class) {
@@ -656,6 +657,7 @@
mService.set(mPackageName, type, triggerAtMillis, windowMillis, intervalMillis, flags,
operation, recipientWrapper, listenerTag, workSource, alarmClock);
} catch (RemoteException ex) {
+ throw ex.rethrowFromSystemServer();
}
}
@@ -886,6 +888,7 @@
try {
mService.remove(operation, null);
} catch (RemoteException ex) {
+ throw ex.rethrowFromSystemServer();
}
}
@@ -926,6 +929,7 @@
try {
mService.setTime(millis);
} catch (RemoteException ex) {
+ throw ex.rethrowFromSystemServer();
}
}
@@ -965,6 +969,7 @@
try {
mService.setTimeZone(timeZone);
} catch (RemoteException ex) {
+ throw ex.rethrowFromSystemServer();
}
}
@@ -973,7 +978,7 @@
try {
return mService.getNextWakeFromIdleTime();
} catch (RemoteException ex) {
- return Long.MAX_VALUE;
+ throw ex.rethrowFromSystemServer();
}
}
@@ -1005,7 +1010,7 @@
try {
return mService.getNextAlarmClock(userId);
} catch (RemoteException ex) {
- return null;
+ throw ex.rethrowFromSystemServer();
}
}
diff --git a/core/java/android/app/NotificationManager.java b/core/java/android/app/NotificationManager.java
index b6448ee..057a4e9 100644
--- a/core/java/android/app/NotificationManager.java
+++ b/core/java/android/app/NotificationManager.java
@@ -890,9 +890,8 @@
final List<StatusBarNotification> list = parceledList.getList();
return list.toArray(new StatusBarNotification[list.size()]);
} catch (RemoteException e) {
- Log.e(TAG, "Unable to talk to notification manager. Woe!", e);
+ throw e.rethrowFromSystemServer();
}
- return new StatusBarNotification[0];
}
/**
@@ -913,9 +912,8 @@
try {
return zenModeToInterruptionFilter(service.getZenMode());
} catch (RemoteException e) {
- Log.e(TAG, "Unable to talk to notification manager. Woe!", e);
+ throw e.rethrowFromSystemServer();
}
- return INTERRUPTION_FILTER_UNKNOWN;
}
/**
@@ -936,7 +934,7 @@
try {
service.setInterruptionFilter(mContext.getOpPackageName(), interruptionFilter);
} catch (RemoteException e) {
- Log.e(TAG, "Unable to talk to notification manager. Woe!", e);
+ throw e.rethrowFromSystemServer();
}
}
diff --git a/core/java/android/app/SearchManager.java b/core/java/android/app/SearchManager.java
index 9e32164..ac4abf5 100644
--- a/core/java/android/app/SearchManager.java
+++ b/core/java/android/app/SearchManager.java
@@ -686,8 +686,7 @@
try {
return mService.getGlobalSearchActivities();
} catch (RemoteException ex) {
- Log.e(TAG, "getGlobalSearchActivities() failed: " + ex);
- return null;
+ throw ex.rethrowFromSystemServer();
}
}
@@ -698,8 +697,7 @@
try {
return mService.getGlobalSearchActivity();
} catch (RemoteException ex) {
- Log.e(TAG, "getGlobalSearchActivity() failed: " + ex);
- return null;
+ throw ex.rethrowFromSystemServer();
}
}
@@ -716,8 +714,7 @@
try {
return mService.getWebSearchActivity();
} catch (RemoteException ex) {
- Log.e(TAG, "getWebSearchActivity() failed: " + ex);
- return null;
+ throw ex.rethrowFromSystemServer();
}
}
@@ -850,8 +847,7 @@
try {
return mService.getSearchableInfo(componentName);
} catch (RemoteException ex) {
- Log.e(TAG, "getSearchableInfo() failed: " + ex);
- return null;
+ throw ex.rethrowFromSystemServer();
}
}
@@ -935,8 +931,7 @@
try {
return mService.getSearchablesInGlobalSearch();
} catch (RemoteException e) {
- Log.e(TAG, "getSearchablesInGlobalSearch() failed: " + e);
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -958,8 +953,7 @@
}
return intent;
} catch (RemoteException re) {
- Log.e(TAG, "getAssistIntent() failed: " + re);
- return null;
+ throw re.rethrowFromSystemServer();
}
}
@@ -977,7 +971,7 @@
}
mService.launchAssist(args);
} catch (RemoteException re) {
- Log.e(TAG, "launchAssist() failed: " + re);
+ throw re.rethrowFromSystemServer();
}
}
@@ -995,8 +989,7 @@
}
return mService.launchLegacyAssist(hint, userHandle, args);
} catch (RemoteException re) {
- Log.e(TAG, "launchAssist() failed: " + re);
- return false;
+ throw re.rethrowFromSystemServer();
}
}
}
diff --git a/core/java/android/app/StatusBarManager.java b/core/java/android/app/StatusBarManager.java
index b899116..e57a9b5 100644
--- a/core/java/android/app/StatusBarManager.java
+++ b/core/java/android/app/StatusBarManager.java
@@ -123,8 +123,7 @@
svc.disable(what, mToken, mContext.getPackageName());
}
} catch (RemoteException ex) {
- // system process is dead anyway.
- throw new RuntimeException(ex);
+ throw ex.rethrowFromSystemServer();
}
}
@@ -141,8 +140,7 @@
svc.disable2(what, mToken, mContext.getPackageName());
}
} catch (RemoteException ex) {
- // system process is dead anyway.
- throw new RuntimeException(ex);
+ throw ex.rethrowFromSystemServer();
}
}
@@ -156,8 +154,7 @@
svc.expandNotificationsPanel();
}
} catch (RemoteException ex) {
- // system process is dead anyway.
- throw new RuntimeException(ex);
+ throw ex.rethrowFromSystemServer();
}
}
@@ -171,8 +168,7 @@
svc.collapsePanels();
}
} catch (RemoteException ex) {
- // system process is dead anyway.
- throw new RuntimeException(ex);
+ throw ex.rethrowFromSystemServer();
}
}
@@ -193,8 +189,7 @@
svc.expandSettingsPanel(subPanel);
}
} catch (RemoteException ex) {
- // system process is dead anyway.
- throw new RuntimeException(ex);
+ throw ex.rethrowFromSystemServer();
}
}
@@ -206,8 +201,7 @@
contentDescription);
}
} catch (RemoteException ex) {
- // system process is dead anyway.
- throw new RuntimeException(ex);
+ throw ex.rethrowFromSystemServer();
}
}
@@ -218,8 +212,7 @@
svc.removeIcon(slot);
}
} catch (RemoteException ex) {
- // system process is dead anyway.
- throw new RuntimeException(ex);
+ throw ex.rethrowFromSystemServer();
}
}
@@ -230,8 +223,7 @@
svc.setIconVisibility(slot, visible);
}
} catch (RemoteException ex) {
- // system process is dead anyway.
- throw new RuntimeException(ex);
+ throw ex.rethrowFromSystemServer();
}
}
diff --git a/core/java/android/app/UiModeManager.java b/core/java/android/app/UiModeManager.java
index 56b4249..73fb55f 100644
--- a/core/java/android/app/UiModeManager.java
+++ b/core/java/android/app/UiModeManager.java
@@ -158,7 +158,7 @@
try {
mService.enableCarMode(flags);
} catch (RemoteException e) {
- Log.e(TAG, "disableCarMode: RemoteException", e);
+ throw e.rethrowFromSystemServer();
}
}
}
@@ -181,7 +181,7 @@
try {
mService.disableCarMode(flags);
} catch (RemoteException e) {
- Log.e(TAG, "disableCarMode: RemoteException", e);
+ throw e.rethrowFromSystemServer();
}
}
}
@@ -200,7 +200,7 @@
try {
return mService.getCurrentModeType();
} catch (RemoteException e) {
- Log.e(TAG, "getCurrentModeType: RemoteException", e);
+ throw e.rethrowFromSystemServer();
}
}
return Configuration.UI_MODE_TYPE_NORMAL;
@@ -233,7 +233,7 @@
try {
mService.setNightMode(mode);
} catch (RemoteException e) {
- Log.e(TAG, "setNightMode: RemoteException", e);
+ throw e.rethrowFromSystemServer();
}
}
}
@@ -257,7 +257,7 @@
try {
return mService.getNightMode();
} catch (RemoteException e) {
- Log.e(TAG, "getNightMode: RemoteException", e);
+ throw e.rethrowFromSystemServer();
}
}
return -1;
@@ -272,7 +272,7 @@
try {
return mService.isUiModeLocked();
} catch (RemoteException e) {
- Log.e(TAG, "isUiModeLocked: RemoteException", e);
+ throw e.rethrowFromSystemServer();
}
}
return true;
@@ -292,7 +292,7 @@
try {
return mService.isNightModeLocked();
} catch (RemoteException e) {
- Log.e(TAG, "isNightModeLocked: RemoteException", e);
+ throw e.rethrowFromSystemServer();
}
}
return true;
diff --git a/core/java/android/app/WallpaperManager.java b/core/java/android/app/WallpaperManager.java
index b7e31ab..4d8d96b 100644
--- a/core/java/android/app/WallpaperManager.java
+++ b/core/java/android/app/WallpaperManager.java
@@ -293,7 +293,7 @@
return null;
}
} catch (RemoteException e) {
- // Ignore
+ throw e.rethrowFromSystemServer();
}
}
if (mWallpaper != null) {
@@ -349,7 +349,7 @@
}
}
} catch (RemoteException e) {
- // Ignore
+ throw e.rethrowFromSystemServer();
}
return null;
}
@@ -691,7 +691,7 @@
Bundle outParams = new Bundle();
return sGlobals.mService.getWallpaper(null, which, outParams, userId);
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
}
@@ -720,7 +720,7 @@
return sGlobals.mService.getWallpaperInfo();
}
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -844,7 +844,7 @@
}
}
} catch (RemoteException e) {
- // Ignore
+ throw e.rethrowFromSystemServer();
}
return result.getInt(EXTRA_NEW_WALLPAPER_ID, 0);
}
@@ -950,7 +950,7 @@
}
}
} catch (RemoteException e) {
- // Ignore
+ throw e.rethrowFromSystemServer();
}
return result.getInt(EXTRA_NEW_WALLPAPER_ID, 0);
}
@@ -1067,7 +1067,7 @@
}
}
} catch (RemoteException e) {
- // Ignore
+ throw e.rethrowFromSystemServer();
}
return result.getInt(EXTRA_NEW_WALLPAPER_ID, 0);
@@ -1088,7 +1088,7 @@
String name = "res:" + resources.getResourceName(resid);
return sGlobals.mService.hasNamedWallpaper(name);
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1114,8 +1114,7 @@
try {
return sGlobals.mService.getWidthHint();
} catch (RemoteException e) {
- // Shouldn't happen!
- return 0;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1141,8 +1140,7 @@
try {
return sGlobals.mService.getHeightHint();
} catch (RemoteException e) {
- // Shouldn't happen!
- return 0;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1203,7 +1201,7 @@
mContext.getOpPackageName());
}
} catch (RemoteException e) {
- // Ignore
+ throw e.rethrowFromSystemServer();
}
}
@@ -1224,7 +1222,7 @@
sGlobals.mService.setDisplayPadding(padding, mContext.getOpPackageName());
}
} catch (RemoteException e) {
- // Ignore
+ throw e.rethrowFromSystemServer();
}
}
@@ -1245,7 +1243,7 @@
windowToken, x, y);
//Log.v(TAG, "...app returning after sending display offset!");
} catch (RemoteException e) {
- // Ignore.
+ throw e.rethrowFromSystemServer();
}
}
@@ -1274,7 +1272,7 @@
try {
sGlobals.mService.clearWallpaper(mContext.getOpPackageName(), which, userId);
} catch (RemoteException e) {
- // Ignore
+ throw e.rethrowFromSystemServer();
}
}
@@ -1296,9 +1294,8 @@
sGlobals.mService.setWallpaperComponentChecked(name, mContext.getOpPackageName());
return true;
} catch (RemoteException e) {
- // Ignore
+ throw e.rethrowFromSystemServer();
}
- return false;
}
/**
@@ -1321,7 +1318,7 @@
windowToken, xOffset, yOffset, mWallpaperXStep, mWallpaperYStep);
//Log.v(TAG, "...app returning after sending offsets!");
} catch (RemoteException e) {
- // Ignore.
+ throw e.rethrowFromSystemServer();
}
}
@@ -1359,7 +1356,7 @@
windowToken, action, x, y, z, extras, false);
//Log.v(TAG, "...app returning after sending offsets!");
} catch (RemoteException e) {
- // Ignore.
+ throw e.rethrowFromSystemServer();
}
}
@@ -1375,7 +1372,7 @@
try {
return sGlobals.mService.isWallpaperSupported(mContext.getOpPackageName());
} catch (RemoteException e) {
- // Ignore
+ throw e.rethrowFromSystemServer();
}
}
return false;
@@ -1395,7 +1392,7 @@
try {
return sGlobals.mService.isWallpaperSettingAllowed(mContext.getOpPackageName());
} catch (RemoteException e) {
- // Ignore
+ throw e.rethrowFromSystemServer();
}
}
return false;
@@ -1416,7 +1413,7 @@
WindowManagerGlobal.getWindowSession().setWallpaperPosition(
windowToken, -1, -1, -1, -1);
} catch (RemoteException e) {
- // Ignore.
+ throw e.rethrowFromSystemServer();
}
}
@@ -1497,9 +1494,8 @@
try {
return sGlobals.mService.setLockWallpaperCallback(callback);
} catch (RemoteException e) {
- Log.e(TAG, "Unable to contact wallpaper service");
+ throw e.rethrowFromSystemServer();
}
- return false;
}
// Private completion callback for setWallpaper() synchronization
diff --git a/core/java/android/hardware/ConsumerIrManager.java b/core/java/android/hardware/ConsumerIrManager.java
index 6d29212..9fa1c3f 100644
--- a/core/java/android/hardware/ConsumerIrManager.java
+++ b/core/java/android/hardware/ConsumerIrManager.java
@@ -60,8 +60,8 @@
try {
return mService.hasIrEmitter();
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
- return false;
}
/**
@@ -84,7 +84,7 @@
try {
mService.transmit(mPackageName, carrierFrequency, pattern);
} catch (RemoteException e) {
- Log.w(TAG, "failed to transmit.", e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -149,8 +149,7 @@
}
return range;
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
- return null;
}
-
}
diff --git a/core/java/android/hardware/SerialManager.java b/core/java/android/hardware/SerialManager.java
index e0680bf22..83f7649 100644
--- a/core/java/android/hardware/SerialManager.java
+++ b/core/java/android/hardware/SerialManager.java
@@ -14,13 +14,11 @@
* limitations under the License.
*/
-
package android.hardware;
import android.content.Context;
import android.os.ParcelFileDescriptor;
import android.os.RemoteException;
-import android.util.Log;
import java.io.IOException;
@@ -50,8 +48,7 @@
try {
return mService.getSerialPorts();
} catch (RemoteException e) {
- Log.e(TAG, "RemoteException in getSerialPorts", e);
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -77,8 +74,7 @@
throw new IOException("Could not open serial port " + name);
}
} catch (RemoteException e) {
- Log.e(TAG, "exception in UsbManager.openDevice", e);
+ throw e.rethrowFromSystemServer();
}
- return null;
}
}
diff --git a/core/java/android/hardware/fingerprint/FingerprintManager.java b/core/java/android/hardware/fingerprint/FingerprintManager.java
index abd02f0..b8088f3 100644
--- a/core/java/android/hardware/fingerprint/FingerprintManager.java
+++ b/core/java/android/hardware/fingerprint/FingerprintManager.java
@@ -540,7 +540,7 @@
if (mService != null) try {
result = mService.preEnroll(mToken);
} catch (RemoteException e) {
- Log.w(TAG, "Remote exception in enroll: ", e);
+ throw e.rethrowFromSystemServer();
}
return result;
}
@@ -555,7 +555,7 @@
if (mService != null) try {
result = mService.postEnroll(mToken);
} catch (RemoteException e) {
- Log.w(TAG, "Remote exception in post enroll: ", e);
+ throw e.rethrowFromSystemServer();
}
return result;
}
@@ -571,7 +571,7 @@
if (mService != null) try {
mService.setActiveUser(userId);
} catch (RemoteException e) {
- Log.w(TAG, "Remote exception in setActiveUser: ", e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -614,7 +614,7 @@
try {
mService.rename(fpId, userId, newName);
} catch (RemoteException e) {
- Log.v(TAG, "Remote exception in rename(): ", e);
+ throw e.rethrowFromSystemServer();
}
} else {
Log.w(TAG, "rename(): Service not connected!");
@@ -632,7 +632,7 @@
if (mService != null) try {
return mService.getEnrolledFingerprints(userId, mContext.getOpPackageName());
} catch (RemoteException e) {
- Log.v(TAG, "Remote exception in getEnrolledFingerprints: ", e);
+ throw e.rethrowFromSystemServer();
}
return null;
}
@@ -659,7 +659,7 @@
return mService.hasEnrolledFingerprints(
UserHandle.myUserId(), mContext.getOpPackageName());
} catch (RemoteException e) {
- Log.v(TAG, "Remote exception in getEnrolledFingerprints: ", e);
+ throw e.rethrowFromSystemServer();
}
return false;
}
@@ -674,7 +674,7 @@
if (mService != null) try {
return mService.hasEnrolledFingerprints(userId, mContext.getOpPackageName());
} catch (RemoteException e) {
- Log.v(TAG, "Remote exception in getEnrolledFingerprints: ", e);
+ throw e.rethrowFromSystemServer();
}
return false;
}
@@ -691,7 +691,7 @@
long deviceId = 0; /* TODO: plumb hardware id to FPMS */
return mService.isHardwareDetected(deviceId, mContext.getOpPackageName());
} catch (RemoteException e) {
- Log.v(TAG, "Remote exception in isFingerprintHardwareDetected(): ", e);
+ throw e.rethrowFromSystemServer();
}
} else {
Log.w(TAG, "isFingerprintHardwareDetected(): Service not connected!");
@@ -710,7 +710,7 @@
try {
return mService.getAuthenticatorId(mContext.getOpPackageName());
} catch (RemoteException e) {
- Log.v(TAG, "Remote exception in getAuthenticatorId(): ", e);
+ throw e.rethrowFromSystemServer();
}
} else {
Log.w(TAG, "getAuthenticatorId(): Service not connected!");
@@ -730,7 +730,7 @@
try {
mService.resetTimeout(token);
} catch (RemoteException e) {
- Log.v(TAG, "Remote exception in resetTimeout(): ", e);
+ throw e.rethrowFromSystemServer();
}
} else {
Log.w(TAG, "resetTimeout(): Service not connected!");
@@ -765,7 +765,7 @@
}
});
} catch (RemoteException e) {
- Log.v(TAG, "Remote exception in addLockoutResetCallback(): ", e);
+ throw e.rethrowFromSystemServer();
}
} else {
Log.w(TAG, "addLockoutResetCallback(): Service not connected!");
@@ -881,8 +881,7 @@
try {
return ActivityManagerNative.getDefault().getCurrentUser().id;
} catch (RemoteException e) {
- Log.w(TAG, "Failed to get current user id\n");
- return UserHandle.USER_NULL;
+ throw e.rethrowFromSystemServer();
}
}
@@ -890,7 +889,7 @@
if (mService != null) try {
mService.cancelEnrollment(mToken);
} catch (RemoteException e) {
- if (DEBUG) Log.w(TAG, "Remote exception while canceling enrollment");
+ throw e.rethrowFromSystemServer();
}
}
@@ -898,7 +897,7 @@
if (mService != null) try {
mService.cancelAuthentication(mToken, mContext.getOpPackageName());
} catch (RemoteException e) {
- if (DEBUG) Log.w(TAG, "Remote exception while canceling enrollment");
+ throw e.rethrowFromSystemServer();
}
}
diff --git a/core/java/android/hardware/hdmi/HdmiControlManager.java b/core/java/android/hardware/hdmi/HdmiControlManager.java
index 6effc0d..ff87b67 100644
--- a/core/java/android/hardware/hdmi/HdmiControlManager.java
+++ b/core/java/android/hardware/hdmi/HdmiControlManager.java
@@ -267,7 +267,7 @@
try {
types = mService.getSupportedTypes();
} catch (RemoteException e) {
- // Do nothing.
+ throw e.rethrowFromSystemServer();
}
}
mHasTvDevice = hasDeviceType(types, HdmiDeviceInfo.DEVICE_TV);
@@ -403,7 +403,7 @@
try {
mService.addHotplugEventListener(wrappedListener);
} catch (RemoteException e) {
- Log.e(TAG, "failed to add hotplug event listener: ", e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -425,7 +425,7 @@
try {
mService.removeHotplugEventListener(wrappedListener);
} catch (RemoteException e) {
- Log.e(TAG, "failed to remove hotplug event listener: ", e);
+ throw e.rethrowFromSystemServer();
}
}
diff --git a/core/java/android/hardware/input/InputManager.java b/core/java/android/hardware/input/InputManager.java
index cbe3412..fbac58c 100644
--- a/core/java/android/hardware/input/InputManager.java
+++ b/core/java/android/hardware/input/InputManager.java
@@ -252,7 +252,7 @@
try {
inputDevice = mIm.getInputDevice(id);
} catch (RemoteException ex) {
- throw new RuntimeException("Could not get input device information.", ex);
+ throw ex.rethrowFromSystemServer();
}
if (inputDevice != null) {
mInputDevices.setValueAt(index, inputDevice);
@@ -284,7 +284,7 @@
try {
inputDevice = mIm.getInputDevice(id);
} catch (RemoteException ex) {
- // Ignore the problem for the purposes of this method.
+ throw ex.rethrowFromSystemServer();
}
if (inputDevice == null) {
continue;
@@ -384,8 +384,7 @@
try {
return mIm.isInTabletMode();
} catch (RemoteException ex) {
- Log.w(TAG, "Could not get tablet mode state", ex);
- return SWITCH_STATE_UNKNOWN;
+ throw ex.rethrowFromSystemServer();
}
}
@@ -439,7 +438,7 @@
try {
mIm.registerTabletModeChangedListener(listener);
} catch (RemoteException ex) {
- throw new RuntimeException("Could not register tablet mode changed listener", ex);
+ throw ex.rethrowFromSystemServer();
}
mTabletModeChangedListener = listener;
mOnTabletModeChangedListeners = new ArrayList<>();
@@ -471,8 +470,7 @@
try {
return mIm.getKeyboardLayouts();
} catch (RemoteException ex) {
- Log.w(TAG, "Could not get list of keyboard layout informations.", ex);
- return new KeyboardLayout[0];
+ throw ex.rethrowFromSystemServer();
}
}
@@ -494,8 +492,7 @@
try {
return mIm.getKeyboardLayoutsForInputDevice(identifier);
} catch (RemoteException ex) {
- Log.w(TAG, "Could not get list of keyboard layouts for input device.", ex);
- return new KeyboardLayout[0];
+ throw ex.rethrowFromSystemServer();
}
}
@@ -516,8 +513,7 @@
try {
return mIm.getKeyboardLayout(keyboardLayoutDescriptor);
} catch (RemoteException ex) {
- Log.w(TAG, "Could not get keyboard layout information.", ex);
- return null;
+ throw ex.rethrowFromSystemServer();
}
}
@@ -534,8 +530,7 @@
try {
return mIm.getCurrentKeyboardLayoutForInputDevice(identifier);
} catch (RemoteException ex) {
- Log.w(TAG, "Could not get current keyboard layout for input device.", ex);
- return null;
+ throw ex.rethrowFromSystemServer();
}
}
@@ -565,7 +560,7 @@
mIm.setCurrentKeyboardLayoutForInputDevice(identifier,
keyboardLayoutDescriptor);
} catch (RemoteException ex) {
- Log.w(TAG, "Could not set current keyboard layout for input device.", ex);
+ throw ex.rethrowFromSystemServer();
}
}
@@ -585,8 +580,7 @@
try {
return mIm.getEnabledKeyboardLayoutsForInputDevice(identifier);
} catch (RemoteException ex) {
- Log.w(TAG, "Could not get keyboard layouts for input device.", ex);
- return ArrayUtils.emptyArray(String.class);
+ throw ex.rethrowFromSystemServer();
}
}
@@ -614,7 +608,7 @@
try {
mIm.addKeyboardLayoutForInputDevice(identifier, keyboardLayoutDescriptor);
} catch (RemoteException ex) {
- Log.w(TAG, "Could not add keyboard layout for input device.", ex);
+ throw ex.rethrowFromSystemServer();
}
}
@@ -642,7 +636,7 @@
try {
mIm.removeKeyboardLayoutForInputDevice(identifier, keyboardLayoutDescriptor);
} catch (RemoteException ex) {
- Log.w(TAG, "Could not remove keyboard layout for input device.", ex);
+ throw ex.rethrowFromSystemServer();
}
}
@@ -664,8 +658,7 @@
return mIm.getKeyboardLayoutForInputDevice(
identifier, inputMethodInfo, inputMethodSubtype);
} catch (RemoteException ex) {
- Log.w(TAG, "Could not set keyboard layout.", ex);
- return null;
+ throw ex.rethrowFromSystemServer();
}
}
@@ -687,7 +680,7 @@
mIm.setKeyboardLayoutForInputDevice(identifier, inputMethodInfo,
inputMethodSubtype, keyboardLayoutDescriptor);
} catch (RemoteException ex) {
- Log.w(TAG, "Could not set keyboard layout.", ex);
+ throw ex.rethrowFromSystemServer();
}
}
@@ -704,8 +697,7 @@
try {
return mIm.getTouchCalibrationForInputDevice(inputDeviceDescriptor, surfaceRotation);
} catch (RemoteException ex) {
- Log.w(TAG, "Could not get calibration matrix for input device.", ex);
- return TouchCalibration.IDENTITY;
+ throw ex.rethrowFromSystemServer();
}
}
@@ -726,7 +718,7 @@
try {
mIm.setTouchCalibrationForInputDevice(inputDeviceDescriptor, surfaceRotation, calibration);
} catch (RemoteException ex) {
- Log.w(TAG, "Could not set calibration matrix for input device.", ex);
+ throw ex.rethrowFromSystemServer();
}
}
@@ -793,7 +785,7 @@
try {
mIm.tryPointerSpeed(speed);
} catch (RemoteException ex) {
- Log.w(TAG, "Could not set temporary pointer speed.", ex);
+ throw ex.rethrowFromSystemServer();
}
}
@@ -831,7 +823,7 @@
try {
mIm.hasKeys(id, InputDevice.SOURCE_ANY, keyCodes, ret);
} catch (RemoteException e) {
- // no fallback; just return the empty array
+ throw e.rethrowFromSystemServer();
}
return ret;
}
@@ -871,7 +863,7 @@
try {
return mIm.injectInputEvent(event, mode);
} catch (RemoteException ex) {
- return false;
+ throw ex.rethrowFromSystemServer();
}
}
@@ -887,7 +879,7 @@
try {
mIm.setPointerIconShape(iconId);
} catch (RemoteException ex) {
- // Do nothing.
+ throw ex.rethrowFromSystemServer();
}
}
@@ -896,7 +888,7 @@
try {
mIm.setCustomPointerIcon(icon);
} catch (RemoteException ex) {
- // Do nothing.
+ throw ex.rethrowFromSystemServer();
}
}
@@ -914,7 +906,7 @@
try {
mIm.setPointerIconDetached(detached);
} catch (RemoteException ex) {
- // Do nothing.
+ throw ex.rethrowFromSystemServer();
}
}
@@ -924,8 +916,7 @@
try {
mIm.registerInputDevicesChangedListener(listener);
} catch (RemoteException ex) {
- throw new RuntimeException(
- "Could not get register input device changed listener", ex);
+ throw ex.rethrowFromSystemServer();
}
mInputDevicesChangedListener = listener;
}
@@ -935,7 +926,7 @@
try {
ids = mIm.getInputDeviceIds();
} catch (RemoteException ex) {
- throw new RuntimeException("Could not get input device ids.", ex);
+ throw ex.rethrowFromSystemServer();
}
mInputDevices = new SparseArray<InputDevice>();
@@ -1175,7 +1166,7 @@
try {
mIm.vibrate(mDeviceId, pattern, repeat, mToken);
} catch (RemoteException ex) {
- Log.w(TAG, "Failed to vibrate.", ex);
+ throw ex.rethrowFromSystemServer();
}
}
@@ -1184,7 +1175,7 @@
try {
mIm.cancelVibrate(mDeviceId, mToken);
} catch (RemoteException ex) {
- Log.w(TAG, "Failed to cancel vibration.", ex);
+ throw ex.rethrowFromSystemServer();
}
}
}
diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java
index 7004e97..f091f931 100644
--- a/core/java/android/net/ConnectivityManager.java
+++ b/core/java/android/net/ConnectivityManager.java
@@ -733,7 +733,7 @@
try {
return mService.getActiveNetworkInfo();
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -753,7 +753,7 @@
try {
return mService.getActiveNetwork();
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -777,7 +777,7 @@
try {
return mService.setAlwaysOnVpnPackage(userId, vpnPackage);
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -794,7 +794,7 @@
try {
return mService.getAlwaysOnVpnPackage(userId);
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -815,7 +815,7 @@
try {
return mService.getActiveNetworkInfoForUid(uid);
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -839,7 +839,7 @@
try {
return mService.getNetworkInfo(networkType);
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -859,7 +859,7 @@
try {
return mService.getNetworkInfoForNetwork(network);
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -880,7 +880,7 @@
try {
return mService.getAllNetworkInfo();
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -900,7 +900,7 @@
try {
return mService.getNetworkForType(networkType);
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -916,7 +916,7 @@
try {
return mService.getAllNetworks();
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -929,7 +929,7 @@
try {
return mService.getDefaultNetworkCapabilitiesForUser(userId);
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -948,7 +948,7 @@
try {
return mService.getActiveLinkProperties();
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -972,7 +972,7 @@
try {
return mService.getLinkPropertiesForType(networkType);
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -989,7 +989,7 @@
try {
return mService.getLinkProperties(network);
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1006,7 +1006,7 @@
try {
return mService.getNetworkCapabilities(network);
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1024,7 +1024,7 @@
try {
return mService.getCaptivePortalServerUrl();
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1324,7 +1324,9 @@
int type = legacyTypeForNetworkCapabilities(netCap);
try {
delay = mService.getRestoreDefaultNetworkDelay(type);
- } catch (RemoteException e) {}
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
LegacyRequest l = new LegacyRequest();
l.networkCapabilities = netCap;
l.delay = delay;
@@ -1542,7 +1544,7 @@
try {
return mService.requestRouteToHostAddress(networkType, hostAddress.getAddress());
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1598,7 +1600,7 @@
try {
return mService.getActiveNetworkQuotaInfo();
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1617,7 +1619,9 @@
Log.d("ConnectivityManager", "getMobileDataEnabled()- subId=" + subId
+ " retVal=" + retVal);
return retVal;
- } catch (RemoteException e) { }
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
}
Log.d("ConnectivityManager", "getMobileDataEnabled()- remote exception retVal=false");
return false;
@@ -1678,6 +1682,7 @@
getNetworkManagementService().registerNetworkActivityListener(rl);
mNetworkActivityListeners.put(l, rl);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -1695,6 +1700,7 @@
try {
getNetworkManagementService().unregisterNetworkActivityListener(rl);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -1710,8 +1716,8 @@
try {
return getNetworkManagementService().isNetworkActive();
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
- return false;
}
/**
@@ -1785,7 +1791,7 @@
try {
return mService.getTetherableIfaces();
} catch (RemoteException e) {
- return new String[0];
+ throw e.rethrowFromSystemServer();
}
}
@@ -1802,7 +1808,7 @@
try {
return mService.getTetheredIfaces();
} catch (RemoteException e) {
- return new String[0];
+ throw e.rethrowFromSystemServer();
}
}
@@ -1825,7 +1831,7 @@
try {
return mService.getTetheringErroredIfaces();
} catch (RemoteException e) {
- return new String[0];
+ throw e.rethrowFromSystemServer();
}
}
@@ -1839,7 +1845,7 @@
try {
return mService.getTetheredDhcpRanges();
} catch (RemoteException e) {
- return new String[0];
+ throw e.rethrowFromSystemServer();
}
}
@@ -1871,7 +1877,7 @@
try {
return mService.tether(iface);
} catch (RemoteException e) {
- return TETHER_ERROR_SERVICE_UNAVAIL;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1897,7 +1903,7 @@
try {
return mService.untether(iface);
} catch (RemoteException e) {
- return TETHER_ERROR_SERVICE_UNAVAIL;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1917,7 +1923,7 @@
try {
return mService.isTetheringSupported();
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -2005,7 +2011,7 @@
try {
mService.stopTethering(type);
} catch (RemoteException e) {
- Log.e(TAG, "Exception trying to stop tethering.", e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -2025,7 +2031,7 @@
try {
return mService.getTetherableUsbRegexs();
} catch (RemoteException e) {
- return new String[0];
+ throw e.rethrowFromSystemServer();
}
}
@@ -2045,7 +2051,7 @@
try {
return mService.getTetherableWifiRegexs();
} catch (RemoteException e) {
- return new String[0];
+ throw e.rethrowFromSystemServer();
}
}
@@ -2065,7 +2071,7 @@
try {
return mService.getTetherableBluetoothRegexs();
} catch (RemoteException e) {
- return new String[0];
+ throw e.rethrowFromSystemServer();
}
}
@@ -2090,7 +2096,7 @@
try {
return mService.setUsbTethering(enable);
} catch (RemoteException e) {
- return TETHER_ERROR_SERVICE_UNAVAIL;
+ throw e.rethrowFromSystemServer();
}
}
@@ -2135,7 +2141,7 @@
try {
return mService.getLastTetherError(iface);
} catch (RemoteException e) {
- return TETHER_ERROR_SERVICE_UNAVAIL;
+ throw e.rethrowFromSystemServer();
}
}
@@ -2153,6 +2159,7 @@
try {
mService.reportInetCondition(networkType, percentage);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -2174,6 +2181,7 @@
mService.reportNetworkConnectivity(network, true);
mService.reportNetworkConnectivity(network, false);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -2192,6 +2200,7 @@
try {
mService.reportNetworkConnectivity(network, hasConnectivity);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -2211,6 +2220,7 @@
try {
mService.setGlobalProxy(p);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -2225,7 +2235,7 @@
try {
return mService.getGlobalProxy();
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -2247,7 +2257,7 @@
try {
return mService.getProxyForNetwork(network);
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -2282,8 +2292,9 @@
public boolean isNetworkSupported(int networkType) {
try {
return mService.isNetworkSupported(networkType);
- } catch (RemoteException e) {}
- return false;
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
}
/**
@@ -2303,7 +2314,7 @@
try {
return mService.isActiveNetworkMetered();
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -2320,7 +2331,7 @@
try {
return mService.updateLockdownVpn();
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -2339,6 +2350,7 @@
try {
timeOutMs = mService.checkMobileProvisioning(suggestedTimeOutMs);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
return timeOutMs;
}
@@ -2351,8 +2363,8 @@
try {
return mService.getMobileProvisioningUrl();
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
- return null;
}
/**
@@ -2369,6 +2381,7 @@
try {
mService.setProvisioningNotificationVisible(visible, networkType, action);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -2385,6 +2398,7 @@
try {
mService.setAirplaneMode(enable);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -2392,14 +2406,18 @@
public void registerNetworkFactory(Messenger messenger, String name) {
try {
mService.registerNetworkFactory(messenger, name);
- } catch (RemoteException e) { }
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
}
/** {@hide} */
public void unregisterNetworkFactory(Messenger messenger) {
try {
mService.unregisterNetworkFactory(messenger);
- } catch (RemoteException e) { }
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
}
/**
@@ -2412,7 +2430,7 @@
try {
return mService.registerNetworkAgent(messenger, ni, lp, nc, score, misc);
} catch (RemoteException e) {
- return NETID_UNSET;
+ throw e.rethrowFromSystemServer();
}
}
@@ -2730,7 +2748,9 @@
sNetworkCallback.put(networkCallback.networkRequest, networkCallback);
}
}
- } catch (RemoteException e) {}
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
if (networkCallback.networkRequest == null) decCallbackHandlerRefCount();
return networkCallback.networkRequest;
}
@@ -2893,7 +2913,9 @@
checkPendingIntent(operation);
try {
mService.pendingRequestForNetwork(request.networkCapabilities, operation);
- } catch (RemoteException e) {}
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
}
/**
@@ -2911,7 +2933,9 @@
checkPendingIntent(operation);
try {
mService.releasePendingNetworkRequest(operation);
- } catch (RemoteException e) {}
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
}
private void checkPendingIntent(PendingIntent intent) {
@@ -2970,7 +2994,9 @@
checkPendingIntent(operation);
try {
mService.pendingListenForNetwork(request.networkCapabilities, operation);
- } catch (RemoteException e) {}
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
}
/**
@@ -2988,7 +3014,7 @@
try {
return mService.requestBandwidthUpdate(network);
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -3008,7 +3034,9 @@
}
try {
mService.releaseNetworkRequest(networkCallback.networkRequest);
- } catch (RemoteException e) {}
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
}
/**
@@ -3044,7 +3072,9 @@
public void setAcceptUnvalidated(Network network, boolean accept, boolean always) {
try {
mService.setAcceptUnvalidated(network, accept, always);
- } catch (RemoteException e) {}
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
}
/**
@@ -3055,6 +3085,7 @@
try {
mService.factoryReset();
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -3262,7 +3293,7 @@
try {
return getNetworkPolicyManager().getRestrictBackgroundByCaller();
} catch (RemoteException e) {
- return RESTRICT_BACKGROUND_STATUS_DISABLED;
+ throw e.rethrowFromSystemServer();
}
}
}
diff --git a/core/java/android/net/EthernetManager.java b/core/java/android/net/EthernetManager.java
index f45737a..664b7b4 100644
--- a/core/java/android/net/EthernetManager.java
+++ b/core/java/android/net/EthernetManager.java
@@ -87,8 +87,8 @@
public IpConfiguration getConfiguration() {
try {
return mService.getConfiguration();
- } catch (NullPointerException | RemoteException e) {
- return new IpConfiguration();
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -98,7 +98,8 @@
public void setConfiguration(IpConfiguration config) {
try {
mService.setConfiguration(config);
- } catch (NullPointerException | RemoteException e) {
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -109,8 +110,8 @@
public boolean isAvailable() {
try {
return mService.isAvailable();
- } catch (NullPointerException | RemoteException e) {
- return false;
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -127,7 +128,8 @@
if (mListeners.size() == 1) {
try {
mService.addListener(mServiceListener);
- } catch (NullPointerException | RemoteException e) {
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
}
@@ -145,7 +147,8 @@
if (mListeners.isEmpty()) {
try {
mService.removeListener(mServiceListener);
- } catch (NullPointerException | RemoteException e) {
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
}
diff --git a/core/java/android/net/NetworkScoreManager.java b/core/java/android/net/NetworkScoreManager.java
index b6fe68a..01c160f 100644
--- a/core/java/android/net/NetworkScoreManager.java
+++ b/core/java/android/net/NetworkScoreManager.java
@@ -166,7 +166,7 @@
try {
return mService.updateScores(networks);
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -186,7 +186,7 @@
try {
return mService.clearScores();
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -206,7 +206,7 @@
try {
return mService.setActiveScorer(packageName);
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -221,6 +221,7 @@
try {
mService.disableScoring();
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -265,6 +266,7 @@
try {
mService.registerNetworkScoreCache(networkType, scoreCache);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
}
diff --git a/core/java/android/net/nsd/NsdManager.java b/core/java/android/net/nsd/NsdManager.java
index 377ed88..86bd502 100644
--- a/core/java/android/net/nsd/NsdManager.java
+++ b/core/java/android/net/nsd/NsdManager.java
@@ -619,7 +619,9 @@
public void setEnabled(boolean enabled) {
try {
mService.setEnabled(enabled);
- } catch (RemoteException e) { }
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
}
/**
@@ -632,7 +634,7 @@
try {
return mService.getMessenger();
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
}
diff --git a/core/java/android/os/BatteryManager.java b/core/java/android/os/BatteryManager.java
index 56cb250..e40ebf7 100644
--- a/core/java/android/os/BatteryManager.java
+++ b/core/java/android/os/BatteryManager.java
@@ -221,7 +221,7 @@
try {
return mBatteryStats.isCharging();
} catch (RemoteException e) {
- return true;
+ throw e.rethrowFromSystemServer();
}
}
@@ -246,7 +246,7 @@
else
ret = Long.MIN_VALUE;
} catch (RemoteException e) {
- ret = Long.MIN_VALUE;
+ throw e.rethrowFromSystemServer();
}
return ret;
diff --git a/core/java/android/os/HardwarePropertiesManager.java b/core/java/android/os/HardwarePropertiesManager.java
index f48306a..9ca1dcd 100644
--- a/core/java/android/os/HardwarePropertiesManager.java
+++ b/core/java/android/os/HardwarePropertiesManager.java
@@ -79,8 +79,7 @@
try {
return mService.getDeviceTemperatures(mContext.getOpPackageName(), type);
} catch (RemoteException e) {
- Log.w(TAG, "Could not get device temperatures", e);
- return new float[0];
+ throw e.rethrowFromSystemServer();
}
default:
Log.w(TAG, "Unknown device temperature type.");
@@ -100,8 +99,7 @@
try {
return mService.getCpuUsages(mContext.getOpPackageName());
} catch (RemoteException e) {
- Log.w(TAG, "Could not get CPU usages", e);
- return new CpuUsageInfo[0];
+ throw e.rethrowFromSystemServer();
}
}
@@ -117,8 +115,7 @@
try {
return mService.getFanSpeeds(mContext.getOpPackageName());
} catch (RemoteException e) {
- Log.w(TAG, "Could not get fan speeds", e);
- return new float[0];
+ throw e.rethrowFromSystemServer();
}
}
}
diff --git a/core/java/android/os/PowerManager.java b/core/java/android/os/PowerManager.java
index 369ec15..2a4507c 100644
--- a/core/java/android/os/PowerManager.java
+++ b/core/java/android/os/PowerManager.java
@@ -620,6 +620,7 @@
try {
mService.userActivity(when, event, flags);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -671,6 +672,7 @@
try {
mService.goToSleep(time, reason, flags);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -697,6 +699,7 @@
try {
mService.wakeUp(time, "wakeUp", mContext.getOpPackageName());
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -707,6 +710,7 @@
try {
mService.wakeUp(time, reason, mContext.getOpPackageName());
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -735,6 +739,7 @@
try {
mService.nap(time);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -757,6 +762,7 @@
try {
mService.boostScreenBrightness(time);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -772,7 +778,7 @@
try {
return mService.isScreenBrightnessBoosted();
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -790,6 +796,7 @@
try {
mService.setTemporaryScreenBrightnessSettingOverride(brightness);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -803,7 +810,7 @@
try {
return mService.isWakeLockLevelSupported(level);
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -867,7 +874,7 @@
try {
return mService.isInteractive();
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -884,6 +891,7 @@
try {
mService.reboot(false, reason, true);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -899,7 +907,7 @@
try {
return mService.isPowerSaveMode();
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -916,7 +924,7 @@
try {
return mService.setPowerSaveMode(mode);
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -936,7 +944,7 @@
try {
return mService.isDeviceIdleMode();
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -956,7 +964,7 @@
try {
return mService.isLightDeviceIdleMode();
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -975,7 +983,7 @@
try {
return mIDeviceIdleController.isPowerSaveWhitelistApp(packageName);
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -992,6 +1000,7 @@
try {
mService.shutdown(confirm, reason, wait);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -1118,6 +1127,7 @@
try {
mService.releaseWakeLock(mToken, 0);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
}
@@ -1186,6 +1196,7 @@
mService.acquireWakeLock(mToken, mFlags, mTag, mPackageName, mWorkSource,
mHistoryTag);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
mHeld = true;
}
@@ -1224,6 +1235,7 @@
try {
mService.releaseWakeLock(mToken, flags);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
mHeld = false;
}
@@ -1280,6 +1292,7 @@
try {
mService.updateWakeLockWorkSource(mToken, mWorkSource, mHistoryTag);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
}
diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java
index 4c015ba..859df43 100644
--- a/core/java/android/view/inputmethod/InputMethodManager.java
+++ b/core/java/android/view/inputmethod/InputMethodManager.java
@@ -664,7 +664,7 @@
try {
return mService.getInputMethodList();
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -672,7 +672,7 @@
try {
return mService.getEnabledInputMethodList();
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -689,7 +689,7 @@
return mService.getEnabledInputMethodSubtypeList(
imi == null ? null : imi.getId(), allowsImplicitlySelectedSubtypes);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -697,7 +697,7 @@
try {
mService.updateStatusIcon(imeToken, packageName, iconId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -705,7 +705,7 @@
try {
mService.updateStatusIcon(imeToken, null, 0);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -714,7 +714,7 @@
try {
mService.setImeWindowStatus(imeToken, vis, backDisposition);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -728,7 +728,7 @@
try {
mService.registerSuggestionSpansForNotification(spans);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -737,7 +737,7 @@
try {
mService.notifySuggestionPicked(span, originalString, index);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -833,6 +833,7 @@
try {
mService.finishInput(mClient);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
notifyInputConnectionFinished();
@@ -996,9 +997,8 @@
try {
return mService.showSoftInput(mClient, flags, resultReceiver);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
-
- return false;
}
}
@@ -1007,6 +1007,7 @@
try {
mService.showSoftInput(mClient, flags, resultReceiver);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -1065,8 +1066,8 @@
try {
return mService.hideSoftInput(mClient, flags, resultReceiver);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
- return false;
}
}
@@ -1421,6 +1422,7 @@
try {
mService.hideSoftInput(mClient, HIDE_NOT_ALWAYS, null);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -1476,6 +1478,7 @@
rootView.getWindowToken(), controlFlags, softInputMode, windowFlags, null,
null);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
}
@@ -1716,7 +1719,7 @@
try {
mService.setInputMethod(token, id);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1733,7 +1736,7 @@
try {
mService.setInputMethodAndSubtype(token, id, subtype);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1753,7 +1756,7 @@
try {
mService.hideMySoftInput(token, flags);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1774,7 +1777,7 @@
try {
mService.showMySoftInput(token, flags);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1980,7 +1983,7 @@
SHOW_IM_PICKER_MODE_EXCLUDE_AUXILIARY_SUBTYPES;
mService.showInputMethodPickerFromClient(mClient, mode);
} catch (RemoteException e) {
- Log.w(TAG, "IME died: " + mCurId, e);
+ throw e.rethrowFromSystemServer();
}
}
}
@@ -1989,7 +1992,7 @@
try {
mService.showInputMethodPickerFromClient(mClient, SHOW_IM_PICKER_MODE_AUTO);
} catch (RemoteException e) {
- Log.w(TAG, "IME died: " + mCurId, e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -2003,7 +2006,7 @@
try {
mService.showInputMethodAndSubtypeEnablerFromClient(mClient, imiId);
} catch (RemoteException e) {
- Log.w(TAG, "IME died: " + mCurId, e);
+ throw e.rethrowFromSystemServer();
}
}
}
@@ -2018,8 +2021,7 @@
try {
return mService.getCurrentInputMethodSubtype();
} catch (RemoteException e) {
- Log.w(TAG, "IME died: " + mCurId, e);
- return null;
+ throw e.rethrowFromSystemServer();
}
}
}
@@ -2036,8 +2038,7 @@
try {
return mService.setCurrentInputMethodSubtype(subtype);
} catch (RemoteException e) {
- Log.w(TAG, "IME died: " + mCurId, e);
- return false;
+ throw e.rethrowFromSystemServer();
}
}
}
@@ -2071,7 +2072,7 @@
mLastSentUserActionNotificationSequenceNumber =
mNextUserActionNotificationSequenceNumber;
} catch (RemoteException e) {
- Log.w(TAG, "IME died: " + mCurId, e);
+ throw e.rethrowFromSystemServer();
}
}
}
@@ -2104,7 +2105,7 @@
}
}
} catch (RemoteException e) {
- Log.w(TAG, "IME died: " + mCurId, e);
+ throw e.rethrowFromSystemServer();
}
return ret;
}
@@ -2119,8 +2120,7 @@
try {
return mService.getInputMethodWindowVisibleHeight();
} catch (RemoteException e) {
- Log.w(TAG, "IME died: " + mCurId, e);
- return 0;
+ throw e.rethrowFromSystemServer();
}
}
}
@@ -2139,8 +2139,7 @@
try {
return mService.switchToLastInputMethod(imeToken);
} catch (RemoteException e) {
- Log.w(TAG, "IME died: " + mCurId, e);
- return false;
+ throw e.rethrowFromSystemServer();
}
}
}
@@ -2160,8 +2159,7 @@
try {
return mService.switchToNextInputMethod(imeToken, onlyCurrentIme);
} catch (RemoteException e) {
- Log.w(TAG, "IME died: " + mCurId, e);
- return false;
+ throw e.rethrowFromSystemServer();
}
}
}
@@ -2182,8 +2180,7 @@
try {
return mService.shouldOfferSwitchingToNextInputMethod(imeToken);
} catch (RemoteException e) {
- Log.w(TAG, "IME died: " + mCurId, e);
- return false;
+ throw e.rethrowFromSystemServer();
}
}
}
@@ -2218,7 +2215,7 @@
try {
mService.setAdditionalInputMethodSubtypes(imiId, subtypes);
} catch (RemoteException e) {
- Log.w(TAG, "IME died: " + mCurId, e);
+ throw e.rethrowFromSystemServer();
}
}
}
@@ -2228,8 +2225,7 @@
try {
return mService.getLastInputMethodSubtype();
} catch (RemoteException e) {
- Log.w(TAG, "IME died: " + mCurId, e);
- return null;
+ throw e.rethrowFromSystemServer();
}
}
}
diff --git a/media/java/android/media/midi/MidiManager.java b/media/java/android/media/midi/MidiManager.java
index 266b0d9..07c8ae8 100644
--- a/media/java/android/media/midi/MidiManager.java
+++ b/media/java/android/media/midi/MidiManager.java
@@ -186,8 +186,7 @@
try {
mService.registerListener(mToken, deviceListener);
} catch (RemoteException e) {
- Log.e(TAG, "RemoteException in registerDeviceListener");
- return;
+ throw e.rethrowFromSystemServer();
}
mDeviceListeners.put(callback, deviceListener);
}
@@ -203,7 +202,7 @@
try {
mService.unregisterListener(mToken, deviceListener);
} catch (RemoteException e) {
- Log.e(TAG, "RemoteException in unregisterDeviceListener");
+ throw e.rethrowFromSystemServer();
}
}
}
@@ -217,8 +216,7 @@
try {
return mService.getDevices();
} catch (RemoteException e) {
- Log.e(TAG, "RemoteException in getDevices");
- return new MidiDeviceInfo[0];
+ throw e.rethrowFromSystemServer();
}
}
@@ -267,7 +265,7 @@
try {
mService.openDevice(mToken, deviceInfo, callback);
} catch (RemoteException e) {
- Log.e(TAG, "RemoteException in openDevice");
+ throw e.rethrowFromSystemServer();
}
}
@@ -306,7 +304,7 @@
try {
mService.openBluetoothDevice(mToken, bluetoothDevice, callback);
} catch (RemoteException e) {
- Log.e(TAG, "RemoteException in openDevice");
+ throw e.rethrowFromSystemServer();
}
}
@@ -326,8 +324,7 @@
}
return server;
} catch (RemoteException e) {
- Log.e(TAG, "RemoteException in createVirtualDevice");
- return null;
+ throw e.rethrowFromSystemServer();
}
}
}
diff --git a/media/java/android/media/soundtrigger/SoundTriggerManager.java b/media/java/android/media/soundtrigger/SoundTriggerManager.java
index 4fd3310..fdd7fc2 100644
--- a/media/java/android/media/soundtrigger/SoundTriggerManager.java
+++ b/media/java/android/media/soundtrigger/SoundTriggerManager.java
@@ -69,6 +69,7 @@
try {
mSoundTriggerService.updateSoundModel(model.getGenericSoundModel());
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -81,7 +82,7 @@
return new Model(mSoundTriggerService.getSoundModel(
new ParcelUuid(soundModelId)));
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -92,6 +93,7 @@
try {
mSoundTriggerService.deleteSoundModel(new ParcelUuid(soundModelId));
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
diff --git a/media/java/android/media/tv/TvInputManager.java b/media/java/android/media/tv/TvInputManager.java
index 59dfbee..0b0306c 100644
--- a/media/java/android/media/tv/TvInputManager.java
+++ b/media/java/android/media/tv/TvInputManager.java
@@ -1111,7 +1111,7 @@
}
}
} catch (RemoteException e) {
- Log.e(TAG, "TvInputManager initialization failed", e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1124,7 +1124,7 @@
try {
return mService.getTvInputList(mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1140,7 +1140,7 @@
try {
return mService.getTvInputInfo(inputId, mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1157,7 +1157,7 @@
try {
mService.updateTvInputInfo(inputInfo, mUserId);
} catch (RemoteException e) {
- throw new RuntimeException("Error trying to update " + inputInfo, e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1228,7 +1228,7 @@
try {
return mService.isParentalControlsEnabled(mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1245,7 +1245,7 @@
try {
mService.setParentalControlsEnabled(enabled, mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1260,7 +1260,7 @@
try {
return mService.isRatingBlocked(rating.flattenToString(), mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1279,7 +1279,7 @@
}
return ratings;
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1297,7 +1297,7 @@
try {
mService.addBlockedRating(rating.flattenToString(), mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1315,7 +1315,7 @@
try {
mService.removeBlockedRating(rating.flattenToString(), mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1328,7 +1328,7 @@
try {
return mService.getTvContentRatingSystemList(mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1378,7 +1378,7 @@
try {
mService.createSession(mClient, inputId, isRecordingSession, seq, mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
}
@@ -1402,7 +1402,7 @@
try {
return mService.getAvailableTvStreamConfigList(inputId, mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1420,7 +1420,7 @@
try {
return mService.captureFrame(inputId, surface, config, mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1434,7 +1434,7 @@
try {
return mService.isSingleSessionActive(mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1448,7 +1448,7 @@
try {
return mService.getHardwareList();
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1478,7 +1478,7 @@
}
}, info, mUserId));
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1492,7 +1492,7 @@
try {
mService.releaseTvInputHardware(deviceId, hardware.getInterface(), mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1506,7 +1506,7 @@
try {
return mService.getDvbDeviceList();
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1529,7 +1529,7 @@
}
return mService.openDvbDevice(info, device);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1600,7 +1600,7 @@
try {
mService.releaseSession(mToken, mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
releaseInternal();
@@ -1620,7 +1620,7 @@
try {
mService.setMainSession(mToken, mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1638,7 +1638,7 @@
try {
mService.setSurface(mToken, surface, mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1660,7 +1660,7 @@
try {
mService.dispatchSurfaceChanged(mToken, format, width, height, mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1681,7 +1681,7 @@
}
mService.setVolume(mToken, volume, mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1721,7 +1721,7 @@
try {
mService.tune(mToken, channelUri, params, mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1738,7 +1738,7 @@
try {
mService.setCaptionEnabled(mToken, enabled, mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1780,7 +1780,7 @@
try {
mService.selectTrack(mToken, type, trackId, mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1928,7 +1928,7 @@
try {
mService.timeShiftPlay(mToken, recordedProgramUri, mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1943,7 +1943,7 @@
try {
mService.timeShiftPause(mToken, mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1958,7 +1958,7 @@
try {
mService.timeShiftResume(mToken, mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1979,7 +1979,7 @@
try {
mService.timeShiftSeekTo(mToken, timeMs, mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -1996,7 +1996,7 @@
try {
mService.timeShiftSetPlaybackParams(mToken, params, mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -2013,7 +2013,7 @@
try {
mService.timeShiftEnablePositionTracking(mToken, enable, mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -2031,7 +2031,7 @@
try {
mService.startRecording(mToken, programHint, mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -2046,7 +2046,7 @@
try {
mService.stopRecording(mToken, mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -2069,7 +2069,7 @@
try {
mService.sendAppPrivateCommand(mToken, action, data, mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -2097,7 +2097,7 @@
try {
mService.createOverlayView(mToken, view.getWindowToken(), frame, mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -2115,7 +2115,7 @@
try {
mService.relayoutOverlayView(mToken, frame, mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -2130,7 +2130,7 @@
try {
mService.removeOverlayView(mToken, mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -2146,7 +2146,7 @@
try {
mService.unblockContent(mToken, unblockedRating.flattenToString(), mUserId);
} catch (RemoteException e) {
- throw new RuntimeException(e);
+ throw e.rethrowFromSystemServer();
}
}
diff --git a/services/usage/java/com/android/server/usage/UsageStatsService.java b/services/usage/java/com/android/server/usage/UsageStatsService.java
index 8b250f4..8da1785 100644
--- a/services/usage/java/com/android/server/usage/UsageStatsService.java
+++ b/services/usage/java/com/android/server/usage/UsageStatsService.java
@@ -437,7 +437,7 @@
return false;
}
} catch (RemoteException re) {
- return false;
+ throw re.rethrowFromSystemServer();
}
final long elapsedRealtime = SystemClock.elapsedRealtime();
@@ -805,6 +805,7 @@
return false;
}
} catch (RemoteException re) {
+ throw re.rethrowFromSystemServer();
}
if (isActiveDeviceAdmin(packageName, userId)) {
@@ -849,7 +850,7 @@
}
apps = slice.getList();
} catch (RemoteException e) {
- return new int[0];
+ throw e.rethrowFromSystemServer();
}
// State of each uid. Key is the uid. Value lower 16 bits is the number of apps
@@ -1258,7 +1259,7 @@
userId = ActivityManagerNative.getDefault().handleIncomingUser(Binder.getCallingPid(),
Binder.getCallingUid(), userId, false, true, "isAppInactive", null);
} catch (RemoteException re) {
- return false;
+ throw re.rethrowFromSystemServer();
}
final long token = Binder.clearCallingIdentity();
try {
@@ -1277,7 +1278,7 @@
Binder.getCallingPid(), callingUid, userId, false, true,
"setAppIdle", null);
} catch (RemoteException re) {
- return;
+ throw re.rethrowFromSystemServer();
}
getContext().enforceCallingPermission(Manifest.permission.CHANGE_APP_IDLE_STATE,
"No permission to change app idle state");
diff --git a/wifi/java/android/net/wifi/RttManager.java b/wifi/java/android/net/wifi/RttManager.java
index 59416b8..13abaff 100644
--- a/wifi/java/android/net/wifi/RttManager.java
+++ b/wifi/java/android/net/wifi/RttManager.java
@@ -300,7 +300,7 @@
try {
mRttCapabilities = mService.getRttCapabilities();
} catch (RemoteException e) {
- Log.e(TAG, "Can not get RTT Capabilities");
+ throw e.rethrowFromSystemServer();
}
}
return mRttCapabilities;
@@ -1132,7 +1132,7 @@
Log.d(TAG, "Get the messenger from " + mService);
messenger = mService.getMessenger();
} catch (RemoteException e) {
- /* do nothing */
+ throw e.rethrowFromSystemServer();
} catch (SecurityException e) {
/* do nothing */
}
diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java
index 4921073..55cb63a 100644
--- a/wifi/java/android/net/wifi/WifiManager.java
+++ b/wifi/java/android/net/wifi/WifiManager.java
@@ -723,8 +723,7 @@
try {
return mService.getConfiguredNetworks();
} catch (RemoteException e) {
- Log.w(TAG, "Caught RemoteException trying to get configured networks: " + e);
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -734,7 +733,7 @@
try {
return mService.getPrivilegedConfiguredNetworks();
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -744,7 +743,7 @@
try {
return mService.getConnectionStatistics();
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -758,7 +757,7 @@
try {
return mService.getMatchingWifiConfig(scanResult);
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -818,7 +817,7 @@
try {
return mService.addOrUpdateNetwork(config);
} catch (RemoteException e) {
- return -1;
+ throw e.rethrowFromSystemServer();
}
}
@@ -832,7 +831,7 @@
try {
return mService.addPasspointManagementObject(mo);
} catch (RemoteException e) {
- return -1;
+ throw e.rethrowFromSystemServer();
}
}
@@ -848,7 +847,7 @@
try {
return mService.modifyPasspointManagementObject(fqdn, mos);
} catch (RemoteException e) {
- return -1;
+ throw e.rethrowFromSystemServer();
}
}
@@ -862,6 +861,7 @@
try {
mService.queryPasspointIcon(bssid, fileName);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -875,7 +875,7 @@
try {
return mService.matchProviderWithCurrentNetwork(fqdn);
} catch (RemoteException e) {
- return -1;
+ throw e.rethrowFromSystemServer();
}
}
@@ -889,6 +889,7 @@
try {
mService.deauthenticateNetwork(holdoff, ess);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -922,7 +923,7 @@
try {
return mService.removeNetwork(netId);
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -962,7 +963,7 @@
try {
success = mService.enableNetwork(netId, disableOthers);
} catch (RemoteException e) {
- success = false;
+ throw e.rethrowFromSystemServer();
}
if (pin && !success) {
@@ -983,7 +984,7 @@
try {
return mService.disableNetwork(netId);
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -997,7 +998,7 @@
mService.disconnect();
return true;
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1012,7 +1013,7 @@
mService.reconnect();
return true;
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1027,7 +1028,7 @@
mService.reassociate();
return true;
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1042,7 +1043,7 @@
try {
return mService.pingSupplicant();
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1090,7 +1091,7 @@
try {
return mService.getSupportedFeatures();
} catch (RemoteException e) {
- return 0;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1216,9 +1217,8 @@
return mService.reportActivityInfo();
}
} catch (RemoteException e) {
- Log.e(TAG, "getControllerActivityEnergyInfo: " + e);
+ throw e.rethrowFromSystemServer();
}
- return null;
}
/**
@@ -1232,7 +1232,7 @@
mService.startScan(null, null);
return true;
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1243,7 +1243,7 @@
mService.startScan(null, workSource);
return true;
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1299,7 +1299,7 @@
try {
return mService.getWpsNfcConfigurationToken(netId);
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1311,7 +1311,7 @@
try {
return mService.getConnectionInfo();
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1328,7 +1328,7 @@
try {
return mService.getScanResults(mContext.getOpPackageName());
} catch (RemoteException e) {
- return new ArrayList<ScanResult>();
+ throw e.rethrowFromSystemServer();
}
}
@@ -1344,7 +1344,7 @@
try {
return mService.isScanAlwaysAvailable();
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1361,7 +1361,7 @@
try {
return mService.saveConfiguration();
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1375,7 +1375,9 @@
public void setCountryCode(String country, boolean persist) {
try {
mService.setCountryCode(country, persist);
- } catch (RemoteException e) { }
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
}
/**
@@ -1387,9 +1389,9 @@
public String getCountryCode() {
try {
String country = mService.getCountryCode();
- return(country);
+ return country;
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1405,7 +1407,9 @@
public void setFrequencyBand(int band, boolean persist) {
try {
mService.setFrequencyBand(band, persist);
- } catch (RemoteException e) { }
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
}
/**
@@ -1421,7 +1425,7 @@
try {
return mService.getFrequencyBand();
} catch (RemoteException e) {
- return -1;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1434,7 +1438,7 @@
try {
return mService.isDualBandSupported();
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1447,7 +1451,7 @@
try {
return mService.getDhcpInfo();
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1461,7 +1465,7 @@
try {
return mService.setWifiEnabled(enabled);
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1476,7 +1480,7 @@
try {
return mService.getWifiEnabledState();
} catch (RemoteException e) {
- return WIFI_STATE_UNKNOWN;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1553,7 +1557,7 @@
mService.setWifiApEnabled(wifiConfig, enabled);
return true;
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1571,7 +1575,7 @@
try {
return mService.getWifiApEnabledState();
} catch (RemoteException e) {
- return WIFI_AP_STATE_FAILED;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1598,7 +1602,7 @@
try {
return mService.getWifiApConfiguration();
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1612,8 +1616,7 @@
try {
return mService.buildWifiConfig(uriString, mimeType, data);
} catch (RemoteException e) {
- Log.w(TAG, "Caught RemoteException trying to build wifi config: " + e);
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1629,7 +1632,7 @@
mService.setWifiApConfiguration(wifiConfig);
return true;
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1646,7 +1649,7 @@
mService.addToBlacklist(bssid);
return true;
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1663,7 +1666,7 @@
mService.clearBlacklist();
return true;
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1692,7 +1695,7 @@
try {
mService.enableTdls(remoteIPAddress.getHostAddress(), enable);
} catch (RemoteException e) {
- // Just ignore the exception
+ throw e.rethrowFromSystemServer();
}
}
@@ -1706,7 +1709,7 @@
try {
mService.enableTdlsWithMacAddress(remoteMacAddress, enable);
} catch (RemoteException e) {
- // Just ignore the exception
+ throw e.rethrowFromSystemServer();
}
}
@@ -2219,6 +2222,7 @@
try {
mService.disableEphemeralNetwork(SSID);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -2259,7 +2263,7 @@
try {
return mService.getWifiServiceMessenger();
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
} catch (SecurityException e) {
return null;
}
@@ -2274,7 +2278,7 @@
try {
return mService.getConfigFile();
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -2340,7 +2344,8 @@
}
mActiveLockCount++;
}
- } catch (RemoteException ignore) {
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
mHeld = true;
}
@@ -2367,7 +2372,8 @@
synchronized (WifiManager.this) {
mActiveLockCount--;
}
- } catch (RemoteException ignore) {
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
mHeld = false;
}
@@ -2427,6 +2433,7 @@
try {
mService.updateWifiLockWorkSource(mBinder, mWorkSource);
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
}
@@ -2456,7 +2463,8 @@
synchronized (WifiManager.this) {
mActiveLockCount--;
}
- } catch (RemoteException ignore) {
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
}
@@ -2572,7 +2580,8 @@
}
mActiveLockCount++;
}
- } catch (RemoteException ignore) {
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
mHeld = true;
}
@@ -2611,7 +2620,8 @@
synchronized (WifiManager.this) {
mActiveLockCount--;
}
- } catch (RemoteException ignore) {
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
mHeld = false;
}
@@ -2685,7 +2695,7 @@
try {
return mService.isMulticastEnabled();
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -2698,7 +2708,7 @@
mService.initializeMulticastFiltering();
return true;
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -2736,7 +2746,7 @@
try {
return mService.getVerboseLoggingLevel();
} catch (RemoteException e) {
- return 0;
+ throw e.rethrowFromSystemServer();
}
}
@@ -2748,7 +2758,7 @@
try {
mService.enableAggressiveHandover(enabled);
} catch (RemoteException e) {
-
+ throw e.rethrowFromSystemServer();
}
}
@@ -2761,7 +2771,7 @@
try {
return mService.getAggressiveHandover();
} catch (RemoteException e) {
- return 0;
+ throw e.rethrowFromSystemServer();
}
}
@@ -2773,7 +2783,7 @@
try {
mService.setAllowScansWithTraffic(enabled);
} catch (RemoteException e) {
-
+ throw e.rethrowFromSystemServer();
}
}
@@ -2785,7 +2795,7 @@
try {
return mService.getAllowScansWithTraffic();
} catch (RemoteException e) {
- return 0;
+ throw e.rethrowFromSystemServer();
}
}
@@ -2798,6 +2808,7 @@
try {
mService.factoryReset();
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -2810,7 +2821,7 @@
try {
return mService.getCurrentNetwork();
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -2824,7 +2835,7 @@
try {
return mService.enableAutoJoinWhenAssociated(enabled);
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
@@ -2836,7 +2847,7 @@
try {
return mService.getEnableAutoJoinWhenAssociated();
} catch (RemoteException e) {
- return false;
+ throw e.rethrowFromSystemServer();
}
}
/**
@@ -2847,7 +2858,7 @@
try {
mService.setHalBasedAutojoinOffload(enabled);
} catch (RemoteException e) {
-
+ throw e.rethrowFromSystemServer();
}
}
@@ -2859,7 +2870,7 @@
try {
return mService.getHalBasedAutojoinOffload();
} catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
- return 0;
}
}
diff --git a/wifi/java/android/net/wifi/nan/WifiNanManager.java b/wifi/java/android/net/wifi/nan/WifiNanManager.java
index 667c4b1..1b78beb 100644
--- a/wifi/java/android/net/wifi/nan/WifiNanManager.java
+++ b/wifi/java/android/net/wifi/nan/WifiNanManager.java
@@ -75,7 +75,7 @@
}
mService.connect(mBinder, listener.callback, events);
} catch (RemoteException e) {
- Log.w(TAG, "connect RemoteException (FYI - ignoring): " + e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -94,7 +94,7 @@
mService.disconnect(mBinder);
mBinder = null;
} catch (RemoteException e) {
- Log.w(TAG, "disconnect RemoteException (FYI - ignoring): " + e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -116,7 +116,7 @@
try {
mService.requestConfig(configRequest);
} catch (RemoteException e) {
- Log.w(TAG, "requestConfig RemoteException (FYI - ignoring): " + e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -173,8 +173,7 @@
if (DBG) Log.d(TAG, "publish: session created - sessionId=" + sessionId);
mService.publish(sessionId, publishData, publishSettings);
} catch (RemoteException e) {
- Log.w(TAG, "createSession/publish RemoteException: " + e);
- return null;
+ throw e.rethrowFromSystemServer();
}
return new WifiNanPublishSession(this, sessionId);
@@ -200,7 +199,7 @@
try {
mService.publish(sessionId, publishData, publishSettings);
} catch (RemoteException e) {
- Log.w(TAG, "publish RemoteException: " + e);
+ throw e.rethrowFromSystemServer();
}
}
/**
@@ -256,8 +255,7 @@
if (DBG) Log.d(TAG, "subscribe: session created - sessionId=" + sessionId);
mService.subscribe(sessionId, subscribeData, subscribeSettings);
} catch (RemoteException e) {
- Log.w(TAG, "createSession/subscribe RemoteException: " + e);
- return null;
+ throw e.rethrowFromSystemServer();
}
return new WifiNanSubscribeSession(this, sessionId);
@@ -286,7 +284,7 @@
try {
mService.subscribe(sessionId, subscribeData, subscribeSettings);
} catch (RemoteException e) {
- Log.w(TAG, "subscribe RemoteException: " + e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -299,7 +297,7 @@
try {
mService.stopSession(sessionId);
} catch (RemoteException e) {
- Log.w(TAG, "stopSession RemoteException (FYI - ignoring): " + e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -312,7 +310,7 @@
try {
mService.destroySession(sessionId);
} catch (RemoteException e) {
- Log.w(TAG, "destroySession RemoteException (FYI - ignoring): " + e);
+ throw e.rethrowFromSystemServer();
}
}
@@ -328,7 +326,7 @@
}
mService.sendMessage(sessionId, peerId, message, messageLength, messageId);
} catch (RemoteException e) {
- Log.w(TAG, "subscribe RemoteException (FYI - ignoring): " + e);
+ throw e.rethrowFromSystemServer();
}
}
}
diff --git a/wifi/java/android/net/wifi/p2p/WifiP2pManager.java b/wifi/java/android/net/wifi/p2p/WifiP2pManager.java
index 6409450..8d5cf63 100644
--- a/wifi/java/android/net/wifi/p2p/WifiP2pManager.java
+++ b/wifi/java/android/net/wifi/p2p/WifiP2pManager.java
@@ -1362,8 +1362,8 @@
public void setMiracastMode(int mode) {
try {
mService.setMiracastMode(mode);
- } catch(RemoteException e) {
- // ignore
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
}
@@ -1378,7 +1378,7 @@
try {
return mService.getMessenger();
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}
@@ -1393,7 +1393,7 @@
try {
return mService.getP2pStateMachineMessenger();
} catch (RemoteException e) {
- return null;
+ throw e.rethrowFromSystemServer();
}
}