Merge "Show recents button while pinned and locked" into lmp-mr1-dev
This commit is contained in:
@@ -21,6 +21,7 @@ import android.animation.LayoutTransition.TransitionListener;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.animation.TimeInterpolator;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.app.ActivityManagerNative;
|
||||
import android.app.StatusBarManager;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
@@ -30,6 +31,7 @@ import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.os.RemoteException;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.Display;
|
||||
@@ -43,6 +45,7 @@ import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.statusbar.BaseStatusBar;
|
||||
import com.android.systemui.statusbar.DelegateViewHelper;
|
||||
@@ -332,7 +335,7 @@ public class NavigationBarView extends LinearLayout {
|
||||
mDisabledFlags = disabledFlags;
|
||||
|
||||
final boolean disableHome = ((disabledFlags & View.STATUS_BAR_DISABLE_HOME) != 0);
|
||||
final boolean disableRecent = ((disabledFlags & View.STATUS_BAR_DISABLE_RECENT) != 0);
|
||||
boolean disableRecent = ((disabledFlags & View.STATUS_BAR_DISABLE_RECENT) != 0);
|
||||
final boolean disableBack = ((disabledFlags & View.STATUS_BAR_DISABLE_BACK) != 0)
|
||||
&& ((mNavigationIconHints & StatusBarManager.NAVIGATION_HINT_BACK_ALT) == 0);
|
||||
final boolean disableSearch = ((disabledFlags & View.STATUS_BAR_DISABLE_SEARCH) != 0);
|
||||
@@ -357,6 +360,11 @@ public class NavigationBarView extends LinearLayout {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (inLockTask() && disableRecent && !disableHome) {
|
||||
// Don't hide recents when in lock task, it is used for exiting.
|
||||
// Unless home is hidden, then in DPM locked mode and no exit available.
|
||||
disableRecent = false;
|
||||
}
|
||||
|
||||
getBackButton() .setVisibility(disableBack ? View.INVISIBLE : View.VISIBLE);
|
||||
getHomeButton() .setVisibility(disableHome ? View.INVISIBLE : View.VISIBLE);
|
||||
@@ -365,6 +373,14 @@ public class NavigationBarView extends LinearLayout {
|
||||
mBarTransitions.applyBackButtonQuiescentAlpha(mBarTransitions.getMode(), true /*animate*/);
|
||||
}
|
||||
|
||||
private boolean inLockTask() {
|
||||
try {
|
||||
return ActivityManagerNative.getDefault().isInLockTaskMode();
|
||||
} catch (RemoteException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void setVisibleOrGone(View view, boolean visible) {
|
||||
if (view != null) {
|
||||
view.setVisibility(visible ? VISIBLE : GONE);
|
||||
|
||||
@@ -3968,6 +3968,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
// long-pressed 'together'
|
||||
if ((time - mLastLockToAppLongPress) < LOCK_TO_APP_GESTURE_TOLERENCE) {
|
||||
activityManager.stopLockTaskModeOnCurrent();
|
||||
// When exiting refresh disabled flags.
|
||||
mNavigationBarView.setDisabledFlags(mDisabled, true);
|
||||
} else if ((v.getId() == R.id.back)
|
||||
&& !mNavigationBarView.getRecentsButton().isPressed()) {
|
||||
// If we aren't pressing recents right now then they presses
|
||||
@@ -3983,6 +3985,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
// When in accessibility mode a long press that is recents (not back)
|
||||
// should stop lock task.
|
||||
activityManager.stopLockTaskModeOnCurrent();
|
||||
// When exiting refresh disabled flags.
|
||||
mNavigationBarView.setDisabledFlags(mDisabled, true);
|
||||
}
|
||||
}
|
||||
if (sendBackLongPress) {
|
||||
|
||||
Reference in New Issue
Block a user