Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 525fd252 authored by Beth Thibodeau's avatar Beth Thibodeau
Browse files

Disable smart lock when in power menu on lock screen

When entering the power menu, if the user is on the lock screen and currently
has smart lock on, disable smart lock and show a message

Fixes: 185618953
Test: atest com.android.systemui.globalactions
Test: manual
Change-Id: Id353faa1176882b6b9dfb9acd72288a3e0173aa0
Merged-In: Id353faa1176882b6b9dfb9acd72288a3e0173aa0
parent 62a1033f
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -13,13 +13,12 @@
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<LinearLayout
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/global_actions_container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:gravity="center"
    android:layout_gravity="center">
  <com.android.systemui.globalactions.GlobalActionsLayoutLite
@@ -29,8 +28,11 @@
      android:orientation="vertical"
      android:clipChildren="false"
      android:clipToPadding="false"
      android:background="@drawable/global_actions_lite_background"
      android:padding="@dimen/global_actions_lite_padding">
      app:layout_constraintBottom_toBottomOf="parent"
      app:layout_constraintTop_toTopOf="parent"
      app:layout_constraintStart_toStartOf="parent"
      app:layout_constraintEnd_toEndOf="parent"
      android:layout_weight="1">
    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
@@ -38,6 +40,8 @@
        android:gravity="center"
        android:translationZ="@dimen/global_actions_translate"
        android:orientation="horizontal"
        android:background="@drawable/global_actions_lite_background"
        android:padding="@dimen/global_actions_lite_padding"
        android:layoutDirection="ltr">
      <androidx.constraintlayout.helper.widget.Flow
          android:id="@+id/list_flow"
@@ -53,4 +57,4 @@
          app:flow_horizontalStyle="packed"/>
    </androidx.constraintlayout.widget.ConstraintLayout>
  </com.android.systemui.globalactions.GlobalActionsLayoutLite>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
+44 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2021 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center|bottom"
    android:gravity="center"
    android:layout_marginBottom="@dimen/global_actions_info_margin"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintWidth_max="382dp"
    android:layout_weight="0"
    android:background="@drawable/global_actions_lite_background"
    android:theme="@style/Theme.SystemUI.QuickSettings"
    android:paddingTop="14dp"
    android:paddingBottom="14dp"
    android:paddingStart="20dp"
    android:paddingEnd="20dp"
    android:orientation="horizontal">
    <TextView
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:textSize="14sp"
        android:textColor="?android:attr/textColorSecondary"
        android:text="@string/global_action_smart_lock_disabled" />
</LinearLayout>
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
@@ -1138,6 +1138,7 @@
    <dimen name="global_actions_button_padding">38dp</dimen>
    <dimen name="global_actions_corner_radius">28dp</dimen>
    <dimen name="global_actions_lite_padding">24dp</dimen>
    <dimen name="global_actions_info_margin">32dp</dimen>

    <!-- The maximum offset in either direction that elements are moved horizontally to prevent
         burn-in on AOD. -->
+2 −0
Original line number Diff line number Diff line
@@ -211,6 +211,8 @@

    <!-- Power menu item for taking a screenshot [CHAR LIMIT=20]-->
    <string name="global_action_screenshot">Screenshot</string>
    <!-- Message shown in power menu when smart lock has been disabled [CHAR_LIMIT=NONE] -->
    <string name="global_action_smart_lock_disabled">Smart Lock disabled</string>

    <!-- text to show in place of RemoteInput images when they cannot be shown.
         [CHAR LIMIT=50] -->
+10 −5
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ import com.android.internal.logging.UiEventLogger;
import com.android.internal.statusbar.IStatusBarService;
import com.android.internal.view.RotationPolicy;
import com.android.internal.widget.LockPatternUtils;
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.systemui.animation.Interpolators;
import com.android.systemui.broadcast.BroadcastDispatcher;
import com.android.systemui.colorextraction.SysuiColorExtractor;
@@ -173,7 +174,8 @@ public class GlobalActionsDialog extends GlobalActionsDialogLite
            SysUiState sysUiState,
            @Main Handler handler,
            PackageManager packageManager,
            Optional<StatusBar> statusBarOptional) {
            Optional<StatusBar> statusBarOptional,
            KeyguardUpdateMonitor keyguardUpdateMonitor) {

        super(context,
                windowManagerFuncs,
@@ -204,7 +206,8 @@ public class GlobalActionsDialog extends GlobalActionsDialogLite
                sysUiState,
                handler,
                packageManager,
                statusBarOptional);
                statusBarOptional,
                keyguardUpdateMonitor);

        mLockPatternUtils = lockPatternUtils;
        mKeyguardStateController = keyguardStateController;
@@ -266,7 +269,7 @@ public class GlobalActionsDialog extends GlobalActionsDialogLite
                this::getWalletViewController, mSysuiColorExtractor,
                mStatusBarService, mNotificationShadeWindowController,
                mSysUiState, this::onRotate, isKeyguardShowing(), mPowerAdapter, getEventLogger(),
                getStatusBar());
                getStatusBar(), getKeyguardUpdateMonitor(), mLockPatternUtils);

        if (shouldShowLockMessage(dialog)) {
            dialog.showLockMessage();
@@ -334,11 +337,13 @@ public class GlobalActionsDialog extends GlobalActionsDialogLite
                NotificationShadeWindowController notificationShadeWindowController,
                SysUiState sysuiState, Runnable onRotateCallback, boolean keyguardShowing,
                MyPowerOptionsAdapter powerAdapter, UiEventLogger uiEventLogger,
                Optional<StatusBar> statusBarOptional) {
                Optional<StatusBar> statusBarOptional, KeyguardUpdateMonitor keyguardUpdateMonitor,
                LockPatternUtils lockPatternUtils) {
            super(context, com.android.systemui.R.style.Theme_SystemUI_Dialog_GlobalActions,
                    adapter, overflowAdapter, sysuiColorExtractor, statusBarService,
                    notificationShadeWindowController, sysuiState, onRotateCallback,
                    keyguardShowing, powerAdapter, uiEventLogger, statusBarOptional);
                    keyguardShowing, powerAdapter, uiEventLogger, statusBarOptional,
                    keyguardUpdateMonitor, lockPatternUtils);
            mWalletFactory = walletFactory;

            // Update window attributes
Loading