diff options
author | 2019-06-12 09:21:44 -0700 | |
---|---|---|
committer | 2019-06-13 09:19:48 -0700 | |
commit | 9e31318bffffd319f52dd366b61e5541e743622f (patch) | |
tree | 7efd5841c3b991cdff68dea73d216537b41692ac | |
parent | f5432f186290ef04124496f27f09b1faa7197dcc (diff) |
Change factoryReset to succeed for Settings
Wrap a part of factoryReset with Binder.withCleanCallingIdentity() so
that it doesn't crash thinking that a different uid connected to the
network stack.
Bug: 135029349
Test: build, manual
Change-Id: Iea246a4c1939a4e7e35434137051835ece81d92f
-rw-r--r-- | services/core/java/com/android/server/ConnectivityService.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java index 5027a124e075..1cca0b9d75d3 100644 --- a/services/core/java/com/android/server/ConnectivityService.java +++ b/services/core/java/com/android/server/ConnectivityService.java @@ -6901,8 +6901,10 @@ public class ConnectivityService extends IConnectivityManager.Stub final int userId = UserHandle.getCallingUserId(); - final IpMemoryStore ipMemoryStore = IpMemoryStore.getMemoryStore(mContext); - ipMemoryStore.factoryReset(); + Binder.withCleanCallingIdentity(() -> { + final IpMemoryStore ipMemoryStore = IpMemoryStore.getMemoryStore(mContext); + ipMemoryStore.factoryReset(); + }); // Turn airplane mode off setAirplaneMode(false); |