Merge "Update language to comply with Android's inclusive language guidance"
diff --git a/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/AuthActivity.java b/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/AuthActivity.java
index e1660b7..c5d32ea 100644
--- a/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/AuthActivity.java
+++ b/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/AuthActivity.java
@@ -15,6 +15,13 @@
  */
 package com.example.android.autofill.service;
 
+import static android.view.autofill.AutofillManager.EXTRA_ASSIST_STRUCTURE;
+import static android.view.autofill.AutofillManager.EXTRA_AUTHENTICATION_RESULT;
+
+import static com.example.android.autofill.service.util.Util.EXTRA_DATASET_NAME;
+import static com.example.android.autofill.service.util.Util.EXTRA_FOR_RESPONSE;
+import static com.example.android.autofill.service.util.Util.logw;
+
 import android.app.PendingIntent;
 import android.app.assist.AssistStructure;
 import android.content.Context;
@@ -51,13 +58,6 @@
 import java.util.HashMap;
 import java.util.List;
 
-import static android.view.autofill.AutofillManager.EXTRA_ASSIST_STRUCTURE;
-import static android.view.autofill.AutofillManager.EXTRA_AUTHENTICATION_RESULT;
-import static com.example.android.autofill.service.util.Util.EXTRA_DATASET_NAME;
-import static com.example.android.autofill.service.util.Util.EXTRA_FOR_RESPONSE;
-import static com.example.android.autofill.service.util.Util.logw;
-
-
 /**
  * This Activity controls the UI for logging in to the Autofill service.
  * It is launched when an Autofill Response or specific Dataset within the Response requires
@@ -70,7 +70,7 @@
 
     private LocalAutofillDataSource mLocalAutofillDataSource;
     private DigitalAssetLinksRepository mDalRepository;
-    private EditText mMasterPassword;
+    private EditText mMainPassword;
     private DatasetAdapter mDatasetAdapter;
     private ResponseAdapter mResponseAdapter;
     private ClientViewMetadata mClientViewMetadata;
@@ -107,7 +107,7 @@
         mLocalAutofillDataSource = LocalAutofillDataSource.getInstance(sharedPreferences,
                 autofillDao, new AppExecutors());
         mDalRepository = DigitalAssetLinksRepository.getInstance(getPackageManager());
-        mMasterPassword = findViewById(R.id.master_password);
+        mMainPassword = findViewById(R.id.main_password);
         mPackageName = getPackageName();
         mPreferences = MyPreferences.getInstance(this);
         findViewById(R.id.login).setOnClickListener((view) -> login());
@@ -118,8 +118,8 @@
     }
 
     private void login() {
-        Editable password = mMasterPassword.getText();
-        String correctPassword = MyPreferences.getInstance(AuthActivity.this).getMasterPassword();
+        Editable password = mMainPassword.getText();
+        String correctPassword = MyPreferences.getInstance(AuthActivity.this).getMainPassword();
         if (password.toString().equals(correctPassword)) {
             onSuccess();
         } else {
diff --git a/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/settings/MyPreferences.java b/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/settings/MyPreferences.java
index 6a723f0..f006b2d 100644
--- a/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/settings/MyPreferences.java
+++ b/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/settings/MyPreferences.java
@@ -26,7 +26,7 @@
 public class MyPreferences {
     private static final String RESPONSE_AUTH_KEY = "response_auth";
     private static final String DATASET_AUTH_KEY = "dataset_auth";
-    private static final String MASTER_PASSWORD_KEY = "master_password";
+    private static final String MAIN_PASSWORD_KEY = "main_password";
     private static final String LOGGING_LEVEL = "logging_level";
     private static final String DAL_CHECK_REQUIRED = "dal_check_required";
     private static final String NUMBER_DATASETS = "number_datasets";
@@ -74,21 +74,21 @@
     }
 
     /**
-     * Gets autofill master username.
+     * Gets autofill main username.
      */
-    public String getMasterPassword() {
-        return mPrefs.getString(MASTER_PASSWORD_KEY, null);
+    public String getMainPassword() {
+        return mPrefs.getString(MAIN_PASSWORD_KEY, null);
     }
 
     /**
-     * Sets autofill master password.
+     * Sets autofill main password.
      */
-    public void setMasterPassword(@NonNull String masterPassword) {
-        mPrefs.edit().putString(MASTER_PASSWORD_KEY, masterPassword).apply();
+    public void setMainPassword(@NonNull String mainPassword) {
+        mPrefs.edit().putString(MAIN_PASSWORD_KEY, mainPassword).apply();
     }
 
     public void clearCredentials() {
-        mPrefs.edit().remove(MASTER_PASSWORD_KEY).apply();
+        mPrefs.edit().remove(MAIN_PASSWORD_KEY).apply();
     }
 
     public Util.LogLevel getLoggingLevel() {
diff --git a/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/settings/SettingsActivity.java b/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/settings/SettingsActivity.java
index 500ceec..9b4916f 100644
--- a/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/settings/SettingsActivity.java
+++ b/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/settings/SettingsActivity.java
@@ -15,6 +15,12 @@
  */
 package com.example.android.autofill.service.settings;
 
+import static com.example.android.autofill.service.util.Util.DalCheckRequirement.AllUrls;
+import static com.example.android.autofill.service.util.Util.DalCheckRequirement.Disabled;
+import static com.example.android.autofill.service.util.Util.DalCheckRequirement.LoginOnly;
+import static com.example.android.autofill.service.util.Util.logd;
+import static com.example.android.autofill.service.util.Util.logw;
+
 import android.content.Context;
 import android.content.DialogInterface;
 import android.content.Intent;
@@ -56,12 +62,6 @@
 
 import java.util.List;
 
-import static com.example.android.autofill.service.util.Util.DalCheckRequirement.AllUrls;
-import static com.example.android.autofill.service.util.Util.DalCheckRequirement.Disabled;
-import static com.example.android.autofill.service.util.Util.DalCheckRequirement.LoginOnly;
-import static com.example.android.autofill.service.util.Util.logd;
-import static com.example.android.autofill.service.util.Util.logw;
-
 public class SettingsActivity extends AppCompatActivity {
     private static final String TAG = "SettingsActivity";
     private static final int REQUEST_CODE_SET_DEFAULT = 1;
@@ -111,7 +111,7 @@
                 R.id.settings_auth_credentials_label,
                 R.id.settings_auth_credentials_icon,
                 (view) -> {
-                    if (mPreferences.getMasterPassword() != null) {
+                    if (mPreferences.getMainPassword() != null) {
                         buildCurrentCredentialsDialog().show();
                     } else {
                         buildNewCredentialsDialog().show();
@@ -258,7 +258,7 @@
         final EditText currentPasswordField = LayoutInflater
                 .from(SettingsActivity.this)
                 .inflate(R.layout.multidataset_service_settings_authentication_dialog, null)
-                .findViewById(R.id.master_password_field);
+                .findViewById(R.id.main_password_field);
         return prepareCredentialsDialog()
                 .setMessage(R.string.settings_auth_enter_current_password)
                 .setView(currentPasswordField)
@@ -266,7 +266,7 @@
                     @Override
                     public void onClick(DialogInterface dialog, int which) {
                         String password = currentPasswordField.getText().toString();
-                        if (mPreferences.getMasterPassword()
+                        if (mPreferences.getMainPassword()
                                 .equals(password)) {
                             buildNewCredentialsDialog().show();
                             dialog.dismiss();
@@ -280,13 +280,13 @@
         final EditText newPasswordField = LayoutInflater
                 .from(SettingsActivity.this)
                 .inflate(R.layout.multidataset_service_settings_authentication_dialog, null)
-                .findViewById(R.id.master_password_field);
+                .findViewById(R.id.main_password_field);
         return prepareCredentialsDialog()
                 .setMessage(R.string.settings_auth_enter_new_password)
                 .setView(newPasswordField)
                 .setPositiveButton(R.string.settings_ok, (dialog, which) -> {
                     String password = newPasswordField.getText().toString();
-                    mPreferences.setMasterPassword(password);
+                    mPreferences.setMainPassword(password);
                     dialog.dismiss();
                 })
                 .create();
diff --git a/input/autofill/AutofillFramework/afservice/src/main/res/layout/multidataset_service_auth_activity.xml b/input/autofill/AutofillFramework/afservice/src/main/res/layout/multidataset_service_auth_activity.xml
index 844ea0a..32cb592 100644
--- a/input/autofill/AutofillFramework/afservice/src/main/res/layout/multidataset_service_auth_activity.xml
+++ b/input/autofill/AutofillFramework/afservice/src/main/res/layout/multidataset_service_auth_activity.xml
@@ -28,12 +28,12 @@
     tools:context="com.example.android.autofill.service.AuthActivity">
 
     <TextView
-        android:id="@+id/master_login_header"
+        android:id="@+id/main_login_header"
         style="@style/TextAppearance.AppCompat.Large"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginTop="@dimen/spacing_normal"
-        android:text="@string/autofill_master_login_label"
+        android:text="@string/autofill_main_login_label"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintHorizontal_bias="0.5"
         app:layout_constraintStart_toStartOf="parent"
@@ -47,15 +47,15 @@
         android:layout_marginEnd="@dimen/spacing_normal"
         android:layout_marginStart="@dimen/spacing_normal"
         android:layout_marginTop="@dimen/spacing_large"
-        android:labelFor="@+id/master_password"
+        android:labelFor="@+id/main_password"
         android:text="@string/auth_password_label"
-        app:layout_constraintEnd_toStartOf="@+id/master_password"
+        app:layout_constraintEnd_toStartOf="@+id/main_password"
         app:layout_constraintHorizontal_chainStyle="packed"
         app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/master_login_header" />
+        app:layout_constraintTop_toBottomOf="@+id/main_login_header" />
 
     <EditText
-        android:id="@+id/master_password"
+        android:id="@+id/main_password"
         android:layout_width="@dimen/text_field_width"
         android:layout_height="wrap_content"
         android:layout_marginEnd="@dimen/spacing_normal"
@@ -80,7 +80,7 @@
         app:layout_constraintHorizontal_bias="0.5"
         app:layout_constraintHorizontal_chainStyle="packed"
         app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/master_password" />
+        app:layout_constraintTop_toBottomOf="@+id/main_password" />
 
     <TextView
         android:id="@+id/login"
diff --git a/input/autofill/AutofillFramework/afservice/src/main/res/layout/multidataset_service_settings_authentication_dialog.xml b/input/autofill/AutofillFramework/afservice/src/main/res/layout/multidataset_service_settings_authentication_dialog.xml
index a84e45f..19a1733 100644
--- a/input/autofill/AutofillFramework/afservice/src/main/res/layout/multidataset_service_settings_authentication_dialog.xml
+++ b/input/autofill/AutofillFramework/afservice/src/main/res/layout/multidataset_service_settings_authentication_dialog.xml
@@ -14,7 +14,7 @@
  * limitations under the License.
 -->
 <EditText xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/master_password_field"
+    android:id="@+id/main_password_field"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:layout_margin="@dimen/spacing_normal"
diff --git a/input/autofill/AutofillFramework/afservice/src/main/res/values/strings.xml b/input/autofill/AutofillFramework/afservice/src/main/res/values/strings.xml
index e7b1f88..3729f88 100644
--- a/input/autofill/AutofillFramework/afservice/src/main/res/values/strings.xml
+++ b/input/autofill/AutofillFramework/afservice/src/main/res/values/strings.xml
@@ -62,7 +62,7 @@
     <string name="settings_auth_enter_new_password">Enter new password</string>
     <string name="settings_auth_change_credentials_title">Change credentials</string>
     <string name="settings_number_of_datasets_label">Number of Datasets</string>
-    <string name="autofill_master_login_label">Autofill Master Login</string>
+    <string name="autofill_main_login_label">Autofill Main Login</string>
     <string name="auth_password_label">Password</string>
     <string name="auth_cancel">Cancel</string>
     <string name="auth_login_label">Login</string>