summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android
diff options
context:
space:
mode:
Diffstat (limited to 'packages/SystemUI/src/com/android')
-rw-r--r--packages/SystemUI/src/com/android/systemui/SearchPanelView.java44
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java12
3 files changed, 38 insertions, 26 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/SearchPanelView.java b/packages/SystemUI/src/com/android/systemui/SearchPanelView.java
index 6b0bb87..28283ef 100644
--- a/packages/SystemUI/src/com/android/systemui/SearchPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/SearchPanelView.java
@@ -18,6 +18,8 @@ package com.android.systemui;
import android.animation.Animator;
import android.animation.LayoutTransition;
+import android.app.ActivityManagerNative;
+import android.app.ActivityOptions;
import android.app.SearchManager;
import android.content.ActivityNotFoundException;
import android.content.ComponentName;
@@ -36,6 +38,7 @@ import android.widget.FrameLayout;
import com.android.internal.widget.multiwaveview.MultiWaveView;
import com.android.internal.widget.multiwaveview.MultiWaveView.OnTriggerListener;
+import com.android.server.am.ActivityManagerService;
import com.android.systemui.R;
import com.android.systemui.recent.StatusBarTouchProxy;
import com.android.systemui.statusbar.BaseStatusBar;
@@ -103,26 +106,22 @@ public class SearchPanelView extends FrameLayout implements
}
private void startAssistActivity() {
- if (mSearchManager != null) {
- ComponentName globalSearchActivity = mSearchManager.getGlobalSearchActivity();
- if (globalSearchActivity != null) {
- Intent intent = new Intent(Intent.ACTION_ASSIST);
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- intent.setPackage(globalSearchActivity.getPackageName());
- try {
- mContext.startActivity(intent);
- } catch (ActivityNotFoundException e) {
- Slog.w(TAG, "Activity not found for " + intent.getAction());
- }
- } else {
- Slog.w(TAG, "No global search activity");
- }
+ Intent intent = getAssistIntent();
+ try {
+ ActivityOptions opts = ActivityOptions.makeCustomAnimation(mContext,
+ R.anim.search_launch_enter, R.anim.search_launch_exit);
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ mContext.startActivity(intent, opts.toBundle());
+ } catch (ActivityNotFoundException e) {
+ Slog.w(TAG, "Activity not found for " + intent.getAction());
}
}
final MultiWaveView.OnTriggerListener mMultiWaveViewListener
= new MultiWaveView.OnTriggerListener() {
+ private int mTarget = -1;
+
public void onGrabbed(View v, int handle) {
}
@@ -136,11 +135,18 @@ public class SearchPanelView extends FrameLayout implements
}
public void onTrigger(View v, int target) {
- final int resId = mMultiWaveView.getResourceIdForTarget(target);
- switch (resId) {
- case com.android.internal.R.drawable.ic_lockscreen_search:
- startAssistActivity();
- break;
+ mTarget = target;
+ }
+
+ public void onFinishFinalAnimation() {
+ if (mTarget != -1) {
+ final int resId = mMultiWaveView.getResourceIdForTarget(mTarget);
+ mTarget = -1; // a safety to make sure we never launch w/o prior call to onTrigger
+ switch (resId) {
+ case com.android.internal.R.drawable.ic_lockscreen_search:
+ startAssistActivity();
+ break;
+ }
}
mBar.hideSearchPanel();
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 69d2e73..d38611d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -515,14 +515,8 @@ public class PhoneStatusBar extends BaseStatusBar {
public boolean onTouch(View v, MotionEvent event) {
switch(event.getAction()) {
case MotionEvent.ACTION_DOWN:
- Slog.d(TAG, "showing search panel");
showSearchPanel();
break;
-
- case MotionEvent.ACTION_UP:
- Slog.d(TAG, "hiding search panel");
- hideSearchPanel();
- break;
}
return false;
}
@@ -533,8 +527,8 @@ public class PhoneStatusBar extends BaseStatusBar {
mNavigationBarView.getRecentsButton().setOnClickListener(mRecentsClickListener);
mNavigationBarView.getRecentsButton().setOnTouchListener(mRecentsPanel);
+ mNavigationBarView.getHomeButton().setOnTouchListener(mHomeSearchActionListener);
updateSearchPanel();
-// mNavigationBarView.getHomeButton().setOnTouchListener(mHomeSearchActionListener);
}
// For small-screen devices (read: phones) that lack hardware navigation buttons
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
index dba1606..10c5dd8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
@@ -188,6 +188,17 @@ public class TabletStatusBar extends BaseStatusBar implements
public Context getContext() { return mContext; }
+ private View.OnTouchListener mHomeSearchActionListener = new View.OnTouchListener() {
+ public boolean onTouch(View v, MotionEvent event) {
+ switch(event.getAction()) {
+ case MotionEvent.ACTION_DOWN:
+ showSearchPanel();
+ break;
+ }
+ return false;
+ }
+ };
+
@Override
protected void createAndAddWindows() {
addStatusBarWindow();
@@ -290,6 +301,7 @@ public class TabletStatusBar extends BaseStatusBar implements
// Search Panel
mStatusBarView.setBar(this);
+ mHomeButton.setOnTouchListener(mHomeSearchActionListener);
updateSearchPanel();
// Input methods Panel