summaryrefslogtreecommitdiffstats
path: root/core/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/com')
-rw-r--r--core/java/com/android/internal/widget/SwipeDismissLayout.java19
1 files changed, 13 insertions, 6 deletions
diff --git a/core/java/com/android/internal/widget/SwipeDismissLayout.java b/core/java/com/android/internal/widget/SwipeDismissLayout.java
index 35ed63b..d88f479 100644
--- a/core/java/com/android/internal/widget/SwipeDismissLayout.java
+++ b/core/java/com/android/internal/widget/SwipeDismissLayout.java
@@ -89,14 +89,21 @@ public class SwipeDismissLayout extends FrameLayout {
}
};
private BroadcastReceiver mScreenOffReceiver = new BroadcastReceiver() {
+ private Runnable mRunnable = new Runnable() {
+ @Override
+ public void run() {
+ if (mDismissed) {
+ dismiss();
+ } else {
+ cancel();
+ }
+ resetMembers();
+ }
+ };
+
@Override
public void onReceive(Context context, Intent intent) {
- if (mDismissed) {
- dismiss();
- } else {
- cancel();
- }
- resetMembers();
+ post(mRunnable);
}
};
private IntentFilter mScreenOffFilter = new IntentFilter(Intent.ACTION_SCREEN_OFF);