summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorJim Miller <jaggies@google.com>2012-11-08 00:04:29 -0800
committerJim Miller <jaggies@google.com>2012-11-08 00:39:04 -0800
commit4eeb4f664ac6b5901a8e874dcf70c0382295f792 (patch)
tree8b8ff28c8f7aec9bffc45eb32eae82a013d259d1 /packages
parent838195db8f69968690971977e4b615df39504465 (diff)
downloadframeworks_base-4eeb4f664ac6b5901a8e874dcf70c0382295f792.zip
frameworks_base-4eeb4f664ac6b5901a8e874dcf70c0382295f792.tar.gz
frameworks_base-4eeb4f664ac6b5901a8e874dcf70c0382295f792.tar.bz2
Add mechanism to kick keyguard to show the assistant
Fixes bug 7499778 Change-Id: Ic9ea514feb489feeee6716f40bdb9792842f9515
Diffstat (limited to 'packages')
-rw-r--r--packages/SystemUI/src/com/android/systemui/SearchPanelView.java25
1 files changed, 7 insertions, 18 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/SearchPanelView.java b/packages/SystemUI/src/com/android/systemui/SearchPanelView.java
index 4b0e818..76613e0 100644
--- a/packages/SystemUI/src/com/android/systemui/SearchPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/SearchPanelView.java
@@ -26,11 +26,13 @@ import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.os.RemoteException;
+import android.os.ServiceManager;
import android.os.UserHandle;
import android.os.Vibrator;
import android.provider.Settings;
import android.util.AttributeSet;
import android.util.Slog;
+import android.view.IWindowManager;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
@@ -62,6 +64,7 @@ public class SearchPanelView extends FrameLayout implements
private boolean mShowing;
private View mSearchTargetsContainer;
private GlowPadView mGlowPadView;
+ private IWindowManager mWm;
public SearchPanelView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
@@ -70,6 +73,7 @@ public class SearchPanelView extends FrameLayout implements
public SearchPanelView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
mContext = context;
+ mWm = IWindowManager.Stub.asInterface(ServiceManager.getService("window"));
}
private void startAssistActivity() {
@@ -77,28 +81,13 @@ public class SearchPanelView extends FrameLayout implements
// Close Recent Apps if needed
mBar.animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_SEARCH_PANEL);
- // Launch Assist
- Intent intent = ((SearchManager) mContext.getSystemService(Context.SEARCH_SERVICE))
- .getAssistIntent(mContext, UserHandle.USER_CURRENT);
- if (intent == null) return;
- // Dismiss the keyguard if possible. XXX: TODO: invoke bouncer.
try {
- ActivityManagerNative.getDefault().dismissKeyguardOnNextActivity();
+ mWm.showAssistant();
} catch (RemoteException e) {
+ // too bad, so sad...
}
-
- try {
- ActivityOptions opts = ActivityOptions.makeCustomAnimation(mContext,
- R.anim.search_launch_enter, R.anim.search_launch_exit,
- getHandler(), this);
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- mContext.startActivityAsUser(intent, opts.toBundle(),
- new UserHandle(UserHandle.USER_CURRENT));
- } catch (ActivityNotFoundException e) {
- Slog.w(TAG, "Activity not found for " + intent.getAction());
- onAnimationStarted();
- }
+ onAnimationStarted();
}
class GlowPadTriggerListener implements GlowPadView.OnTriggerListener {