summaryrefslogtreecommitdiffstats
path: root/policy/src/com/android
diff options
context:
space:
mode:
Diffstat (limited to 'policy/src/com/android')
-rw-r--r--policy/src/com/android/internal/policy/impl/GlobalActions.java7
-rw-r--r--[-rwxr-xr-x]policy/src/com/android/internal/policy/impl/PhoneWindowManager.java12
2 files changed, 16 insertions, 3 deletions
diff --git a/policy/src/com/android/internal/policy/impl/GlobalActions.java b/policy/src/com/android/internal/policy/impl/GlobalActions.java
index d1f8ef1..3dc77d4 100644
--- a/policy/src/com/android/internal/policy/impl/GlobalActions.java
+++ b/policy/src/com/android/internal/policy/impl/GlobalActions.java
@@ -408,7 +408,12 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac
/** {@inheritDoc} */
public void onDismiss(DialogInterface dialog) {
if (SHOW_SILENT_TOGGLE) {
- mContext.unregisterReceiver(mRingerModeReceiver);
+ try {
+ mContext.unregisterReceiver(mRingerModeReceiver);
+ } catch (IllegalArgumentException ie) {
+ // ignore this
+ Log.w(TAG, ie);
+ }
}
}
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 156676a..91971e3 100755..100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -1525,6 +1525,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
return null;
}
+ WindowManager wm = null;
+ View view = null;
+
try {
Context context = mContext;
if (DEBUG_STARTING_WINDOW) Slog.d(TAG, "addStartingWindow " + packageName
@@ -1584,8 +1587,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
params.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS;
params.setTitle("Starting " + packageName);
- WindowManager wm = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
- View view = win.getDecorView();
+ wm = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
+ view = win.getDecorView();
if (win.isFloating()) {
// Whoops, there is no way to display an animation/preview
@@ -1615,6 +1618,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// failure loading resources because we are loading from an app
// on external storage that has been unmounted.
Log.w(TAG, appToken + " failed creating starting window", e);
+ } finally {
+ if (view != null && view.getParent() == null) {
+ Log.w(TAG, "view not successfully added to wm, removing view");
+ wm.removeViewImmediate(view);
+ }
}
return null;