diff options
Diffstat (limited to 'packages/SystemUI/src')
4 files changed, 32 insertions, 4 deletions
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 5bb9378..41ccf39 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -676,6 +676,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; @@ -722,7 +726,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); } @@ -1178,6 +1182,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()); @@ -1215,7 +1221,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); @@ -2415,7 +2422,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 { |
