summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui
diff options
context:
space:
mode:
authorRoman Birg <roman@cyngn.com>2016-01-14 09:45:34 -0800
committerRoman Birg <roman@cyngn.com>2016-01-18 10:30:56 -0800
commit9ee493accc3573485c5c20de9354676255cfa029 (patch)
tree97c52097fae078ab99b2a53eae651cfc802951ac /packages/SystemUI/src/com/android/systemui
parent3a116101afb6694c4e918e0deecced57311a5c83 (diff)
downloadframeworks_base-9ee493accc3573485c5c20de9354676255cfa029.zip
frameworks_base-9ee493accc3573485c5c20de9354676255cfa029.tar.gz
frameworks_base-9ee493accc3573485c5c20de9354676255cfa029.tar.bz2
SystemUI: handle custom tile long press PendingIntents
Ref: CYNGNOS-1602 Change-Id: I30dc09a48f7fcf7bcac85f173129c8bc04a10d37 Signed-off-by: Roman Birg <roman@cyngn.com>
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui')
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/CustomQSTile.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/CustomQSTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/CustomQSTile.java
index f0c4f52..d09ca92 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/CustomQSTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/CustomQSTile.java
@@ -55,6 +55,7 @@ public class CustomQSTile extends QSTile<QSTile.State> {
private CustomTile.ExpandedStyle mExpandedStyle;
private PendingIntent mOnClick;
+ private PendingIntent mOnLongClick;
private Uri mOnClickUri;
private int mCurrentUserId;
private StatusBarPanelCustomTile mTile;
@@ -92,7 +93,16 @@ public class CustomQSTile extends QSTile<QSTile.State> {
@Override
protected void handleLongClick() {
- if (mExpandedStyle == null) {
+ if (mOnLongClick != null) {
+ if (mOnLongClick.isActivity()) {
+ getHost().collapsePanels();
+ }
+ try {
+ mOnLongClick.send();
+ } catch (Throwable e) {
+ Log.w(TAG, "Error sending long click intent", e);
+ }
+ } else if (mExpandedStyle == null) {
showDetail(true);
}
}
@@ -143,6 +153,7 @@ public class CustomQSTile extends QSTile<QSTile.State> {
state.icon = new ExternalBitmapIcon(customTile.remoteIcon);
}
mOnClick = customTile.onClick;
+ mOnLongClick = customTile.onLongClick;
mOnClickUri = customTile.onClickUri;
mExpandedStyle = customTile.expandedStyle;
mCollapsePanel = customTile.collapsePanel;