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

Commit 0cf92c0d authored by Christopher Tate's avatar Christopher Tate Committed by Android Git Automerger
Browse files

am db3f8ed7: am 680fac0c: am d606be25: Merge "Don\'t crash when component...

am db3f8ed7: am 680fac0c: am d606be25: Merge "Don\'t crash when component enable/disable broadcasts race with uninstall" into klp-dev

* commit 'db3f8ed7':
  Don't crash when component enable/disable broadcasts race with uninstall
parents 35940428 db3f8ed7
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -1167,12 +1167,20 @@ public class NotificationManagerService extends INotificationManager.Stub
                    }
                    if (packageChanged) {
                        // We cancel notifications for packages which have just been disabled
                        try {
                            final int enabled = mContext.getPackageManager()
                                    .getApplicationEnabledSetting(pkgName);
                            if (enabled == PackageManager.COMPONENT_ENABLED_STATE_ENABLED
                                    || enabled == PackageManager.COMPONENT_ENABLED_STATE_DEFAULT) {
                                cancelNotifications = false;
                            }
                        } catch (IllegalArgumentException e) {
                            // Package doesn't exist; probably racing with uninstall.
                            // cancelNotifications is already true, so nothing to do here.
                            if (DBG) {
                                Slog.i(TAG, "Exception trying to look up app enabled setting", e);
                            }
                        }
                    }
                    pkgList = new String[]{pkgName};
                }