summaryrefslogtreecommitdiffstats
path: root/services/java/com/android/server/ConnectivityService.java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2012-09-04 18:48:37 -0700
committerDianne Hackborn <hackbod@google.com>2012-09-04 18:48:37 -0700
commitfd8bf5c790749b0382c9d70424cac2367d6276e3 (patch)
tree99c2e277f5bb882e23da577584632be152f3e1b0 /services/java/com/android/server/ConnectivityService.java
parentd2a8df9541c198d555ef6a50347acb9160509863 (diff)
downloadframeworks_base-fd8bf5c790749b0382c9d70424cac2367d6276e3.zip
frameworks_base-fd8bf5c790749b0382c9d70424cac2367d6276e3.tar.gz
frameworks_base-fd8bf5c790749b0382c9d70424cac2367d6276e3.tar.bz2
Fix another issue #7097984 java.lang.SecurityException: Permission Denial:
broadcast asks to run as user -1 but is calling from user 0; this requires Dupped bug of a different problem. Change-Id: I15f4ab08b81f5f5746ba1cd183dee4f0b1281df5
Diffstat (limited to 'services/java/com/android/server/ConnectivityService.java')
-rw-r--r--services/java/com/android/server/ConnectivityService.java30
1 files changed, 25 insertions, 5 deletions
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java
index 04991bb..cbbfda1 100644
--- a/services/java/com/android/server/ConnectivityService.java
+++ b/services/java/com/android/server/ConnectivityService.java
@@ -1852,8 +1852,13 @@ public class ConnectivityService extends IConnectivityManager.Stub {
Intent intent = new Intent(ConnectivityManager.ACTION_DATA_ACTIVITY_CHANGE);
intent.putExtra(ConnectivityManager.EXTRA_DEVICE_TYPE, deviceType);
intent.putExtra(ConnectivityManager.EXTRA_IS_ACTIVE, active);
- mContext.sendOrderedBroadcastAsUser(intent, UserHandle.ALL,
- RECEIVE_DATA_ACTIVITY_CHANGE, null, null, 0, null, null);
+ final long ident = Binder.clearCallingIdentity();
+ try {
+ mContext.sendOrderedBroadcastAsUser(intent, UserHandle.ALL,
+ RECEIVE_DATA_ACTIVITY_CHANGE, null, null, 0, null, null);
+ } finally {
+ Binder.restoreCallingIdentity(ident);
+ }
}
/**
@@ -1927,7 +1932,12 @@ public class ConnectivityService extends IConnectivityManager.Stub {
log("sendStickyBroadcast: action=" + intent.getAction());
}
- mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL);
+ final long ident = Binder.clearCallingIdentity();
+ try {
+ mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL);
+ } finally {
+ Binder.restoreCallingIdentity(ident);
+ }
}
}
@@ -2467,7 +2477,12 @@ public class ConnectivityService extends IConnectivityManager.Stub {
* Connectivity events can happen before boot has completed ...
*/
intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
- mContext.sendBroadcastAsUser(intent, UserHandle.ALL);
+ final long ident = Binder.clearCallingIdentity();
+ try {
+ mContext.sendBroadcastAsUser(intent, UserHandle.ALL);
+ } finally {
+ Binder.restoreCallingIdentity(ident);
+ }
}
// Caller must grab mDnsLock.
@@ -3112,7 +3127,12 @@ public class ConnectivityService extends IConnectivityManager.Stub {
intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING |
Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
intent.putExtra(Proxy.EXTRA_PROXY_INFO, proxy);
- mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL);
+ final long ident = Binder.clearCallingIdentity();
+ try {
+ mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL);
+ } finally {
+ Binder.restoreCallingIdentity(ident);
+ }
}
private static class SettingsObserver extends ContentObserver {