When system server goes down, crash apps more.
Apps making calls into the system server may end up persisting internal state or making security decisions based on the perceived success or failure of a call, or the default values returned. The reality is that if the system process just died, init will be along shortly to kill all running apps, so we should have no problem rethrowing the RemoteException as a RuntimeException. Bug: 27364859 Change-Id: Ife0bcb079636c88d54c44d17eb580409fd79028b
This commit is contained in:
@@ -87,8 +87,8 @@ public class EthernetManager {
|
|||||||
public IpConfiguration getConfiguration() {
|
public IpConfiguration getConfiguration() {
|
||||||
try {
|
try {
|
||||||
return mService.getConfiguration();
|
return mService.getConfiguration();
|
||||||
} catch (NullPointerException | RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
return new IpConfiguration();
|
throw e.rethrowFromSystemServer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,7 +98,8 @@ public class EthernetManager {
|
|||||||
public void setConfiguration(IpConfiguration config) {
|
public void setConfiguration(IpConfiguration config) {
|
||||||
try {
|
try {
|
||||||
mService.setConfiguration(config);
|
mService.setConfiguration(config);
|
||||||
} catch (NullPointerException | RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
|
throw e.rethrowFromSystemServer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,8 +110,8 @@ public class EthernetManager {
|
|||||||
public boolean isAvailable() {
|
public boolean isAvailable() {
|
||||||
try {
|
try {
|
||||||
return mService.isAvailable();
|
return mService.isAvailable();
|
||||||
} catch (NullPointerException | RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
return false;
|
throw e.rethrowFromSystemServer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,7 +128,8 @@ public class EthernetManager {
|
|||||||
if (mListeners.size() == 1) {
|
if (mListeners.size() == 1) {
|
||||||
try {
|
try {
|
||||||
mService.addListener(mServiceListener);
|
mService.addListener(mServiceListener);
|
||||||
} catch (NullPointerException | RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
|
throw e.rethrowFromSystemServer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -145,7 +147,8 @@ public class EthernetManager {
|
|||||||
if (mListeners.isEmpty()) {
|
if (mListeners.isEmpty()) {
|
||||||
try {
|
try {
|
||||||
mService.removeListener(mServiceListener);
|
mService.removeListener(mServiceListener);
|
||||||
} catch (NullPointerException | RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
|
throw e.rethrowFromSystemServer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -619,7 +619,9 @@ public final class NsdManager {
|
|||||||
public void setEnabled(boolean enabled) {
|
public void setEnabled(boolean enabled) {
|
||||||
try {
|
try {
|
||||||
mService.setEnabled(enabled);
|
mService.setEnabled(enabled);
|
||||||
} catch (RemoteException e) { }
|
} catch (RemoteException e) {
|
||||||
|
throw e.rethrowFromSystemServer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -632,7 +634,7 @@ public final class NsdManager {
|
|||||||
try {
|
try {
|
||||||
return mService.getMessenger();
|
return mService.getMessenger();
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
return null;
|
throw e.rethrowFromSystemServer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user