Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9ee493ac authored by Roman Birg's avatar Roman Birg
Browse files

SystemUI: handle custom tile long press PendingIntents



Ref: CYNGNOS-1602
Change-Id: I30dc09a48f7fcf7bcac85f173129c8bc04a10d37
Signed-off-by: default avatarRoman Birg <roman@cyngn.com>
parent 3a116101
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -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;