Loading services/core/java/com/android/server/am/AppWaitingForDebuggerDialog.java +0 −3 Original line number Diff line number Diff line Loading @@ -58,9 +58,6 @@ final class AppWaitingForDebuggerDialog extends BaseErrorDialog { getWindow().setAttributes(attrs); } public void onStop() { } @Override protected void closeDialog() { /* Do nothing */ Loading services/core/java/com/android/server/am/BaseErrorDialog.java +25 −12 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.server.am; import static android.content.Context.RECEIVER_EXPORTED; import android.app.AlertDialog; import android.content.BroadcastReceiver; import android.content.Context; Loading @@ -34,6 +36,7 @@ public class BaseErrorDialog extends AlertDialog { private static final int DISABLE_BUTTONS = 1; private boolean mConsuming = true; private BroadcastReceiver mReceiver; public BaseErrorDialog(Context context) { super(context, com.android.internal.R.style.Theme_DeviceDefault_Dialog_AppError); Loading @@ -52,14 +55,33 @@ public class BaseErrorDialog extends AlertDialog { super.onStart(); mHandler.sendEmptyMessage(DISABLE_BUTTONS); mHandler.sendMessageDelayed(mHandler.obtainMessage(ENABLE_BUTTONS), 1000); if (mReceiver == null) { mReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if (Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(intent.getAction())) { closeDialog(); } } }; getContext().registerReceiver(mReceiver, new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS), Context.RECEIVER_EXPORTED); new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS), RECEIVER_EXPORTED); } } @Override protected void onStop() { super.onStop(); if (mReceiver != null) { try { getContext().unregisterReceiver(mReceiver); } catch (IllegalArgumentException e) { // Receiver not registered exception. android.util.Slog.e("BaseErrorDialog", "unregisterReceiver threw exception: " + e.getMessage()); } mReceiver = null; } } public boolean dispatchKeyEvent(KeyEvent event) { Loading Loading @@ -107,13 +129,4 @@ public class BaseErrorDialog extends AlertDialog { dismiss(); } } private final BroadcastReceiver mReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if (Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(intent.getAction())) { closeDialog(); } } }; } services/core/java/com/android/server/wm/FactoryErrorDialog.java +0 −3 Original line number Diff line number Diff line Loading @@ -38,9 +38,6 @@ final class FactoryErrorDialog extends BaseErrorDialog { getWindow().setAttributes(attrs); } public void onStop() { } @Override protected void closeDialog() { /* Do nothing */ Loading Loading
services/core/java/com/android/server/am/AppWaitingForDebuggerDialog.java +0 −3 Original line number Diff line number Diff line Loading @@ -58,9 +58,6 @@ final class AppWaitingForDebuggerDialog extends BaseErrorDialog { getWindow().setAttributes(attrs); } public void onStop() { } @Override protected void closeDialog() { /* Do nothing */ Loading
services/core/java/com/android/server/am/BaseErrorDialog.java +25 −12 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.server.am; import static android.content.Context.RECEIVER_EXPORTED; import android.app.AlertDialog; import android.content.BroadcastReceiver; import android.content.Context; Loading @@ -34,6 +36,7 @@ public class BaseErrorDialog extends AlertDialog { private static final int DISABLE_BUTTONS = 1; private boolean mConsuming = true; private BroadcastReceiver mReceiver; public BaseErrorDialog(Context context) { super(context, com.android.internal.R.style.Theme_DeviceDefault_Dialog_AppError); Loading @@ -52,14 +55,33 @@ public class BaseErrorDialog extends AlertDialog { super.onStart(); mHandler.sendEmptyMessage(DISABLE_BUTTONS); mHandler.sendMessageDelayed(mHandler.obtainMessage(ENABLE_BUTTONS), 1000); if (mReceiver == null) { mReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if (Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(intent.getAction())) { closeDialog(); } } }; getContext().registerReceiver(mReceiver, new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS), Context.RECEIVER_EXPORTED); new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS), RECEIVER_EXPORTED); } } @Override protected void onStop() { super.onStop(); if (mReceiver != null) { try { getContext().unregisterReceiver(mReceiver); } catch (IllegalArgumentException e) { // Receiver not registered exception. android.util.Slog.e("BaseErrorDialog", "unregisterReceiver threw exception: " + e.getMessage()); } mReceiver = null; } } public boolean dispatchKeyEvent(KeyEvent event) { Loading Loading @@ -107,13 +129,4 @@ public class BaseErrorDialog extends AlertDialog { dismiss(); } } private final BroadcastReceiver mReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if (Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(intent.getAction())) { closeDialog(); } } }; }
services/core/java/com/android/server/wm/FactoryErrorDialog.java +0 −3 Original line number Diff line number Diff line Loading @@ -38,9 +38,6 @@ final class FactoryErrorDialog extends BaseErrorDialog { getWindow().setAttributes(attrs); } public void onStop() { } @Override protected void closeDialog() { /* Do nothing */ Loading