OSDN Git Service

DO NOT MERGE - Kill apps outright for API contract violations
[android-x86/frameworks-base.git] / services / core / java / com / android / server / am / ServiceRecord.java
index 71c7fd3..3ee73da 100644 (file)
@@ -448,6 +448,7 @@ final class ServiceRecord extends Binder {
             final String localPackageName = packageName;
             final int localForegroundId = foregroundId;
             final Notification _foregroundNoti = foregroundNoti;
+            final ServiceRecord record = this;
             ams.mHandler.post(new Runnable() {
                 public void run() {
                     NotificationManagerInternal nm = LocalServices.getService(
@@ -532,10 +533,8 @@ final class ServiceRecord extends Binder {
                         Slog.w(TAG, "Error showing notification for service", e);
                         // If it gave us a garbage notification, it doesn't
                         // get to be foreground.
-                        ams.setServiceForeground(name, ServiceRecord.this,
-                                0, null, 0);
-                        ams.crashApplication(appUid, appPid, localPackageName,
-                                "Bad notification for startForeground: " + e);
+                        ams.mServices.killMisbehavingService(record,
+                                appUid, appPid, localPackageName);
                     }
                 }
             });