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

Commit 073d189a authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 7177941 from d8c231ef to rvc-qpr3-release

Change-Id: I7d2125793d06c5118d02779e823dec60d35ba57e
parents 8a774ded d8c231ef
Loading
Loading
Loading
Loading
+17 −24
Original line number Diff line number Diff line
@@ -14,18 +14,12 @@
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<FrameLayout
<com.android.systemui.car.userswitcher.UserSwitcherContainer
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/fullscreen_user_switcher"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/car_user_switcher_background_color">

    <LinearLayout
    android:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
        android:layout_alignParentTop="true"
    android:background="@color/car_user_switcher_background_color"
    android:orientation="vertical">

    <include
@@ -45,5 +39,4 @@
            android:layout_marginTop="@dimen/car_user_switcher_margin_top"/>
    </FrameLayout>

    </LinearLayout>
</FrameLayout>
</com.android.systemui.car.userswitcher.UserSwitcherContainer>
+15 −1
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.car.Car;
import android.car.user.CarUserManager;
import android.content.Context;
import android.content.res.Resources;
import android.view.KeyEvent;
import android.view.View;

import androidx.recyclerview.widget.GridLayoutManager;
@@ -67,6 +68,19 @@ public class FullScreenUserSwitcherViewController extends OverlayViewController

    @Override
    protected void onFinishInflate() {
        // Intercept back button.
        UserSwitcherContainer container = getLayout().findViewById(R.id.container);
        container.setKeyEventHandler(event -> {
            if (event.getKeyCode() != KeyEvent.KEYCODE_BACK) {
                return false;
            }

            if (event.getAction() == KeyEvent.ACTION_UP && getLayout().isVisibleToUser()) {
                getLayout().setVisibility(View.GONE);
            }
            return true;
        });

        // Initialize user grid.
        mUserGridView = getLayout().findViewById(R.id.user_grid);
        GridLayoutManager layoutManager = new GridLayoutManager(mContext,
@@ -79,7 +93,7 @@ public class FullScreenUserSwitcherViewController extends OverlayViewController

    @Override
    protected boolean shouldFocusWindow() {
        return false;
        return true;
    }

    @Override
+73 −0
Original line number Diff line number Diff line
/*
 * 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.
 */

package com.android.systemui.car.userswitcher;

import android.content.Context;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.widget.LinearLayout;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

/** Container for the user switcher which intercepts the key events. */
public class UserSwitcherContainer extends LinearLayout {

    private KeyEventHandler mKeyEventHandler;

    public UserSwitcherContainer(@NonNull Context context) {
        super(context);
    }

    public UserSwitcherContainer(@NonNull Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public UserSwitcherContainer(@NonNull Context context, @Nullable AttributeSet attrs,
            int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    public UserSwitcherContainer(@NonNull Context context, @Nullable AttributeSet attrs,
            int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }

    @Override
    public boolean dispatchKeyEvent(KeyEvent event) {
        if (super.dispatchKeyEvent(event)) {
            return true;
        }

        if (mKeyEventHandler != null) {
            return mKeyEventHandler.dispatchKeyEvent(event);
        }

        return false;
    }

    /** Sets a {@link KeyEventHandler} to help interact with the notification panel. */
    public void setKeyEventHandler(KeyEventHandler keyEventHandler) {
        mKeyEventHandler = keyEventHandler;
    }

    /** An interface to help interact with the notification panel. */
    public interface KeyEventHandler {
        /** Allows handling of a {@link KeyEvent} if it wasn't already handled by the superclass. */
        boolean dispatchKeyEvent(KeyEvent event);
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@
    <string name="screenrecord_share_label" msgid="5025590804030086930">"Compartir"</string>
    <string name="screenrecord_cancel_success" msgid="1775448688137393901">"Se canceló la grabación de pantalla"</string>
    <string name="screenrecord_save_message" msgid="490522052388998226">"Se guardó la grabación de pantalla; presiona para verla"</string>
    <string name="screenrecord_delete_error" msgid="2870506119743013588">"Error al borrar la grabación de pantalla"</string>
    <string name="screenrecord_delete_error" msgid="2870506119743013588">"No se pudo borrar la grabación de pantalla"</string>
    <string name="screenrecord_permission_error" msgid="7856841237023137686">"Error al obtener permisos"</string>
    <string name="screenrecord_start_error" msgid="2200660692479682368">"Error al iniciar la grabación de pantalla"</string>
    <string name="usb_preference_title" msgid="1439924437558480718">"Opciones de transferencia de archivos por USB"</string>
+6 −6
Original line number Diff line number Diff line
@@ -470,8 +470,8 @@
    <string name="keyguard_indication_charging_time_fast" msgid="7895986003578341126">"<xliff:g id="PERCENTAGE">%2$s</xliff:g> • Bizkor kargatzen (<xliff:g id="CHARGING_TIME_LEFT">%1$s</xliff:g> guztiz kargatu arte)"</string>
    <string name="keyguard_indication_charging_time_slowly" msgid="245442950133408398">"<xliff:g id="PERCENTAGE">%2$s</xliff:g> • Mantso kargatzen (<xliff:g id="CHARGING_TIME_LEFT">%1$s</xliff:g> guztiz kargatu arte)"</string>
    <string name="accessibility_multi_user_switch_switcher" msgid="5330448341251092660">"Aldatu erabiltzailea"</string>
    <string name="accessibility_multi_user_switch_switcher_with_current" msgid="5759855008166759399">"Aldatu erabiltzailez. <xliff:g id="CURRENT_USER_NAME">%s</xliff:g> da saioa hasita duena."</string>
    <string name="accessibility_multi_user_switch_inactive" msgid="383168614528618402">"Uneko erabiltzailea: <xliff:g id="CURRENT_USER_NAME">%s</xliff:g>"</string>
    <string name="accessibility_multi_user_switch_switcher_with_current" msgid="5759855008166759399">"Aldatu erabiltzailea. <xliff:g id="CURRENT_USER_NAME">%s</xliff:g> da saioa hasita daukana."</string>
    <string name="accessibility_multi_user_switch_inactive" msgid="383168614528618402">"Erabiltzailea: <xliff:g id="CURRENT_USER_NAME">%s</xliff:g>"</string>
    <string name="accessibility_multi_user_switch_quick_contact" msgid="4504508915324898576">"Erakutsi profila"</string>
    <string name="user_add_user" msgid="4336657383006913022">"Gehitu erabiltzailea"</string>
    <string name="user_new_user_name" msgid="2019166282704195789">"Erabiltzaile berria"</string>
@@ -486,7 +486,7 @@
    <string name="guest_notification_text" msgid="4202692942089571351">"Aplikazioak eta datuak ezabatzeko, kendu gonbidatua"</string>
    <string name="guest_notification_remove_action" msgid="4153019027696868099">"KENDU GONBIDATUA"</string>
    <string name="user_logout_notification_title" msgid="3644848998053832589">"Amaitu erabiltzailearen saioa"</string>
    <string name="user_logout_notification_text" msgid="7441286737342997991">"Amaitu uneko erabiltzailearen saioa"</string>
    <string name="user_logout_notification_text" msgid="7441286737342997991">"Amaitu erabiltzailearen saioa"</string>
    <string name="user_logout_notification_action" msgid="7974458760719361881">"AMAITU ERABILTZAILEAREN SAIOA"</string>
    <string name="user_add_user_title" msgid="4172327541504825032">"Beste erabiltzaile bat gehitu?"</string>
    <string name="user_add_user_message_short" msgid="2599370307878014791">"Erabiltzaile bat gehitzen duzunean, horrek bere eremua konfiguratu beharko du.\n\nEdozein erabiltzailek egunera ditzake beste erabiltzaile guztien aplikazioak."</string>
@@ -974,7 +974,7 @@
    <string name="running_foreground_services_msg" msgid="3009459259222695385">"Sakatu bateria eta datuen erabilerari buruzko xehetasunak ikusteko"</string>
    <string name="mobile_data_disable_title" msgid="5366476131671617790">"Datu-konexioa desaktibatu nahi duzu?"</string>
    <string name="mobile_data_disable_message" msgid="8604966027899770415">"<xliff:g id="CARRIER">%s</xliff:g> erabilita ezingo dituzu erabili datuak edo Internet. Wifi-sare baten bidez soilik konektatu ahal izango zara Internetera."</string>
    <string name="mobile_data_disable_message_default_carrier" msgid="6496033312431658238">"Uneko operadorea"</string>
    <string name="mobile_data_disable_message_default_carrier" msgid="6496033312431658238">"Zure operadorea"</string>
    <string name="touch_filtered_warning" msgid="8119511393338714836">"Aplikazio bat baimen-eskaera oztopatzen ari denez, ezarpenek ezin dute egiaztatu erantzuna."</string>
    <string name="slice_permission_title" msgid="3262615140094151017">"<xliff:g id="APP_2">%2$s</xliff:g> aplikazioaren zatiak erakusteko baimena eman nahi diozu <xliff:g id="APP_0">%1$s</xliff:g> aplikazioari?"</string>
    <string name="slice_permission_text_1" msgid="6675965177075443714">"- <xliff:g id="APP">%1$s</xliff:g> aplikazioaren informazioa irakur dezake."</string>
@@ -1074,8 +1074,8 @@
    <string name="controls_structure_tooltip" msgid="4355922222944447867">"Pasatu hatza aukera gehiago ikusteko"</string>
    <string name="controls_seeding_in_progress" msgid="3033855341410264148">"Gomendioak kargatzen"</string>
    <string name="controls_media_title" msgid="1746947284862928133">"Multimedia-edukia"</string>
    <string name="controls_media_close_session" msgid="3957093425905475065">"Ezkutatu uneko saioa."</string>
    <string name="controls_media_active_session" msgid="1984383994625845642">"Ezin da ezkutatu uneko saioa."</string>
    <string name="controls_media_close_session" msgid="3957093425905475065">"Ezkutatu saioa."</string>
    <string name="controls_media_active_session" msgid="1984383994625845642">"Ezin da ezkutatu saioa."</string>
    <string name="controls_media_dismiss_button" msgid="9081375542265132213">"Baztertu"</string>
    <string name="controls_media_resume" msgid="1933520684481586053">"Berrekin"</string>
    <string name="controls_media_settings_button" msgid="5815790345117172504">"Ezarpenak"</string>
Loading