@@ -1852,8 +1852,13 @@ private void sendDataActivityBroadcast(int deviceType, boolean active) {
18521852 Intent intent = new Intent (ConnectivityManager .ACTION_DATA_ACTIVITY_CHANGE );
18531853 intent .putExtra (ConnectivityManager .EXTRA_DEVICE_TYPE , deviceType );
18541854 intent .putExtra (ConnectivityManager .EXTRA_IS_ACTIVE , active );
1855- mContext .sendOrderedBroadcastAsUser (intent , UserHandle .ALL ,
1856- RECEIVE_DATA_ACTIVITY_CHANGE , null , null , 0 , null , null );
1855+ final long ident = Binder .clearCallingIdentity ();
1856+ try {
1857+ mContext .sendOrderedBroadcastAsUser (intent , UserHandle .ALL ,
1858+ RECEIVE_DATA_ACTIVITY_CHANGE , null , null , 0 , null , null );
1859+ } finally {
1860+ Binder .restoreCallingIdentity (ident );
1861+ }
18571862 }
18581863
18591864 /**
@@ -1927,7 +1932,12 @@ private void sendStickyBroadcast(Intent intent) {
19271932 log ("sendStickyBroadcast: action=" + intent .getAction ());
19281933 }
19291934
1930- mContext .sendStickyBroadcastAsUser (intent , UserHandle .ALL );
1935+ final long ident = Binder .clearCallingIdentity ();
1936+ try {
1937+ mContext .sendStickyBroadcastAsUser (intent , UserHandle .ALL );
1938+ } finally {
1939+ Binder .restoreCallingIdentity (ident );
1940+ }
19311941 }
19321942 }
19331943
@@ -2467,7 +2477,12 @@ private void bumpDns() {
24672477 * Connectivity events can happen before boot has completed ...
24682478 */
24692479 intent .addFlags (Intent .FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT );
2470- mContext .sendBroadcastAsUser (intent , UserHandle .ALL );
2480+ final long ident = Binder .clearCallingIdentity ();
2481+ try {
2482+ mContext .sendBroadcastAsUser (intent , UserHandle .ALL );
2483+ } finally {
2484+ Binder .restoreCallingIdentity (ident );
2485+ }
24712486 }
24722487
24732488 // Caller must grab mDnsLock.
@@ -3112,7 +3127,12 @@ private void sendProxyBroadcast(ProxyProperties proxy) {
31123127 intent .addFlags (Intent .FLAG_RECEIVER_REPLACE_PENDING |
31133128 Intent .FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT );
31143129 intent .putExtra (Proxy .EXTRA_PROXY_INFO , proxy );
3115- mContext .sendStickyBroadcastAsUser (intent , UserHandle .ALL );
3130+ final long ident = Binder .clearCallingIdentity ();
3131+ try {
3132+ mContext .sendStickyBroadcastAsUser (intent , UserHandle .ALL );
3133+ } finally {
3134+ Binder .restoreCallingIdentity (ident );
3135+ }
31163136 }
31173137
31183138 private static class SettingsObserver extends ContentObserver {
0 commit comments