--- a/frameworks/base/services/core/java/com/android/server/am/AppErrors.java
+++ b/frameworks/base/services/core/java/com/android/server/am/AppErrors.java
@@ -29,6 +29,7 @@ import android.app.AppOpsManager;
import android.app.ApplicationErrorReport;
import android.app.Dialog;
import android.content.ActivityNotFoundException;
+import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
@@ -698,6 +699,7 @@ class AppErrors {
synchronized (mService) {
ProcessRecord proc = data.proc;
AppErrorResult res = data.result;
+ Slog.d(TAG,"packageName = " + data.proc.info.packageName);
if (proc != null && proc.crashDialog != null) {
Slog.e(TAG, "App already has crash dialog: " + proc);
if (res != null) {
@@ -731,7 +733,8 @@ class AppErrors {
}
final boolean crashSilenced = mAppsNotReportingCrashes != null &&
mAppsNotReportingCrashes.contains(proc.info.packageName);
- if ((mService.canShowErrorDialogs() || showBackground) && !crashSilenced) {
+
+ if ((mService.canShowErrorDialogs() || showBackground) && !crashSilenced && !data.proc.info.packageName.equals("com.cloud.smart.agent.service")) {
proc.crashDialog = new AppErrorDialog(mContext, mService, data);
} else {
// The device is asleep, so just pretend that the user
@@ -739,6 +742,9 @@ class AppErrors {
if (res != null) {
res.set(AppErrorDialog.CANT_SHOW);
}
+ if (data.proc.info.packageName.equals("com.cloud.smart.agent.service")) {
+ startAgentService(mContext);
+ }
}
}
// If we've created a crash dialog, show it without the lock held
@@ -747,6 +753,15 @@ class AppErrors {
}
}
+ static final void startAgentService(Context context) {
+ Intent intent = new Intent();
+ intent.setComponent(new ComponentName("com.cloud.smart.agent.service", "com.cloud.smart.agent.service.service.SmartAgentService"));
+ //intent.setComponent(new ComponentName("com.example.testapi", "com.example.testapi.MainActivity"));
+ Log.d("vclucster restart", "startAgentService");
+ context.startService(intent);
+ //context.startActivity(intent);
+ }
+