diff --git a/src/com/android/settings/applications/AdvancedAppSettings.java b/src/com/android/settings/applications/AdvancedAppSettings.java
index 47a0098..7df269e 100644
--- a/src/com/android/settings/applications/AdvancedAppSettings.java
+++ b/src/com/android/settings/applications/AdvancedAppSettings.java
@@ -15,6 +15,7 @@
  */
 package com.android.settings.applications;
 
+import android.content.BroadcastReceiver;
 import android.content.Intent;
 import android.content.pm.ApplicationInfo;
 import android.os.Bundle;
@@ -45,6 +46,8 @@
     private Preference mAppDomainURLsPreference;
     private Preference mHighPowerPreference;
 
+    private BroadcastReceiver mPermissionReceiver;
+
     @Override
     public void onCreate(Bundle icicle) {
         super.onCreate(icicle);
@@ -63,6 +66,15 @@
         updateUI();
     }
 
+    @Override
+    public void onDestroy() {
+        super.onDestroy();
+        if (mPermissionReceiver != null) {
+            getContext().unregisterReceiver(mPermissionReceiver);
+            mPermissionReceiver = null;
+        }
+    }
+
     private void updateUI() {
         ArrayList<AppEntry> allApps = mSession.getAllApps();
 
@@ -79,7 +91,12 @@
         int highPowerCount = PowerWhitelistBackend.getInstance().getWhitelistSize();
         mHighPowerPreference.setSummary(getResources().getQuantityString(R.plurals.high_power_count,
                 highPowerCount, highPowerCount));
-        PermissionsSummaryHelper.getAppWithPermissionsCounts(getContext(), mPermissionCallback);
+
+        if (mPermissionReceiver != null) {
+            getContext().unregisterReceiver(mPermissionReceiver);
+        }
+        mPermissionReceiver = PermissionsSummaryHelper.getAppWithPermissionsCounts(getContext(),
+                mPermissionCallback);
     }
 
     @Override
@@ -133,6 +150,7 @@
             if (getActivity() == null) {
                 return;
             }
+            mPermissionReceiver = null;
             if (counts != null) {
                 mAppPermsPreference.setSummary(getContext().getString(
                         R.string.app_permissions_summary, counts[0], counts[1]));
diff --git a/src/com/android/settings/applications/InstalledAppDetails.java b/src/com/android/settings/applications/InstalledAppDetails.java
index a275743..842660b 100755
--- a/src/com/android/settings/applications/InstalledAppDetails.java
+++ b/src/com/android/settings/applications/InstalledAppDetails.java
@@ -157,6 +157,8 @@
     protected ProcStatsData mStatsManager;
     protected ProcStatsPackageEntry mStats;
 
+    private BroadcastReceiver mPermissionReceiver;
+
     private boolean handleDisableable(Button button) {
         boolean disableable = false;
         // Try to prevent the user from bricking their phone
@@ -312,6 +314,10 @@
     @Override
     public void onDestroy() {
         TrafficStats.closeQuietly(mStatsSession);
+        if (mPermissionReceiver != null) {
+            getContext().unregisterReceiver(mPermissionReceiver);
+            mPermissionReceiver = null;
+        }
 
         super.onDestroy();
     }
@@ -489,8 +495,11 @@
         // Update the preference summaries.
         Activity context = getActivity();
         mStoragePreference.setSummary(AppStorageSettings.getSummary(mAppEntry, context));
-        PermissionsSummaryHelper.getPermissionSummary(getContext(), mPackageName,
-                mPermissionCallback);
+        if (mPermissionReceiver != null) {
+            getContext().unregisterReceiver(mPermissionReceiver);
+        }
+        mPermissionReceiver = PermissionsSummaryHelper.getPermissionSummary(getContext(),
+                mPackageName, mPermissionCallback);
         mLaunchPreference.setSummary(Utils.getLaunchByDeafaultSummary(mAppEntry, mUsbManager,
                 mPm, context));
         mNotificationPreference.setSummary(getNotificationSummary(mAppEntry, context,
@@ -941,6 +950,10 @@
             = new PermissionsResultCallback() {
         @Override
         public void onPermissionSummaryResult(int[] counts, CharSequence[] groupLabels) {
+            if (getActivity() == null) {
+                return;
+            }
+            mPermissionReceiver = null;
             final Resources res = getResources();
             CharSequence summary = null;
             boolean enabled = false;
diff --git a/src/com/android/settings/applications/PermissionsSummaryHelper.java b/src/com/android/settings/applications/PermissionsSummaryHelper.java
index 1b384ea..859e446 100644
--- a/src/com/android/settings/applications/PermissionsSummaryHelper.java
+++ b/src/com/android/settings/applications/PermissionsSummaryHelper.java
@@ -27,21 +27,21 @@
     private static final String ACTION_APP_COUNT_RESPONSE
             = "com.android.settings.APP_COUNT_RESPONSE";
 
-    public static void getPermissionSummary(Context context, String pkg,
+    public static BroadcastReceiver getPermissionSummary(Context context, String pkg,
             PermissionsResultCallback callback) {
         Intent request = new Intent(Intent.ACTION_GET_PERMISSIONS_COUNT);
         request.putExtra(Intent.EXTRA_PACKAGE_NAME, pkg);
-        sendPermissionRequest(context, ACTION_PERM_COUNT_RESPONSE, request, callback);
+        return sendPermissionRequest(context, ACTION_PERM_COUNT_RESPONSE, request, callback);
     }
 
-    public static void getAppWithPermissionsCounts(Context context,
+    public static BroadcastReceiver getAppWithPermissionsCounts(Context context,
             PermissionsResultCallback callback) {
         Intent request = new Intent(Intent.ACTION_GET_PERMISSIONS_COUNT);
-        sendPermissionRequest(context, ACTION_APP_COUNT_RESPONSE, request, callback);
+        return sendPermissionRequest(context, ACTION_APP_COUNT_RESPONSE, request, callback);
     }
 
-    private static void sendPermissionRequest(Context context, String action, Intent request,
-            final PermissionsResultCallback callback) {
+    private static BroadcastReceiver sendPermissionRequest(Context context, String action,
+            Intent request, final PermissionsResultCallback callback) {
         BroadcastReceiver receiver = new BroadcastReceiver() {
             @Override
             public void onReceive(Context context, Intent intent) {
@@ -59,6 +59,7 @@
         request.putExtra(Intent.EXTRA_GET_PERMISSIONS_RESPONSE_INTENT, action);
         request.setFlags(Intent.FLAG_RECEIVER_FOREGROUND);
         context.sendBroadcast(request);
+        return receiver;
     }
 
     public interface PermissionsResultCallback {
