Fixing regression in dismissing Recents.
- Restoring app info functionality when developer options are enabled and you long-press on the app icon.
Change-Id: I8a20ff5f595eefa20db5528c0d5b1a1f0b110834
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java
index ffcb82b..46af4c1 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java
@@ -18,7 +18,7 @@
import android.animation.TimeInterpolator;
import android.animation.ValueAnimator;
-import android.annotation.Nullable;
+import android.content.ContentResolver;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Outline;
@@ -26,6 +26,7 @@
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.RectF;
+import android.provider.Settings;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
@@ -38,8 +39,8 @@
/* A task view */
-public class TaskView extends FrameLayout implements View.OnClickListener,
- Task.TaskCallbacks {
+public class TaskView extends FrameLayout implements Task.TaskCallbacks, View.OnClickListener,
+ View.OnLongClickListener {
/** The TaskView callbacks */
interface TaskViewCallbacks {
public void onTaskIconClicked(TaskView tv);
@@ -415,7 +416,17 @@
// Rebind any listeners
mBarView.mApplicationIcon.setOnClickListener(this);
mBarView.mDismissButton.setOnClickListener(this);
- mInfoView.mAppInfoButton.setOnClickListener(this);
+ if (Constants.DebugFlags.App.EnableDevAppInfoOnLongPress) {
+ ContentResolver cr = getContext().getContentResolver();
+ boolean devOptsEnabled = Settings.Global.getInt(cr,
+ Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) != 0;
+ if (devOptsEnabled) {
+ mBarView.mApplicationIcon.setOnLongClickListener(this);
+ }
+ }
+ if (Constants.DebugFlags.App.EnableInfoPane) {
+ mInfoView.mAppInfoButton.setOnClickListener(this);
+ }
}
mTaskDataLoaded = true;
}
@@ -429,7 +440,13 @@
mBarView.unbindFromTask();
// Unbind any listeners
mBarView.mApplicationIcon.setOnClickListener(null);
- mInfoView.mAppInfoButton.setOnClickListener(null);
+ mBarView.mDismissButton.setOnClickListener(null);
+ if (Constants.DebugFlags.App.EnableDevAppInfoOnLongPress) {
+ mBarView.mApplicationIcon.setOnLongClickListener(null);
+ }
+ if (Constants.DebugFlags.App.EnableInfoPane) {
+ mInfoView.mAppInfoButton.setOnClickListener(null);
+ }
}
mTaskDataLoaded = false;
}
@@ -453,4 +470,13 @@
mCb.onTaskAppInfoClicked(this);
}
}
+
+ @Override
+ public boolean onLongClick(View v) {
+ if (v == mBarView.mApplicationIcon) {
+ mCb.onTaskAppInfoClicked(this);
+ return true;
+ }
+ return false;
+ }
}
\ No newline at end of file