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

Commit b096e588 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Sets accessibility title for autofill dataset picker."

parents 7800604d b4f868de
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
@@ -4567,22 +4567,25 @@
    <!-- Accessibility string used for describing the button in time picker that changes the dialog to circular clock mode. [CHAR LIMIT=NONE] -->
    <string name="time_picker_radial_mode_description">Switch to clock mode for the time input.</string>

    <!-- Title for the auto-fill save dialog shown when the the contents of the activity can be saved
         by an auto-fill service, but the service does not know what the activity represents [CHAR LIMIT=NONE] -->
    <!-- Accessibility title for the autofill dialog used to select a list of options to autofill an activity. [CHAR LIMIT=NONE] -->
    <string name="autofill_picker_accessibility_title">Autofill options</string>

    <!-- Title for the autofill save dialog shown when the the contents of the activity can be saved
         by an autofill service, but the service does not know what the activity represents [CHAR LIMIT=NONE] -->
    <string name="autofill_save_title">Save to <xliff:g id="label" example="MyPass">%1$s</xliff:g>?</string>
    <!-- Title for the auto-fill save dialog shown when the the contents of the activity can be saved
         by an auto-fill service, and the service does knows what the activity represents (for example, credit card info) [CHAR LIMIT=NONE] -->
    <!-- Title for the autofill save dialog shown when the the contents of the activity can be saved
         by an autofill service, and the service does knows what the activity represents (for example, credit card info) [CHAR LIMIT=NONE] -->
    <string name="autofill_save_title_with_type">Save <xliff:g id="type" example="Credit Card">%1$s</xliff:g> to <xliff:g id="label" example="MyPass">%2$s</xliff:g>?</string>
    <!-- Label for the auto-fill save button [CHAR LIMIT=NONE] -->
    <!-- Label for the autofill save button [CHAR LIMIT=NONE] -->
    <string name="autofill_save_yes">Save</string>
    <!-- Label for the auto-fill cancel button [CHAR LIMIT=NONE] -->
    <!-- Label for the autofill cancel button [CHAR LIMIT=NONE] -->
    <string name="autofill_save_no">No thanks</string>

    <!-- Label for the type of data being saved for auto-fill when it represent user credentials with a password [CHAR LIMIT=NONE] -->
    <!-- Label for the type of data being saved for autofill when it represent user credentials with a password [CHAR LIMIT=NONE] -->
    <string name="autofill_save_type_password">password</string>
    <!-- Label for the type of data being saved for auto-fill when it represent an address (street, city, etc.) [CHAR LIMIT=NONE] -->
    <!-- Label for the type of data being saved for autofill when it represent an address (street, city, etc.) [CHAR LIMIT=NONE] -->
    <string name="autofill_save_type_address">address</string>
    <!-- Label for the type of data being saved for auto-fill when it represents a credit card [CHAR LIMIT=NONE] -->
    <!-- Label for the type of data being saved for autofill when it represents a credit card [CHAR LIMIT=NONE] -->
    <string name="autofill_save_type_credit_card">credit card</string>

</resources>
+1 −0
Original line number Diff line number Diff line
@@ -2849,6 +2849,7 @@
  <java-symbol type="id" name="autofill_save_yes" />
  <java-symbol type="id" name="autofill_save_close" />
  <java-symbol type="string" name="autofill" />
  <java-symbol type="string" name="autofill_picker_accessibility_title " />
  <java-symbol type="string" name="autofill_save_title" />
  <java-symbol type="string" name="autofill_save_title_with_type" />
  <java-symbol type="string" name="autofill_save_yes" />
+8 −2
Original line number Diff line number Diff line
@@ -285,11 +285,17 @@ public final class AutoFillUI {
    }

    public void dump(PrintWriter pw) {
        pw.println("AufoFill UI");
        pw.println("Autofill UI");
        final String prefix = "  ";
        pw.print(prefix); pw.print("showsFillUi: "); pw.println(mFillUi != null);
        final String prefix2 = "    ";
        pw.print(prefix); pw.print("showsSaveUi: "); pw.println(mSaveUi != null);
        pw.print(prefix); pw.print("save timeout: "); pw.println(mSaveTimeoutMs);
        if (mFillUi != null) {
            pw.print(prefix); pw.println("showsFillUi: true");
            mFillUi.dump(pw, prefix2);
        } else {
            pw.print(prefix); pw.println("showsFillUi: false");
        }
    }

    @android.annotation.UiThread
+18 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import android.widget.ListView;
import com.android.internal.R;
import libcore.util.Objects;

import java.io.PrintWriter;
import java.util.ArrayList;

final class FillUi {
@@ -64,6 +65,7 @@ final class FillUi {
    private final @Nullable ArrayAdapter<ViewItem> mAdapter;

    private @Nullable String mFilterText;
    private final String mAccessibilityTitle;

    private int mContentWidth;
    private int mContentHeight;
@@ -77,6 +79,8 @@ final class FillUi {
        mAnchorBounds.set(anchorBounds);
        mCallback = callback;

        mAccessibilityTitle = context.getString(R.string.autofill_picker_accessibility_title);

        if (response.getAuthentication() != null) {
            mListView = null;
            mAdapter = null;
@@ -321,6 +325,7 @@ final class FillUi {

        public void show(int desiredWidth, int desiredHeight, Rect anchorBounds) {
            final WindowManager.LayoutParams params = new WindowManager.LayoutParams();

            params.setTitle("FillUi");
            params.token = mActivityToken;
            params.type = WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG;
@@ -329,6 +334,7 @@ final class FillUi {
                    | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
                    | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH
                    | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
            params.accessibilityTitle = mAccessibilityTitle;

            mWm.getDefaultDisplay().getRealSize(mTempPoint);
            final int screenWidth = mTempPoint.x;
@@ -379,4 +385,16 @@ final class FillUi {
            }
        }
    }

    public void dump(PrintWriter pw, String prefix) {
        pw.print(prefix); pw.print("mAnchorBounds: "); pw.println(mAnchorBounds);
        pw.print(prefix); pw.print("mCallback: "); pw.println(mCallback != null);
        pw.print(prefix); pw.print("mListView: "); pw.println(mListView);
        pw.print(prefix); pw.print("mAdapter: "); pw.println(mAdapter != null);
        pw.print(prefix); pw.print("mFilterText: "); pw.println(mFilterText);
        pw.print(prefix); pw.print("mAccessibilityTitle: "); pw.println(mAccessibilityTitle);
        pw.print(prefix); pw.print("mContentWidth: "); pw.println(mContentWidth);
        pw.print(prefix); pw.print("mContentHeight: "); pw.println(mContentHeight);
        pw.print(prefix); pw.print("mDestroyed: "); pw.println(mDestroyed);
    }
}