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

Commit 73260bd1 authored by Alejandro Nijamkin's avatar Alejandro Nijamkin
Browse files

Lock screen long-press to open wallpaper picker.

Implements a long-press gesture on the lock screen that opens the
wallpaper picker (WPP) screen (after properly unlocking the device).

- Respects device state
  - Only works on the lock screen - does not work when unlocked, quick
    or quick-quick settings is shown, etc.
  - Lets other lock screen UI components receive and handle touch
    (including smart space, unlock/UDFPS, shortcuts, shade, and
    bouncer)
- Flag gated - this is a brand new flag as we're not sure whether we
  want to roll this out and it can be rolled out berore the WPP revamp
  project
- Logging included - logs long-press popup impressions and clicks, to
  help inform launch/no-launch decisions and identify falsing challenges

Fix: 265987364
Test: manually verified that it matches the UX spec: does not work
unless locked and showing the lock screen un-occluded (tested occlusion
with the camera app). Does not work if quick settings or quick-quick
settings is visible. Does not work if unlocked with or without the shade
being shown.
Test: manually verified that smart space clicks, notification clicks and
long presses, UDFPS, and shortcut buttons all still work as advertised.
Test: unit tests included

Change-Id: I600f3e60a03b58691ffd66cddb1be6ff0c80b3ca
parent 8027f460
Loading
Loading
Loading
Loading
+33 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (C) 2023 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.
  ~
  -->
<ripple
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
    android:color="?android:attr/colorControlHighlight">
    <item android:id="@android:id/mask">
        <shape android:shape="rectangle">
            <solid android:color="@android:color/white"/>
            <corners android:radius="28dp" />
        </shape>
    </item>
    <item>
        <shape android:shape="rectangle">
            <solid android:color="?androidprv:attr/colorSurface" />
            <corners android:radius="28dp" />
        </shape>
    </item>
</ripple>
+50 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (C) 2023 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:tools="http://schemas.android.com/tools"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:minHeight="52dp"
    android:orientation="horizontal"
    android:gravity="center_vertical"
    android:background="@drawable/keyguard_settings_popup_menu_background"
    android:paddingStart="16dp"
    android:paddingEnd="24dp"
    android:paddingVertical="16dp">

    <ImageView
        android:id="@+id/icon"
        android:layout_width="20dp"
        android:layout_height="20dp"
        android:layout_marginEnd="16dp"
        android:tint="?android:attr/textColorPrimary"
        android:importantForAccessibility="no"
        tools:ignore="UseAppTint" />

    <TextView
        android:id="@+id/text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:textColor="?android:attr/textColorPrimary"
        android:textSize="14sp"
        android:maxLines="1"
        android:ellipsize="end" />

</LinearLayout>
 No newline at end of file
+5 −0
Original line number Diff line number Diff line
@@ -26,6 +26,11 @@
    android:layout_height="match_parent"
    android:background="@android:color/transparent">

    <com.android.systemui.common.ui.view.LongPressHandlingView
        android:id="@+id/keyguard_long_press"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <ViewStub
        android:id="@+id/keyguard_qs_user_switch_stub"
        android:layout="@layout/keyguard_qs_user_switch"
+4 −0
Original line number Diff line number Diff line
@@ -824,4 +824,8 @@
        <item>bottom_end:wallet</item>
    </string-array>

    <!-- Package name for the app that implements the wallpaper picker. -->
    <string name="config_wallpaperPickerPackage" translatable="false">
        com.android.wallpaper
    </string>
</resources>
+6 −0
Original line number Diff line number Diff line
@@ -1648,4 +1648,10 @@
    <dimen name="rear_display_animation_height">200dp</dimen>
    <dimen name="rear_display_title_top_padding">24dp</dimen>
    <dimen name="rear_display_title_bottom_padding">16dp</dimen>

    <!--
    Vertical distance between the pointer and the popup menu that shows up on the lock screen when
    it is long-pressed.
    -->
    <dimen name="keyguard_long_press_settings_popup_vertical_offset">96dp</dimen>
</resources>
Loading