Skip to content

Commit

Permalink
ClockActions: Dismiss Keyguard
Browse files Browse the repository at this point in the history
Kanging SteveSpear's Brilliant
    dismissal method here.
    Doesn't require an activity
    as ...OnNextActivity() does.

PS2: TabletStatusBar.java as well

Change-Id: I2e9a3d8e42f2cd2a41f954026d0e38fe40c5da67
  • Loading branch information
Jubakuba authored and sethyx committed Jun 1, 2013
1 parent 41df7d9 commit 050384b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
Expand Up @@ -394,6 +394,12 @@ public boolean onMenuItemClick(MenuItem item) {
};
}

public void dismissKeyguard() {
Intent u = new Intent();
u.setAction("com.android.lockscreen.ACTION_UNLOCK_RECEIVER");
mContext.sendBroadcastAsUser(u, UserHandle.ALL);
}

public void dismissPopups() {
if (mNotificationBlamePopup != null) {
mNotificationBlamePopup.dismiss();
Expand Down
Expand Up @@ -2490,6 +2490,7 @@ public void onClick(View v) {
public void run() {
doubleClickCounter = 0;
animateCollapsePanels();
dismissKeyguard();
AwesomeAction.launchAction(mContext, mClockActions[shortClick]);
}
};
Expand All @@ -2507,6 +2508,7 @@ public void onClick(View v) {
mHandler.removeCallbacks(DelayShortPress);
vibrate();
animateCollapsePanels();
dismissKeyguard();
AwesomeAction.launchAction(mContext, mClockActions[doubleClick]);
mHandler.postDelayed(ResetDoubleClickCounter, 50);
} else {
Expand All @@ -2517,6 +2519,7 @@ public void onClick(View v) {
} else {
vibrate();
animateCollapsePanels();
dismissKeyguard();
AwesomeAction.launchAction(mContext, mClockActions[shortClick]);
}

Expand All @@ -2527,6 +2530,7 @@ public void onClick(View v) {
@Override
public boolean onLongClick(View v) {
animateCollapsePanels();
dismissKeyguard();
AwesomeAction.launchAction(mContext, mClockActions[longClick]);
return true;
}
Expand Down
Expand Up @@ -44,6 +44,7 @@
import android.os.IBinder;
import android.os.Message;
import android.os.RemoteException;
import android.os.UserHandle;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.Pair;
Expand Down Expand Up @@ -762,6 +763,7 @@ public boolean onTouch(View v, MotionEvent event) {
public void run() {
doubleClickCounter = 0;
animateCollapsePanels();
dismissKeyguard();
AwesomeAction.launchAction(mContext, mClockActions[shortClick]);
}
};
Expand All @@ -779,6 +781,7 @@ public void onClick(View v) {
mHandler.removeCallbacks(DelayShortPress);
v.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
animateCollapsePanels();
dismissKeyguard();
AwesomeAction.launchAction(mContext, mClockActions[doubleClick]);
mHandler.postDelayed(ResetDoubleClickCounter, 50);
} else {
Expand All @@ -789,6 +792,7 @@ public void onClick(View v) {
} else {
v.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
animateCollapsePanels();
dismissKeyguard();
AwesomeAction.launchAction(mContext, mClockActions[shortClick]);
}
}
Expand All @@ -799,6 +803,7 @@ public void onClick(View v) {
public boolean onLongClick(View v) {
animateCollapsePanels();
v.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
dismissKeyguard();
AwesomeAction.launchAction(mContext, mClockActions[longClick]);
return true;
}
Expand Down

0 comments on commit 050384b

Please sign in to comment.