Loading services/core/java/com/android/server/am/AppErrorDialog.java +4 −10 Original line number Diff line number Diff line Loading @@ -16,29 +16,22 @@ package com.android.server.am; import android.app.ActivityManagerInternal; import android.app.ActivityOptions; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.pm.IPackageDataObserver; import android.content.pm.PackageManager; import android.content.res.Resources; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.provider.Settings; import android.text.BidiFormatter; import android.util.Slog; import android.view.LayoutInflater; import android.view.View; import android.view.WindowManager; import android.widget.FrameLayout; import android.widget.TextView; import java.util.List; import static com.android.server.am.ActivityManagerService.IS_USER_BUILD; final class AppErrorDialog extends BaseErrorDialog implements View.OnClickListener { Loading @@ -47,7 +40,7 @@ final class AppErrorDialog extends BaseErrorDialog implements View.OnClickListen private final AppErrorResult mResult; private final ProcessRecord mProc; private final boolean mRepeating; private final boolean mForeground; private final boolean mIsRestartable; private CharSequence mName; Loading @@ -74,7 +67,7 @@ final class AppErrorDialog extends BaseErrorDialog implements View.OnClickListen mProc = data.proc; mResult = data.result; mRepeating = data.repeating; mForeground = data.task != null; mIsRestartable = data.task != null || data.isRestartableForService; BidiFormatter bidi = BidiFormatter.getInstance(); if ((mProc.pkgList.size() == 1) && Loading Loading @@ -118,7 +111,7 @@ final class AppErrorDialog extends BaseErrorDialog implements View.OnClickListen LayoutInflater.from(context).inflate( com.android.internal.R.layout.app_error_dialog, frame, true); boolean hasRestart = !mRepeating && mForeground; boolean hasRestart = !mRepeating && mIsRestartable; final boolean hasReceiver = mProc.errorReportReceiver != null; final TextView restart = (TextView) findViewById(com.android.internal.R.id.aerr_restart); Loading Loading @@ -214,5 +207,6 @@ final class AppErrorDialog extends BaseErrorDialog implements View.OnClickListen TaskRecord task; boolean repeating; ProcessRecord proc; boolean isRestartableForService; } } services/core/java/com/android/server/am/AppErrors.java +8 −0 Original line number Diff line number Diff line Loading @@ -627,12 +627,20 @@ class AppErrors { } } boolean procIsBoundForeground = (app.curProcState == ActivityManager.PROCESS_STATE_BOUND_FOREGROUND_SERVICE); // Bump up the crash count of any services currently running in the proc. for (int i=app.services.size()-1; i>=0; i--) { // Any services running in the application need to be placed // back in the pending list. ServiceRecord sr = app.services.valueAt(i); sr.crashCount++; // Allow restarting for started or bound foreground services that are crashing the // first time. This includes wallpapers. if (sr.crashCount <= 1 && (sr.isForeground || procIsBoundForeground)) { data.isRestartableForService = true; } } // If the crashing process is what we consider to be the "home process" and it has been Loading Loading
services/core/java/com/android/server/am/AppErrorDialog.java +4 −10 Original line number Diff line number Diff line Loading @@ -16,29 +16,22 @@ package com.android.server.am; import android.app.ActivityManagerInternal; import android.app.ActivityOptions; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.pm.IPackageDataObserver; import android.content.pm.PackageManager; import android.content.res.Resources; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.provider.Settings; import android.text.BidiFormatter; import android.util.Slog; import android.view.LayoutInflater; import android.view.View; import android.view.WindowManager; import android.widget.FrameLayout; import android.widget.TextView; import java.util.List; import static com.android.server.am.ActivityManagerService.IS_USER_BUILD; final class AppErrorDialog extends BaseErrorDialog implements View.OnClickListener { Loading @@ -47,7 +40,7 @@ final class AppErrorDialog extends BaseErrorDialog implements View.OnClickListen private final AppErrorResult mResult; private final ProcessRecord mProc; private final boolean mRepeating; private final boolean mForeground; private final boolean mIsRestartable; private CharSequence mName; Loading @@ -74,7 +67,7 @@ final class AppErrorDialog extends BaseErrorDialog implements View.OnClickListen mProc = data.proc; mResult = data.result; mRepeating = data.repeating; mForeground = data.task != null; mIsRestartable = data.task != null || data.isRestartableForService; BidiFormatter bidi = BidiFormatter.getInstance(); if ((mProc.pkgList.size() == 1) && Loading Loading @@ -118,7 +111,7 @@ final class AppErrorDialog extends BaseErrorDialog implements View.OnClickListen LayoutInflater.from(context).inflate( com.android.internal.R.layout.app_error_dialog, frame, true); boolean hasRestart = !mRepeating && mForeground; boolean hasRestart = !mRepeating && mIsRestartable; final boolean hasReceiver = mProc.errorReportReceiver != null; final TextView restart = (TextView) findViewById(com.android.internal.R.id.aerr_restart); Loading Loading @@ -214,5 +207,6 @@ final class AppErrorDialog extends BaseErrorDialog implements View.OnClickListen TaskRecord task; boolean repeating; ProcessRecord proc; boolean isRestartableForService; } }
services/core/java/com/android/server/am/AppErrors.java +8 −0 Original line number Diff line number Diff line Loading @@ -627,12 +627,20 @@ class AppErrors { } } boolean procIsBoundForeground = (app.curProcState == ActivityManager.PROCESS_STATE_BOUND_FOREGROUND_SERVICE); // Bump up the crash count of any services currently running in the proc. for (int i=app.services.size()-1; i>=0; i--) { // Any services running in the application need to be placed // back in the pending list. ServiceRecord sr = app.services.valueAt(i); sr.crashCount++; // Allow restarting for started or bound foreground services that are crashing the // first time. This includes wallpapers. if (sr.crashCount <= 1 && (sr.isForeground || procIsBoundForeground)) { data.isRestartableForService = true; } } // If the crashing process is what we consider to be the "home process" and it has been Loading