diff options
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/DreamsDockLauncher.java | 9 | ||||
| -rwxr-xr-x | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 5 |
2 files changed, 12 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/DreamsDockLauncher.java b/packages/SystemUI/src/com/android/systemui/DreamsDockLauncher.java index 20a1c5026d8f..1db2a7feca00 100644 --- a/packages/SystemUI/src/com/android/systemui/DreamsDockLauncher.java +++ b/packages/SystemUI/src/com/android/systemui/DreamsDockLauncher.java @@ -30,12 +30,17 @@ public class DreamsDockLauncher extends Activity { com.android.internal.R.string.config_defaultDreamComponent); } if (component != null) { + // dismiss the notification shade, recents, etc. + context.sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)); + ComponentName cn = ComponentName.unflattenFromString(component); Intent zzz = new Intent(Intent.ACTION_MAIN) .setComponent(cn) .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK - | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS - | Intent.FLAG_ACTIVITY_NO_USER_ACTION + | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS + | Intent.FLAG_ACTIVITY_NO_USER_ACTION + | Intent.FLAG_FROM_BACKGROUND + | Intent.FLAG_ACTIVITY_NO_HISTORY ); Slog.v(TAG, "Starting screen saver on dock event: " + component); context.startActivity(zzz); diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index e1676b8f754a..fd9e095a5d0c 100755 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -3475,12 +3475,17 @@ public class PhoneWindowManager implements WindowManagerPolicy { component = mContext.getResources().getString(R.string.config_defaultDreamComponent); } if (component != null) { + // dismiss the notification shade, recents, etc. + mContext.sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)); + ComponentName cn = ComponentName.unflattenFromString(component); Intent intent = new Intent(Intent.ACTION_MAIN) .setComponent(cn) .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS | Intent.FLAG_ACTIVITY_NO_USER_ACTION + | Intent.FLAG_FROM_BACKGROUND + | Intent.FLAG_ACTIVITY_NO_HISTORY ); mContext.startActivity(intent); } else { |