summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Heemin Seog <hseog@google.com> 2019-06-12 09:21:44 -0700
committer Heemin Seog <hseog@google.com> 2019-06-13 09:30:19 -0700
commit29ddbd5b687b06f3ef4facafeffb83a4b8d2fa32 (patch)
tree97bc34f9de377db0e46906b79925176422303fc7
parent56dbf7cc45a9a22289fae654f4ff435e58c14a59 (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. Test: build, manual Change-Id: Iea246a4c1939a4e7e35434137051835ece81d92f
-rw-r--r--services/core/java/com/android/server/ConnectivityService.java6
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 f6a972b0906f..fcecb7115089 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -6892,8 +6892,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);