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

Commit 90a4c063 authored by /e/ robot's avatar /e/ robot
Browse files

Merge remote-tracking branch 'origin/lineage-19.1' into v1-s

parents 39eac136 8e16243e
Loading
Loading
Loading
Loading
+40 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@

<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_height="match_parent"
    android:layout_width="match_parent">

@@ -30,6 +31,18 @@
        android:layout_marginTop="@dimen/bluetooth_dialog_padding_top"
        android:orientation="vertical">

        <TextView
            android:id="@+id/pairing_confirmation_hint"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/bluetooth_dialog_padding"
            android:layout_marginBottom="12dp"
            android:layout_marginStart="@dimen/bluetooth_dialog_padding"
            android:layout_marginEnd="@dimen/bluetooth_dialog_padding"
            android:gravity="center_vertical"
            android:visibility="gone"
            android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body1" />

        <TextView
            android:id="@+id/pairing_caption"
            android:layout_width="wrap_content"
@@ -73,6 +86,32 @@
            android:layout_marginEnd="@dimen/bluetooth_dialog_padding"
            android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body1" />

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="16dp"
            android:layout_marginStart="@dimen/bluetooth_dialog_padding"
            android:layout_marginEnd="@dimen/bluetooth_dialog_padding">
            <Button
                android:id="@+id/negative_button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:visibility="gone"
                android:text="@string/bluetooth_pairing_decline"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                style="@style/ActionPrimaryButton"/>
            <Button
                android:id="@+id/positive_button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:visibility="gone"
                android:text="@string/bluetooth_pairing_accept"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                style="@style/ActionPrimaryButton"/>
        </androidx.constraintlayout.widget.ConstraintLayout>
    </LinearLayout>

</ScrollView>
+26 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@

<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_height="match_parent"
    android:layout_width="match_parent">

@@ -87,6 +88,30 @@
            android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body1"
            android:textColor="?android:attr/textColorSecondary"/>

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="16dp"
            android:layout_marginStart="@dimen/bluetooth_pairing_padding"
            android:layout_marginEnd="@dimen/bluetooth_pairing_padding">
            <Button
                android:id="@+id/negative_button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@android:string/cancel"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                style="@style/ActionPrimaryButton"/>
            <Button
                android:id="@+id/positive_button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@android:string/ok"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                style="@style/ActionPrimaryButton"/>
        </androidx.constraintlayout.widget.ConstraintLayout>
    </LinearLayout>

</ScrollView>
+3 −0
Original line number Diff line number Diff line
@@ -178,6 +178,9 @@
    <!-- List of packages that should be allowlisted for slice uri access. Do not translate -->
    <string-array name="slice_allowlist_package_names" translatable="false"/>

    <!-- List of packages that should be allowlisted for slice uri access for debugging purpose. Do not translate -->
    <string-array name="slice_allowlist_package_names_for_dev" translatable="false"/>

    <!-- Whether or not App & Notification screen should display recently used apps -->
    <bool name="config_display_recent_apps">true</bool>

+6 −0
Original line number Diff line number Diff line
@@ -1839,6 +1839,12 @@
    <!-- Checkbox message in pairing dialogs.  [CHAR LIMIT=NONE] -->
    <string name="bluetooth_pairing_shares_phonebook">Allow access to your contacts and call history</string>
    <!-- Title for the dialog to confirm PIN. [CHAR LIMIT=40] -->
    <string name="bluetooth_pairing_confirmation_title">Check pairing codes</string>
    <!-- Message for the dialog to confirm PIN. [CHAR LIMIT=NONE] -->
    <string name="bluetooth_pairing_confirmation_msg">Check if this code matches the one on <xliff:g id="device_name" example="device_name">%1$s</xliff:g>.\n\nFor your security, do not enter this code anywhere.</string>
    <!-- Title for BT error dialogs. -->
    <string name="bluetooth_error_title"></string>
+42 −23
Original line number Diff line number Diff line
@@ -18,8 +18,6 @@ package com.android.settings.bluetooth;
import android.app.Dialog;
import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
import android.text.Editable;
import android.text.InputFilter;
@@ -46,7 +44,7 @@ import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
 * for the bluetooth device.
 */
public class BluetoothPairingDialogFragment extends InstrumentedDialogFragment implements
        TextWatcher, OnClickListener {
        TextWatcher {

    private static final String TAG = "BTPairingDialogFragment";

@@ -93,21 +91,18 @@ public class BluetoothPairingDialogFragment extends InstrumentedDialogFragment i
    @Override
    public void afterTextChanged(Editable s) {
        // enable the positive button when we detect potentially valid input
        Button positiveButton = mDialog.getButton(DialogInterface.BUTTON_POSITIVE);
        if (positiveButton != null) {
            positiveButton.setEnabled(mPairingController.isPasskeyValid(s));
        }
        mDialog.findViewById(R.id.positive_button).setEnabled(mPairingController.isPasskeyValid(s));
        // notify the controller about user input
        mPairingController.updateUserInput(s.toString());
    }

    @Override
    public void onClick(DialogInterface dialog, int which) {
        if (which == DialogInterface.BUTTON_POSITIVE) {
    protected void onAcceptButtonClicked() {
        mPairingController.onDialogPositiveClick(this);
        } else if (which == DialogInterface.BUTTON_NEGATIVE) {
            mPairingController.onDialogNegativeClick(this);
        mPairingDialogActivity.dismiss();
    }

    protected void onDeclineButtonClicked() {
        mPairingController.onDialogNegativeClick(this);
        mPairingDialogActivity.dismiss();
    }

@@ -208,12 +203,10 @@ public class BluetoothPairingDialogFragment extends InstrumentedDialogFragment i
        mBuilder.setTitle(getString(R.string.bluetooth_pairing_request,
                mPairingController.getDeviceName()));
        mBuilder.setView(createPinEntryView());
        mBuilder.setPositiveButton(getString(android.R.string.ok), this);
        mBuilder.setNegativeButton(getString(android.R.string.cancel), this);
        AlertDialog dialog = mBuilder.create();
        dialog.setOnShowListener(d -> {
            if (TextUtils.isEmpty(getPairingViewText())) {
                mDialog.getButton(Dialog.BUTTON_POSITIVE).setEnabled(false);
                mDialog.findViewById(R.id.positive_button).setEnabled(false);
            }
            if (mPairingView != null && mPairingView.requestFocus()) {
                InputMethodManager imm = (InputMethodManager)
@@ -277,6 +270,11 @@ public class BluetoothPairingDialogFragment extends InstrumentedDialogFragment i
        pairingView.setFilters(new InputFilter[]{
                new LengthFilter(maxLength)});

        Button negativeButton = view.findViewById(R.id.negative_button);
        negativeButton.setOnClickListener(v -> onDeclineButtonClicked());
        Button positiveButton = view.findViewById(R.id.positive_button);
        positiveButton.setOnClickListener(v -> onAcceptButtonClicked());

        return view;
    }

@@ -284,11 +282,13 @@ public class BluetoothPairingDialogFragment extends InstrumentedDialogFragment i
     * Creates a dialog with UI elements that allow the user to confirm a pairing request.
     */
    private AlertDialog createConfirmationDialog() {
        if (mPairingController.hasPairingContent()) {
            mBuilder.setTitle(getString(R.string.bluetooth_pairing_confirmation_title));
        } else {
            mBuilder.setTitle(getString(R.string.bluetooth_pairing_request,
                    mPairingController.getDeviceName()));
        }
        mBuilder.setView(createView());
        mBuilder.setPositiveButton(getString(R.string.bluetooth_pairing_accept), this);
        mBuilder.setNegativeButton(getString(R.string.bluetooth_pairing_decline), this);
        AlertDialog dialog = mBuilder.create();
        return dialog;
    }
@@ -308,7 +308,6 @@ public class BluetoothPairingDialogFragment extends InstrumentedDialogFragment i
        mBuilder.setTitle(getString(R.string.bluetooth_pairing_request,
                mPairingController.getDeviceName()));
        mBuilder.setView(createView());
        mBuilder.setNegativeButton(getString(android.R.string.cancel), this);
        AlertDialog dialog = mBuilder.create();

        // Tell the controller the dialog has been created.
@@ -323,6 +322,8 @@ public class BluetoothPairingDialogFragment extends InstrumentedDialogFragment i
     */
    private View createView() {
        View view = getActivity().getLayoutInflater().inflate(R.layout.bluetooth_pin_confirm, null);
        TextView pairingConfirmationHint =
                (TextView) view.findViewById(R.id.pairing_confirmation_hint);
        TextView pairingViewCaption = (TextView) view.findViewById(R.id.pairing_caption);
        TextView pairingViewContent = (TextView) view.findViewById(R.id.pairing_subhead);
        TextView messagePairing = (TextView) view.findViewById(R.id.pairing_code_message);
@@ -340,10 +341,28 @@ public class BluetoothPairingDialogFragment extends InstrumentedDialogFragment i
        messagePairing.setVisibility(mPairingController.isDisplayPairingKeyVariant()
                ? View.VISIBLE : View.GONE);
        if (mPairingController.hasPairingContent()) {
            if (mPairingController.isDisplayPairingKeyVariant()) {
                pairingViewCaption.setVisibility(View.VISIBLE);
            } else {
                pairingConfirmationHint.setText(
                        getString(
                                R.string.bluetooth_pairing_confirmation_msg,
                                mPairingController.getDeviceName()));
                pairingConfirmationHint.setVisibility(View.VISIBLE);
            }
            pairingViewContent.setVisibility(View.VISIBLE);
            pairingViewContent.setText(mPairingController.getPairingContent());
        }

        Button negativeButton = view.findViewById(R.id.negative_button);
        negativeButton.setVisibility(View.VISIBLE);
        negativeButton.setOnClickListener(v -> onDeclineButtonClicked());
        if (mPairingController.getDialogType() == BluetoothPairingController.CONFIRMATION_DIALOG) {
            Button positiveButton = view.findViewById(R.id.positive_button);
            positiveButton.setVisibility(View.VISIBLE);
            positiveButton.setOnClickListener(v -> onAcceptButtonClicked());
        }

        return view;
    }

Loading