summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/java/android/app/StatusBarManager.java4
-rw-r--r--core/java/android/view/View.java11
-rw-r--r--packages/SystemUI/res/layout-sw600dp/navigation_bar.xml20
-rw-r--r--packages/SystemUI/res/layout/navigation_bar.xml20
-rw-r--r--packages/SystemUI/src/com/android/systemui/SearchPanelView.java11
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java15
8 files changed, 86 insertions, 5 deletions
diff --git a/core/java/android/app/StatusBarManager.java b/core/java/android/app/StatusBarManager.java
index 3d656c7..829b80c 100644
--- a/core/java/android/app/StatusBarManager.java
+++ b/core/java/android/app/StatusBarManager.java
@@ -45,6 +45,7 @@ public class StatusBarManager {
public static final int DISABLE_RECENT = View.STATUS_BAR_DISABLE_RECENT;
public static final int DISABLE_BACK = View.STATUS_BAR_DISABLE_BACK;
public static final int DISABLE_CLOCK = View.STATUS_BAR_DISABLE_CLOCK;
+ public static final int DISABLE_SEARCH = View.STATUS_BAR_DISABLE_SEARCH;
@Deprecated
public static final int DISABLE_NAVIGATION =
@@ -54,7 +55,8 @@ public class StatusBarManager {
public static final int DISABLE_MASK = DISABLE_EXPAND | DISABLE_NOTIFICATION_ICONS
| DISABLE_NOTIFICATION_ALERTS | DISABLE_NOTIFICATION_TICKER
- | DISABLE_SYSTEM_INFO | DISABLE_RECENT | DISABLE_HOME | DISABLE_BACK | DISABLE_CLOCK;
+ | DISABLE_SYSTEM_INFO | DISABLE_RECENT | DISABLE_HOME | DISABLE_BACK | DISABLE_CLOCK
+ | DISABLE_SEARCH;
public static final int NAVIGATION_HINT_BACK_NOP = 1 << 0;
public static final int NAVIGATION_HINT_HOME_NOP = 1 << 1;
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index b36db7f..6360242 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -2452,6 +2452,17 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
/**
* @hide
+ *
+ * NOTE: This flag may only be used in subtreeSystemUiVisibility. It is masked
+ * out of the public fields to keep the undefined bits out of the developer's way.
+ *
+ * Flag to disable the global search gesture. Don't use this
+ * unless you're a special part of the system UI (i.e., setup wizard, keyguard).
+ */
+ public static final int STATUS_BAR_DISABLE_SEARCH = 0x02000000;
+
+ /**
+ * @hide
*/
public static final int PUBLIC_STATUS_BAR_VISIBILITY_MASK = 0x0000FFFF;
diff --git a/packages/SystemUI/res/layout-sw600dp/navigation_bar.xml b/packages/SystemUI/res/layout-sw600dp/navigation_bar.xml
index fbbd7e5..afa4cfc 100644
--- a/packages/SystemUI/res/layout-sw600dp/navigation_bar.xml
+++ b/packages/SystemUI/res/layout-sw600dp/navigation_bar.xml
@@ -141,6 +141,16 @@
/>
</LinearLayout>
+ <ImageView
+ android:layout_width="128dp"
+ android:id="@+id/search_light"
+ android:layout_height="match_parent"
+ android:layout_gravity="center_horizontal"
+ android:src="@drawable/ic_sysbar_lights_out_dot_large"
+ android:scaleType="center"
+ android:visibility="gone"
+ />
+
<com.android.systemui.statusbar.policy.DeadZone
android:id="@+id/deadzone"
android:layout_height="match_parent"
@@ -272,6 +282,16 @@
/>
</LinearLayout>
+ <ImageView
+ android:layout_width="162dp"
+ android:id="@+id/search_light"
+ android:layout_height="match_parent"
+ android:layout_gravity="center_horizontal"
+ android:src="@drawable/ic_sysbar_lights_out_dot_large"
+ android:scaleType="center"
+ android:visibility="gone"
+ />
+
<com.android.systemui.statusbar.policy.DeadZone
android:id="@+id/deadzone"
android:layout_height="match_parent"
diff --git a/packages/SystemUI/res/layout/navigation_bar.xml b/packages/SystemUI/res/layout/navigation_bar.xml
index 33b5dbb..133f79d 100644
--- a/packages/SystemUI/res/layout/navigation_bar.xml
+++ b/packages/SystemUI/res/layout/navigation_bar.xml
@@ -145,6 +145,16 @@
/>
</LinearLayout>
+ <ImageView
+ android:layout_width="80dp"
+ android:id="@+id/search_light"
+ android:layout_height="match_parent"
+ android:layout_gravity="center_horizontal"
+ android:src="@drawable/ic_sysbar_lights_out_dot_large"
+ android:scaleType="center"
+ android:visibility="gone"
+ />
+
<com.android.systemui.statusbar.policy.DeadZone
android:id="@+id/deadzone"
android:layout_height="match_parent"
@@ -279,6 +289,16 @@
/>
</LinearLayout>
+ <ImageView
+ android:id="@+id/search_light"
+ android:layout_height="80dp"
+ android:layout_width="match_parent"
+ android:layout_gravity="center_vertical"
+ android:src="@drawable/ic_sysbar_lights_out_dot_large"
+ android:scaleType="center"
+ android:visibility="gone"
+ />
+
<com.android.systemui.statusbar.policy.DeadZone
android:id="@+id/deadzone"
android:layout_height="match_parent"
diff --git a/packages/SystemUI/src/com/android/systemui/SearchPanelView.java b/packages/SystemUI/src/com/android/systemui/SearchPanelView.java
index bc61ab0..4b0e818 100644
--- a/packages/SystemUI/src/com/android/systemui/SearchPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/SearchPanelView.java
@@ -17,6 +17,7 @@
package com.android.systemui;
import android.animation.LayoutTransition;
+import android.app.ActivityManagerNative;
import android.app.ActivityOptions;
import android.app.SearchManager;
import android.content.ActivityNotFoundException;
@@ -24,6 +25,7 @@ import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
+import android.os.RemoteException;
import android.os.UserHandle;
import android.os.Vibrator;
import android.provider.Settings;
@@ -71,12 +73,21 @@ public class SearchPanelView extends FrameLayout implements
}
private void startAssistActivity() {
+ if (!mBar.isDeviceProvisioned()) return;
+
// 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();
+ } catch (RemoteException e) {
+ }
+
try {
ActivityOptions opts = ActivityOptions.makeCustomAnimation(mContext,
R.anim.search_launch_enter, R.anim.search_launch_exit,
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java
index 4f33e23..3ac1bcf 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java
@@ -49,7 +49,7 @@ public class DelegateViewHelper {
public boolean onInterceptTouchEvent(MotionEvent event) {
if (mSourceView == null || mDelegateView == null
- || mBar.shouldDisableNavbarGestures() || mBar.inKeyguardRestrictedInputMode()) {
+ || mBar.shouldDisableNavbarGestures()) {
return false;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
index dcc2e57..770ae6d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
@@ -142,6 +142,11 @@ public class NavigationBarView extends LinearLayout {
return mCurrentView.findViewById(R.id.home);
}
+ // for when home is disabled, but search isn't
+ public View getSearchLight() {
+ return mCurrentView.findViewById(R.id.search_light);
+ }
+
public NavigationBarView(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -222,12 +227,15 @@ public class NavigationBarView extends LinearLayout {
final boolean disableHome = ((disabledFlags & View.STATUS_BAR_DISABLE_HOME) != 0);
final boolean disableRecent = ((disabledFlags & View.STATUS_BAR_DISABLE_RECENT) != 0);
final boolean disableBack = ((disabledFlags & View.STATUS_BAR_DISABLE_BACK) != 0);
+ final boolean disableSearch = ((disabledFlags & View.STATUS_BAR_DISABLE_SEARCH) != 0);
setSlippery(disableHome && disableRecent && disableBack);
getBackButton() .setVisibility(disableBack ? View.INVISIBLE : View.VISIBLE);
getHomeButton() .setVisibility(disableHome ? View.INVISIBLE : View.VISIBLE);
getRecentsButton().setVisibility(disableRecent ? View.INVISIBLE : View.VISIBLE);
+
+ getSearchLight().setVisibility((disableHome && !disableSearch) ? View.VISIBLE : View.GONE);
}
public void setSlippery(boolean newSlippery) {
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 1c4dff8..578dcac 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -677,6 +677,10 @@ public class PhoneStatusBar extends BaseStatusBar {
@Override
public void showSearchPanel() {
super.showSearchPanel();
+
+ // we want to freeze the sysui state wherever it is
+ mSearchPanelView.setSystemUiVisibility(mSystemUiVisibility);
+
WindowManager.LayoutParams lp =
(android.view.WindowManager.LayoutParams) mNavigationBarView.getLayoutParams();
lp.flags &= ~WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;
@@ -723,7 +727,7 @@ public class PhoneStatusBar extends BaseStatusBar {
public boolean onTouch(View v, MotionEvent event) {
switch(event.getAction()) {
case MotionEvent.ACTION_DOWN:
- if (!shouldDisableNavbarGestures() && !inKeyguardRestrictedInputMode()) {
+ if (!shouldDisableNavbarGestures()) {
mHandler.removeCallbacks(mShowSearchPanel);
mHandler.postDelayed(mShowSearchPanel, mShowSearchHoldoff);
}
@@ -1179,6 +1183,8 @@ public class PhoneStatusBar extends BaseStatusBar {
flagdbg.append(((diff & StatusBarManager.DISABLE_RECENT) != 0) ? "* " : " ");
flagdbg.append(((state & StatusBarManager.DISABLE_CLOCK) != 0) ? "CLOCK" : "clock");
flagdbg.append(((diff & StatusBarManager.DISABLE_CLOCK) != 0) ? "* " : " ");
+ flagdbg.append(((state & StatusBarManager.DISABLE_SEARCH) != 0) ? "SEARCH" : "search");
+ flagdbg.append(((diff & StatusBarManager.DISABLE_SEARCH) != 0) ? "* " : " ");
flagdbg.append(">");
Slog.d(TAG, flagdbg.toString());
@@ -1216,7 +1222,8 @@ public class PhoneStatusBar extends BaseStatusBar {
if ((diff & (StatusBarManager.DISABLE_HOME
| StatusBarManager.DISABLE_RECENT
- | StatusBarManager.DISABLE_BACK)) != 0) {
+ | StatusBarManager.DISABLE_BACK
+ | StatusBarManager.DISABLE_SEARCH)) != 0) {
// the nav bar will take care of these
if (mNavigationBarView != null) mNavigationBarView.setDisabledFlags(state);
@@ -2416,7 +2423,9 @@ public class PhoneStatusBar extends BaseStatusBar {
@Override
protected boolean shouldDisableNavbarGestures() {
- return mExpandedVisible || (mDisabled & StatusBarManager.DISABLE_HOME) != 0;
+ return !isDeviceProvisioned()
+ || mExpandedVisible
+ || (mDisabled & StatusBarManager.DISABLE_SEARCH) != 0;
}
private static class FastColorDrawable extends Drawable {