Merge "Call clearCallingIdentity before notifyDnsResponse"
This commit is contained in:
@@ -1761,16 +1761,17 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
// the caller thread of registerNetworkAgent. Thus, it's not allowed to register netd
|
// the caller thread of registerNetworkAgent. Thus, it's not allowed to register netd
|
||||||
// event callback for certain nai. e.g. cellular. Register here to pass to
|
// event callback for certain nai. e.g. cellular. Register here to pass to
|
||||||
// NetworkMonitor instead.
|
// NetworkMonitor instead.
|
||||||
// TODO: Move the Dns Event to NetworkMonitor. Use Binder.clearCallingIdentity() in
|
// TODO: Move the Dns Event to NetworkMonitor. NetdEventListenerService only allow one
|
||||||
// registerNetworkAgent to have NetworkMonitor created with system process as design
|
// callback from each caller type. Need to re-factor NetdEventListenerService to allow
|
||||||
// expectation. Also, NetdEventListenerService only allow one callback from each
|
// multiple NetworkMonitor registrants.
|
||||||
// caller type. Need to re-factor NetdEventListenerService to allow multiple
|
|
||||||
// NetworkMonitor registrants.
|
|
||||||
if (nai != null && nai.satisfies(mDefaultRequest)) {
|
if (nai != null && nai.satisfies(mDefaultRequest)) {
|
||||||
|
final long token = Binder.clearCallingIdentity();
|
||||||
try {
|
try {
|
||||||
nai.networkMonitor().notifyDnsResponse(returnCode);
|
nai.networkMonitor().notifyDnsResponse(returnCode);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
e.rethrowFromSystemServer();
|
e.rethrowFromSystemServer();
|
||||||
|
} finally {
|
||||||
|
Binder.restoreCallingIdentity(token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user