Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit feec34ce authored by Dan Sandler's avatar Dan Sandler Committed by Android (Google) Code Review
Browse files

Merge "Don't block notifications from system packages." into lmp-dev

parents e1a164bf d283f0fb
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import android.widget.Toast;
import com.android.internal.widget.LockPatternUtils;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.Utils;
import com.android.settings.notification.NotificationAppList.AppRow;
import com.android.settings.notification.NotificationAppList.Backend;

@@ -184,6 +185,12 @@ public class AppNotificationSettings extends SettingsPreferenceFragment {
                }
            });
        }

        // Users cannot block notifications from system/signature packages
        if (Utils.isSystemPackage(pm, info)) {
            getPreferenceScreen().removePreference(mBlock);
            mPriority.setDependency(null); // don't have it depend on a preference that's gone
        }
    }

    private void toastAndFinish() {
@@ -199,7 +206,7 @@ public class AppNotificationSettings extends SettingsPreferenceFragment {
                final String p = packages[i];
                if (pkg.equals(p)) {
                    try {
                        return pm.getPackageInfo(pkg, 0);
                        return pm.getPackageInfo(pkg, PackageManager.GET_SIGNATURES);
                    } catch (NameNotFoundException e) {
                        Log.w(TAG, "Failed to load package " + pkg, e);
                    }
+0 −2
Original line number Diff line number Diff line
@@ -351,7 +351,6 @@ public class NotificationAppList extends PinnedHeaderListFragment
        public boolean priority;
        public boolean sensitive;
        public boolean first;  // first app in section
        public boolean isSystem;
    }

    private static final Comparator<AppRow> mRowComparator = new Comparator<AppRow>() {
@@ -377,7 +376,6 @@ public class NotificationAppList extends PinnedHeaderListFragment
        row.banned = backend.getNotificationsBanned(row.pkg, row.uid);
        row.priority = backend.getHighPriority(row.pkg, row.uid);
        row.sensitive = backend.getSensitive(row.pkg, row.uid);
        row.isSystem = Utils.isSystemPackage(pm, pkg);
        return row;
    }