diff options
author | Roman Birg <roman@cyngn.com> | 2016-01-14 09:45:34 -0800 |
---|---|---|
committer | Roman Birg <roman@cyngn.com> | 2016-01-18 10:30:56 -0800 |
commit | 9ee493accc3573485c5c20de9354676255cfa029 (patch) | |
tree | 97c52097fae078ab99b2a53eae651cfc802951ac /packages | |
parent | 3a116101afb6694c4e918e0deecced57311a5c83 (diff) | |
download | frameworks_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')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/qs/tiles/CustomQSTile.java | 13 |
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; |