diff options
author | Daniel Sandler <dsandler@android.com> | 2012-10-19 16:44:15 -0400 |
---|---|---|
committer | Daniel Sandler <dsandler@android.com> | 2012-10-19 16:48:12 -0400 |
commit | d5483c3157a28e2ebc05a0c918df8a2be0a7fc89 (patch) | |
tree | 7dfcfb6021bd0e0caf60be9f5a275203b961c202 /packages | |
parent | a1f739ea83b6d770b8469ae1c2c4161f6fe96334 (diff) | |
download | frameworks_base-d5483c3157a28e2ebc05a0c918df8a2be0a7fc89.zip frameworks_base-d5483c3157a28e2ebc05a0c918df8a2be0a7fc89.tar.gz frameworks_base-d5483c3157a28e2ebc05a0c918df8a2be0a7fc89.tar.bz2 |
New lockscreen: allow search gesture from nav bar.
Show a lights-out pip if home is invisible but search is
still OK.
Change-Id: Ifc69c12296cc8e8cf7c89dd06173d7abf499a878
Diffstat (limited to 'packages')
6 files changed, 72 insertions, 4 deletions
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 { |