aboutsummaryrefslogtreecommitdiff
path: root/input
diff options
context:
space:
mode:
authorDouglas Sigelbaum <sigelbaum@google.com>2017-11-09 15:20:17 -0800
committerDouglas Sigelbaum <sigelbaum@google.com>2017-11-10 13:41:47 -0800
commit083ba30364c1336e485efcb774fdb10858784bb2 (patch)
treea0d5cd906c27285452c2085828ca286b16de597e /input
parente3d03049d90480ba3c14c540f6bde1bb6fa20f66 (diff)
downloadandroid-083ba30364c1336e485efcb774fdb10858784bb2.tar.gz
Autofill sample formatting.
Test: manual Change-Id: I8f912ec6d239e0dae343fe3970e745f7214772e1
Diffstat (limited to 'input')
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/AndroidManifest.xml4
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/MainActivity.java2
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/Util.java7
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/commonexamples/CommonExamplesFragment.java23
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/commonexamples/CreditCardCompoundViewActivity.java2
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/commonexamples/CreditCardDatePickerActivity.java2
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/commonexamples/VirtualSignInActivity.java2
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/serviceverification/AbstractMultipleStepsActivity.java2
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/serviceverification/MultiplePartitionsActivity.java2
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/serviceverification/ServiceVerificationFragment.java22
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/view/autofillable/CustomVirtualView.java4
-rw-r--r--input/autofill/AutofillFramework/afservice/src/main/AndroidManifest.xml39
-rw-r--r--input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/AutofillHelper.java15
-rw-r--r--input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/Util.java7
-rw-r--r--input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/datasource/SharedPrefsAutofillRepository.java2
-rw-r--r--input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/model/FilledAutofillField.java2
-rw-r--r--input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/model/FilledAutofillFieldCollection.java2
-rw-r--r--input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/settings/SettingsActivity.java2
-rw-r--r--input/autofill/AutofillFramework/afservice/src/main/res/drawable-v24/ic_add_black_24dp.xml10
-rw-r--r--input/autofill/AutofillFramework/afservice/src/main/res/drawable-v24/ic_delete_forever_black_24dp.xml13
-rw-r--r--input/autofill/AutofillFramework/afservice/src/main/res/drawable-v24/ic_lock_black_24dp.xml10
-rw-r--r--input/autofill/AutofillFramework/afservice/src/main/res/drawable-v24/ic_person_black_24dp.xml13
-rw-r--r--input/autofill/AutofillFramework/afservice/src/main/res/layout/multidataset_service_auth_activity.xml3
-rw-r--r--input/autofill/AutofillFramework/afservice/src/main/res/layout/multidataset_service_list_item.xml3
-rw-r--r--input/autofill/AutofillFramework/afservice/src/main/res/layout/multidataset_service_settings_activity.xml6
-rw-r--r--input/autofill/AutofillFramework/afservice/src/main/res/layout/multidataset_service_settings_add_data_dialog.xml6
-rw-r--r--input/autofill/AutofillFramework/afservice/src/main/res/layout/multidataset_service_settings_authentication_dialog.xml6
-rw-r--r--input/autofill/AutofillFramework/afservice/src/main/res/values/styles.xml1
-rw-r--r--input/autofill/AutofillFramework/afservice/src/main/res/xml/multidataset_service.xml8
29 files changed, 106 insertions, 114 deletions
diff --git a/input/autofill/AutofillFramework/Application/src/main/AndroidManifest.xml b/input/autofill/AutofillFramework/Application/src/main/AndroidManifest.xml
index 87a02c3c..05fe780a 100644
--- a/input/autofill/AutofillFramework/Application/src/main/AndroidManifest.xml
+++ b/input/autofill/AutofillFramework/Application/src/main/AndroidManifest.xml
@@ -74,7 +74,7 @@
<activity
android:name=".serviceverification.MultipleStepsSignInActivity"
android:taskAffinity=".MultipleStepsSignInActivity">
- <!-- TODO: remove intent-filter and addCommonAutofillExamplesActivityvity menu instead -->
+ <!-- TODO: remove intent-filter and add to MainActivity menu instead -->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@@ -85,7 +85,7 @@
<activity
android:name=".serviceverification.MultipleStepsCreditCardActivity"
android:taskAffinity=".MultipleStepsCreditCardActivity">
- <!-- TODO: remove intent-filter and add MainActivity menu instead -->
+ <!-- TODO: remove intent-filter and add to MainActivity menu instead -->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
diff --git a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/MainActivity.java b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/MainActivity.java
index c6508735..974c66de 100644
--- a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/MainActivity.java
+++ b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/MainActivity.java
@@ -52,7 +52,7 @@ public class MainActivity extends AppCompatActivity {
* A simple pager adapter that holds 2 Fragments.
*/
private static class ScreenSlidePagerAdapter extends FragmentPagerAdapter {
- private BaseMainFragment[] fragments = new BaseMainFragment[] {new CommonExamplesFragment(),
+ private BaseMainFragment[] fragments = new BaseMainFragment[]{new CommonExamplesFragment(),
new ServiceVerificationFragment()};
private Context mContext;
diff --git a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/Util.java b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/Util.java
index 7e540bd9..288a908b 100644
--- a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/Util.java
+++ b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/Util.java
@@ -19,19 +19,12 @@ import android.app.assist.AssistStructure;
import android.app.assist.AssistStructure.ViewNode;
import android.app.assist.AssistStructure.WindowNode;
import android.os.Bundle;
-import android.service.autofill.FillContext;
-import android.service.autofill.SaveInfo;
-import android.support.annotation.NonNull;
import android.util.Log;
import android.view.View;
import android.view.ViewStructure.HtmlInfo;
import android.view.autofill.AutofillValue;
-import com.google.common.base.Joiner;
-
-import java.util.ArrayList;
import java.util.Arrays;
-import java.util.List;
import java.util.Set;
public final class Util {
diff --git a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/commonexamples/CommonExamplesFragment.java b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/commonexamples/CommonExamplesFragment.java
index 108b31ae..0bdcf2f3 100644
--- a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/commonexamples/CommonExamplesFragment.java
+++ b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/commonexamples/CommonExamplesFragment.java
@@ -18,7 +18,6 @@ package com.example.android.autofill.app.commonexamples;
import android.os.Bundle;
import android.support.annotation.Nullable;
-import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -46,38 +45,38 @@ public class CommonExamplesFragment extends BaseMainFragment {
NavigationItem creditCardAntiPatternPicker = root.findViewById(R.id.creditCardAntiPatternButton);
NavigationItem multiplePartitions = root.findViewById(R.id.multiplePartitionsButton);
NavigationItem loginWebView = root.findViewById(R.id.webviewSignInButton);
- loginEditTexts.setNavigationButtonClickListener( (view) ->
+ loginEditTexts.setNavigationButtonClickListener((view) ->
startActivity(StandardSignInActivity.getStartActivityIntent(getContext()))
);
- loginCustomVirtual.setNavigationButtonClickListener( (view) ->
+ loginCustomVirtual.setNavigationButtonClickListener((view) ->
startActivity(VirtualSignInActivity.getStartActivityIntent(getContext()))
);
- creditCard.setNavigationButtonClickListener( (view) ->
+ creditCard.setNavigationButtonClickListener((view) ->
startActivity(CreditCardActivity.getStartActivityIntent(getContext()))
);
- creditCardSpinners.setNavigationButtonClickListener( (view) ->
+ creditCardSpinners.setNavigationButtonClickListener((view) ->
startActivity(CreditCardSpinnersActivity.getStartActivityIntent(getContext()))
);
- loginAutoComplete.setNavigationButtonClickListener( (view) ->
+ loginAutoComplete.setNavigationButtonClickListener((view) ->
startActivity(
StandardAutoCompleteSignInActivity.getStartActivityIntent(getContext()))
);
- emailCompose.setNavigationButtonClickListener( (view) ->
+ emailCompose.setNavigationButtonClickListener((view) ->
startActivity(EmailComposeActivity.getStartActivityIntent(getContext()))
);
- creditCardCompoundView.setNavigationButtonClickListener( (view) ->
+ creditCardCompoundView.setNavigationButtonClickListener((view) ->
startActivity(CreditCardCompoundViewActivity.getStartActivityIntent(getContext()))
);
- creditCardDatePicker.setNavigationButtonClickListener( (view) ->
+ creditCardDatePicker.setNavigationButtonClickListener((view) ->
startActivity(CreditCardDatePickerActivity.getStartActivityIntent(getContext()))
);
- creditCardAntiPatternPicker.setNavigationButtonClickListener( (view) ->
+ creditCardAntiPatternPicker.setNavigationButtonClickListener((view) ->
startActivity(CreditCardAntiPatternActivity.getStartActivityIntent(getContext()))
);
- multiplePartitions.setNavigationButtonClickListener( (view) ->
+ multiplePartitions.setNavigationButtonClickListener((view) ->
startActivity(MultiplePartitionsActivity.getStartActivityIntent(getContext()))
);
- loginWebView.setNavigationButtonClickListener( (view) ->
+ loginWebView.setNavigationButtonClickListener((view) ->
startActivity(WebViewSignInActivity.getStartActivityIntent(getContext()))
);
return root;
diff --git a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/commonexamples/CreditCardCompoundViewActivity.java b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/commonexamples/CreditCardCompoundViewActivity.java
index 234977e2..09996602 100644
--- a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/commonexamples/CreditCardCompoundViewActivity.java
+++ b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/commonexamples/CreditCardCompoundViewActivity.java
@@ -25,9 +25,9 @@ import android.view.View;
import android.view.autofill.AutofillManager;
import android.widget.EditText;
-import com.example.android.autofill.app.view.autofillable.CreditCardExpirationDateCompoundView;
import com.example.android.autofill.app.R;
import com.example.android.autofill.app.WelcomeActivity;
+import com.example.android.autofill.app.view.autofillable.CreditCardExpirationDateCompoundView;
public class CreditCardCompoundViewActivity extends AppCompatActivity {
diff --git a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/commonexamples/CreditCardDatePickerActivity.java b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/commonexamples/CreditCardDatePickerActivity.java
index d834bf2a..f5191020 100644
--- a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/commonexamples/CreditCardDatePickerActivity.java
+++ b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/commonexamples/CreditCardDatePickerActivity.java
@@ -25,9 +25,9 @@ import android.view.View;
import android.view.autofill.AutofillManager;
import android.widget.EditText;
-import com.example.android.autofill.app.view.autofillable.CreditCardExpirationDatePickerView;
import com.example.android.autofill.app.R;
import com.example.android.autofill.app.WelcomeActivity;
+import com.example.android.autofill.app.view.autofillable.CreditCardExpirationDatePickerView;
import static com.example.android.autofill.app.Util.TAG;
diff --git a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/commonexamples/VirtualSignInActivity.java b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/commonexamples/VirtualSignInActivity.java
index f651ec95..baf04bd6 100644
--- a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/commonexamples/VirtualSignInActivity.java
+++ b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/commonexamples/VirtualSignInActivity.java
@@ -23,9 +23,9 @@ import android.view.View;
import android.view.autofill.AutofillManager;
import android.widget.Toast;
-import com.example.android.autofill.app.view.autofillable.CustomVirtualView;
import com.example.android.autofill.app.R;
import com.example.android.autofill.app.WelcomeActivity;
+import com.example.android.autofill.app.view.autofillable.CustomVirtualView;
/**
* Activity that uses a virtual views for Username/Password text fields.
diff --git a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/serviceverification/AbstractMultipleStepsActivity.java b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/serviceverification/AbstractMultipleStepsActivity.java
index 47258433..d836650a 100644
--- a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/serviceverification/AbstractMultipleStepsActivity.java
+++ b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/serviceverification/AbstractMultipleStepsActivity.java
@@ -35,7 +35,7 @@ import static com.example.android.autofill.app.Util.TAG;
/**
* Activity that emulates a multiple-steps wizard activity, where each step shows just one
* label and input.
- *
+ * <p>
* <p>Its's useful to verify how an autofill service handles account creation that takes multiple
* steps.
*/
diff --git a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/serviceverification/MultiplePartitionsActivity.java b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/serviceverification/MultiplePartitionsActivity.java
index 46d3dce4..06c80100 100644
--- a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/serviceverification/MultiplePartitionsActivity.java
+++ b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/serviceverification/MultiplePartitionsActivity.java
@@ -23,9 +23,9 @@ import android.view.View;
import android.view.autofill.AutofillManager;
import android.widget.Toast;
+import com.example.android.autofill.app.R;
import com.example.android.autofill.app.Util;
import com.example.android.autofill.app.view.autofillable.CustomVirtualView;
-import com.example.android.autofill.app.R;
import com.example.android.autofill.app.view.autofillable.ScrollableCustomVirtualView;
/**
diff --git a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/serviceverification/ServiceVerificationFragment.java b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/serviceverification/ServiceVerificationFragment.java
index 5768e180..ac5e178e 100644
--- a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/serviceverification/ServiceVerificationFragment.java
+++ b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/serviceverification/ServiceVerificationFragment.java
@@ -51,38 +51,38 @@ public class ServiceVerificationFragment extends BaseMainFragment {
NavigationItem creditCardAntiPatternPicker = root.findViewById(R.id.creditCardAntiPatternButton);
NavigationItem multiplePartitions = root.findViewById(R.id.multiplePartitionsButton);
NavigationItem loginWebView = root.findViewById(R.id.webviewSignInButton);
- loginEditTexts.setNavigationButtonClickListener( (view) ->
+ loginEditTexts.setNavigationButtonClickListener((view) ->
startActivity(StandardSignInActivity.getStartActivityIntent(getContext()))
);
- loginCustomVirtual.setNavigationButtonClickListener( (view) ->
+ loginCustomVirtual.setNavigationButtonClickListener((view) ->
startActivity(VirtualSignInActivity.getStartActivityIntent(getContext()))
);
- creditCard.setNavigationButtonClickListener( (view) ->
+ creditCard.setNavigationButtonClickListener((view) ->
startActivity(CreditCardActivity.getStartActivityIntent(getContext()))
);
- creditCardSpinners.setNavigationButtonClickListener( (view) ->
+ creditCardSpinners.setNavigationButtonClickListener((view) ->
startActivity(CreditCardSpinnersActivity.getStartActivityIntent(getContext()))
);
- loginAutoComplete.setNavigationButtonClickListener( (view) ->
+ loginAutoComplete.setNavigationButtonClickListener((view) ->
startActivity(
StandardAutoCompleteSignInActivity.getStartActivityIntent(getContext()))
);
- emailCompose.setNavigationButtonClickListener( (view) ->
+ emailCompose.setNavigationButtonClickListener((view) ->
startActivity(EmailComposeActivity.getStartActivityIntent(getContext()))
);
- creditCardCompoundView.setNavigationButtonClickListener( (view) ->
+ creditCardCompoundView.setNavigationButtonClickListener((view) ->
startActivity(CreditCardCompoundViewActivity.getStartActivityIntent(getContext()))
);
- creditCardDatePicker.setNavigationButtonClickListener( (view) ->
+ creditCardDatePicker.setNavigationButtonClickListener((view) ->
startActivity(CreditCardDatePickerActivity.getStartActivityIntent(getContext()))
);
- creditCardAntiPatternPicker.setNavigationButtonClickListener( (view) ->
+ creditCardAntiPatternPicker.setNavigationButtonClickListener((view) ->
startActivity(CreditCardAntiPatternActivity.getStartActivityIntent(getContext()))
);
- multiplePartitions.setNavigationButtonClickListener( (view) ->
+ multiplePartitions.setNavigationButtonClickListener((view) ->
startActivity(MultiplePartitionsActivity.getStartActivityIntent(getContext()))
);
- loginWebView.setNavigationButtonClickListener( (view) ->
+ loginWebView.setNavigationButtonClickListener((view) ->
startActivity(WebViewSignInActivity.getStartActivityIntent(getContext()))
);
return root;
diff --git a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/view/autofillable/CustomVirtualView.java b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/view/autofillable/CustomVirtualView.java
index 9e2908c3..6c6e1254 100644
--- a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/view/autofillable/CustomVirtualView.java
+++ b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/view/autofillable/CustomVirtualView.java
@@ -38,8 +38,8 @@ import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
-import com.example.android.autofill.app.Util;
import com.example.android.autofill.app.R;
+import com.example.android.autofill.app.Util;
import com.google.common.base.Preconditions;
import java.text.DateFormat;
@@ -60,7 +60,7 @@ public class CustomVirtualView extends View {
/**
* When set, it notifies AutofillManager of focus change as the view scrolls, so the
* autofill UI is continually drawn.
- *
+ * <p>
* <p>This is janky and incompatible with the way the autofill UI works on native views, but
* it's a cool experiment!
*/
diff --git a/input/autofill/AutofillFramework/afservice/src/main/AndroidManifest.xml b/input/autofill/AutofillFramework/afservice/src/main/AndroidManifest.xml
index f03a4548..aad334ea 100644
--- a/input/autofill/AutofillFramework/afservice/src/main/AndroidManifest.xml
+++ b/input/autofill/AutofillFramework/afservice/src/main/AndroidManifest.xml
@@ -1,29 +1,30 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.example.android.autofill.service">
+ package="com.example.android.autofill.service">
+
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:supportsRtl="true"
- android:theme="@style/AppTheme" >
- <!--
-Declare AutofillService implementation; only needed for a small number of apps that will
-be implementing an AutofillService. Framework parses meta-data and sets the service's
-Settings Activity based on what the meta-data resource points to.
--->
- <service
- android:name=".MyAutofillService"
- android:label="Multi-Dataset Autofill Service"
- android:permission="android.permission.BIND_AUTOFILL_SERVICE">
- <meta-data
- android:name="android.autofill"
- android:resource="@xml/multidataset_service" />
+ android:theme="@style/AppTheme">
+ <!--
+ Declare AutofillService implementation; only needed for a small number of apps that will
+ be implementing an AutofillService. Framework parses meta-data and sets the service's
+ Settings Activity based on what the meta-data resource points to.
+ -->
+ <service
+ android:name=".MyAutofillService"
+ android:label="Multi-Dataset Autofill Service"
+ android:permission="android.permission.BIND_AUTOFILL_SERVICE">
+ <meta-data
+ android:name="android.autofill"
+ android:resource="@xml/multidataset_service" />
- <intent-filter>
- <action android:name="android.service.autofill.AutofillService" />
- </intent-filter>
- </service>
+ <intent-filter>
+ <action android:name="android.service.autofill.AutofillService" />
+ </intent-filter>
+ </service>
- <activity android:name=".AuthActivity" />
+ <activity android:name=".AuthActivity" />
<!-- Including launcher icon for Autofill Settings to convenience. Not necessary for a
real service. -->
<activity
diff --git a/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/AutofillHelper.java b/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/AutofillHelper.java
index fb1c3c43..a3eeaab8 100644
--- a/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/AutofillHelper.java
+++ b/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/AutofillHelper.java
@@ -34,8 +34,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Set;
-import static com.example.android.autofill.service.Util.TAG;
import static com.example.android.autofill.service.Util.DEBUG;
+import static com.example.android.autofill.service.Util.TAG;
import static com.example.android.autofill.service.Util.bundleToString;
import static com.example.android.autofill.service.Util.getSaveTypeAsString;
@@ -44,6 +44,7 @@ import static com.example.android.autofill.service.Util.getSaveTypeAsString;
*/
public final class AutofillHelper {
+ static final String CLIENT_STATE_PARTIAL_ID_TEMPLATE = "partial-%s";
// TODO: move to settings activity and document it
private static final boolean SUPPORT_MULTIPLE_STEPS = true;
@@ -128,16 +129,14 @@ public final class AutofillHelper {
}
private static void setFullSaveInfo(FillResponse.Builder responseBuilder, int saveType,
- AutofillFieldMetadataCollection autofillFields) {
+ AutofillFieldMetadataCollection autofillFields) {
AutofillId[] autofillIds = autofillFields.getAutofillIds();
responseBuilder.setSaveInfo(new SaveInfo.Builder(saveType, autofillIds).build());
}
- static final String CLIENT_STATE_PARTIAL_ID_TEMPLATE = "partial-%s";
-
private static void setPartialSaveInfo(FillResponse.Builder responseBuilder, int saveType,
- AutofillFieldMetadataCollection autofillFields,
- Bundle previousClientState) {
+ AutofillFieldMetadataCollection autofillFields,
+ Bundle previousClientState) {
AutofillId[] autofillIds = autofillFields.getAutofillIds();
List<String> allHints = autofillFields.getAllHints();
if (DEBUG) {
@@ -152,7 +151,7 @@ public final class AutofillHelper {
&& saveType != SaveInfo.SAVE_DATA_TYPE_PASSWORD)
|| autofillIds.length != 1 || allHints.size() != 1) {
if (DEBUG) Log.d(TAG, "Unsupported activity for partial info; returning full");
- setFullSaveInfo(responseBuilder,saveType, autofillFields);
+ setFullSaveInfo(responseBuilder, saveType, autofillFields);
return;
}
@@ -179,7 +178,7 @@ public final class AutofillHelper {
newClientState.putParcelable(key, value);
if (previousValue != null) {
- AutofillId[] newIds = new AutofillId[] {previousValue, value};
+ AutofillId[] newIds = new AutofillId[]{previousValue, value};
int newSaveType = saveType | previousSaveType;
if (DEBUG) {
Log.d(TAG, "new values: type=" + getSaveTypeAsString(newSaveType)
diff --git a/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/Util.java b/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/Util.java
index 054c3c5b..1a5aeacb 100644
--- a/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/Util.java
+++ b/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/Util.java
@@ -41,6 +41,9 @@ public final class Util {
public static final boolean VERBOSE = false;
public static final String EXTRA_DATASET_NAME = "dataset_name";
public static final String EXTRA_FOR_RESPONSE = "for_response";
+ public static final NodeFilter AUTOFILL_ID_FILTER = (node, id) -> {
+ return id.equals(node.getAutofillId());
+ };
private static void bundleToString(StringBuilder builder, Bundle data) {
final Set<String> keySet = data.keySet();
@@ -234,10 +237,6 @@ public final class Util {
return null;
}
- public static final NodeFilter AUTOFILL_ID_FILTER = (node, id) -> {
- return id.equals(node.getAutofillId());
- };
-
/**
* Helper interface used to filter Assist nodes.
*/
diff --git a/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/datasource/SharedPrefsAutofillRepository.java b/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/datasource/SharedPrefsAutofillRepository.java
index 0643a3f0..f1eda62a 100644
--- a/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/datasource/SharedPrefsAutofillRepository.java
+++ b/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/datasource/SharedPrefsAutofillRepository.java
@@ -28,7 +28,7 @@ import java.util.Set;
/**
* Singleton autofill data repository that stores autofill fields to SharedPreferences.
- *
+ * <p>
* <p><b>Disclaimer</b>: you should not store sensitive fields like user data unencrypted.
* This is done here only for simplicity and learning purposes.
*/
diff --git a/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/model/FilledAutofillField.java b/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/model/FilledAutofillField.java
index c6d1115d..a7e52e56 100644
--- a/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/model/FilledAutofillField.java
+++ b/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/model/FilledAutofillField.java
@@ -24,9 +24,9 @@ import com.google.gson.annotations.Expose;
import java.util.Arrays;
-import static com.example.android.autofill.service.Util.TAG;
import static com.example.android.autofill.service.AutofillHints.convertToStoredHintNames;
import static com.example.android.autofill.service.AutofillHints.filterForSupportedHints;
+import static com.example.android.autofill.service.Util.TAG;
/**
* JSON serializable data class containing the same data as an {@link AutofillValue}.
diff --git a/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/model/FilledAutofillFieldCollection.java b/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/model/FilledAutofillFieldCollection.java
index a165e96d..89b210ba 100644
--- a/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/model/FilledAutofillFieldCollection.java
+++ b/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/model/FilledAutofillFieldCollection.java
@@ -153,7 +153,7 @@ public final class FilledAutofillFieldCollection {
/**
* Populates a {@link Dataset.Builder} with appropriate values for each {@link AutofillId}
* in a {@code AutofillFieldMetadataCollection}.
- *
+ * <p>
* In other words, it constructs an autofill
* {@link Dataset.Builder} by applying saved values (from this {@code FilledAutofillFieldCollection})
* to Views specified in a {@code AutofillFieldMetadataCollection}, which represents the current
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 3a96faf9..07922934 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
@@ -32,8 +32,8 @@ import android.widget.NumberPicker;
import android.widget.Switch;
import android.widget.TextView;
-import com.example.android.autofill.service.R;
import com.example.android.autofill.service.AutofillHints;
+import com.example.android.autofill.service.R;
import com.example.android.autofill.service.datasource.SharedPrefsAutofillRepository;
import com.example.android.autofill.service.datasource.SharedPrefsPackageVerificationRepository;
import com.example.android.autofill.service.model.FilledAutofillFieldCollection;
diff --git a/input/autofill/AutofillFramework/afservice/src/main/res/drawable-v24/ic_add_black_24dp.xml b/input/autofill/AutofillFramework/afservice/src/main/res/drawable-v24/ic_add_black_24dp.xml
index e50269d8..ed8512a4 100644
--- a/input/autofill/AutofillFramework/afservice/src/main/res/drawable-v24/ic_add_black_24dp.xml
+++ b/input/autofill/AutofillFramework/afservice/src/main/res/drawable-v24/ic_add_black_24dp.xml
@@ -14,11 +14,11 @@
* limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
- android:viewportWidth="24.0"
- android:viewportHeight="24.0">
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportHeight="24.0"
+ android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
- android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
+ android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" />
</vector>
diff --git a/input/autofill/AutofillFramework/afservice/src/main/res/drawable-v24/ic_delete_forever_black_24dp.xml b/input/autofill/AutofillFramework/afservice/src/main/res/drawable-v24/ic_delete_forever_black_24dp.xml
index 4d2afb01..5b5927d4 100644
--- a/input/autofill/AutofillFramework/afservice/src/main/res/drawable-v24/ic_delete_forever_black_24dp.xml
+++ b/input/autofill/AutofillFramework/afservice/src/main/res/drawable-v24/ic_delete_forever_black_24dp.xml
@@ -13,8 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
-<vector android:alpha="0.50" android:height="24dp"
- android:viewportHeight="24.0" android:viewportWidth="24.0"
- android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
- <path android:fillColor="#FF000000" android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2L18,7L6,7v12zM8.46,11.88l1.41,-1.41L12,12.59l2.12,-2.12 1.41,1.41L13.41,14l2.12,2.12 -1.41,1.41L12,15.41l-2.12,2.12 -1.41,-1.41L10.59,14l-2.13,-2.12zM15.5,4l-1,-1h-5l-1,1L5,4v2h14L19,4z"/>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:alpha="0.50"
+ android:viewportHeight="24.0"
+ android:viewportWidth="24.0">
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2L18,7L6,7v12zM8.46,11.88l1.41,-1.41L12,12.59l2.12,-2.12 1.41,1.41L13.41,14l2.12,2.12 -1.41,1.41L12,15.41l-2.12,2.12 -1.41,-1.41L10.59,14l-2.13,-2.12zM15.5,4l-1,-1h-5l-1,1L5,4v2h14L19,4z" />
</vector>
diff --git a/input/autofill/AutofillFramework/afservice/src/main/res/drawable-v24/ic_lock_black_24dp.xml b/input/autofill/AutofillFramework/afservice/src/main/res/drawable-v24/ic_lock_black_24dp.xml
index 6b2f014d..6e18f1ac 100644
--- a/input/autofill/AutofillFramework/afservice/src/main/res/drawable-v24/ic_lock_black_24dp.xml
+++ b/input/autofill/AutofillFramework/afservice/src/main/res/drawable-v24/ic_lock_black_24dp.xml
@@ -14,11 +14,11 @@
* limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
- android:viewportWidth="24.0"
- android:viewportHeight="24.0">
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportHeight="24.0"
+ android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
- android:pathData="M18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM12,17c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2zM15.1,8L8.9,8L8.9,6c0,-1.71 1.39,-3.1 3.1,-3.1 1.71,0 3.1,1.39 3.1,3.1v2z"/>
+ android:pathData="M18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM12,17c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2zM15.1,8L8.9,8L8.9,6c0,-1.71 1.39,-3.1 3.1,-3.1 1.71,0 3.1,1.39 3.1,3.1v2z" />
</vector>
diff --git a/input/autofill/AutofillFramework/afservice/src/main/res/drawable-v24/ic_person_black_24dp.xml b/input/autofill/AutofillFramework/afservice/src/main/res/drawable-v24/ic_person_black_24dp.xml
index 6534d9f0..032db129 100644
--- a/input/autofill/AutofillFramework/afservice/src/main/res/drawable-v24/ic_person_black_24dp.xml
+++ b/input/autofill/AutofillFramework/afservice/src/main/res/drawable-v24/ic_person_black_24dp.xml
@@ -13,8 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
-<vector android:alpha="0.50" android:height="24dp"
- android:viewportHeight="24.0" android:viewportWidth="24.0"
- android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
- <path android:fillColor="#FF000000" android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:alpha="0.50"
+ android:viewportHeight="24.0"
+ android:viewportWidth="24.0">
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z" />
</vector>
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 5430e527..844ea0a6 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
@@ -13,8 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
-<android.support.constraint.ConstraintLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/authLayout"
diff --git a/input/autofill/AutofillFramework/afservice/src/main/res/layout/multidataset_service_list_item.xml b/input/autofill/AutofillFramework/afservice/src/main/res/layout/multidataset_service_list_item.xml
index ef564285..442d54e7 100644
--- a/input/autofill/AutofillFramework/afservice/src/main/res/layout/multidataset_service_list_item.xml
+++ b/input/autofill/AutofillFramework/afservice/src/main/res/layout/multidataset_service_list_item.xml
@@ -13,8 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
diff --git a/input/autofill/AutofillFramework/afservice/src/main/res/layout/multidataset_service_settings_activity.xml b/input/autofill/AutofillFramework/afservice/src/main/res/layout/multidataset_service_settings_activity.xml
index 1618bdce..ded73933 100644
--- a/input/autofill/AutofillFramework/afservice/src/main/res/layout/multidataset_service_settings_activity.xml
+++ b/input/autofill/AutofillFramework/afservice/src/main/res/layout/multidataset_service_settings_activity.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,8 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
-<android.support.v4.widget.NestedScrollView
- xmlns:android="http://schemas.android.com/apk/res/android"
+<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:importantForAutofill="no"
diff --git a/input/autofill/AutofillFramework/afservice/src/main/res/layout/multidataset_service_settings_add_data_dialog.xml b/input/autofill/AutofillFramework/afservice/src/main/res/layout/multidataset_service_settings_add_data_dialog.xml
index 019a3674..530451e9 100644
--- a/input/autofill/AutofillFramework/afservice/src/main/res/layout/multidataset_service_settings_add_data_dialog.xml
+++ b/input/autofill/AutofillFramework/afservice/src/main/res/layout/multidataset_service_settings_add_data_dialog.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,8 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
-<NumberPicker
- xmlns:android="http://schemas.android.com/apk/res/android"
+<NumberPicker xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/number_of_datasets_picker"
android:layout_width="match_parent"
android:layout_height="match_parent"
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 bfd6931b..a84e45ff 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
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,8 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
-<EditText
- xmlns:android="http://schemas.android.com/apk/res/android"
+<EditText xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/master_password_field"
android:layout_width="match_parent"
android:layout_height="wrap_content"
diff --git a/input/autofill/AutofillFramework/afservice/src/main/res/values/styles.xml b/input/autofill/AutofillFramework/afservice/src/main/res/values/styles.xml
index b954cb67..84e2bb27 100644
--- a/input/autofill/AutofillFramework/afservice/src/main/res/values/styles.xml
+++ b/input/autofill/AutofillFramework/afservice/src/main/res/values/styles.xml
@@ -7,6 +7,7 @@
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
+
<style name="Settings.Label" parent="">
<item name="android:ellipsize">end</item>
<item name="android:lines">1</item>
diff --git a/input/autofill/AutofillFramework/afservice/src/main/res/xml/multidataset_service.xml b/input/autofill/AutofillFramework/afservice/src/main/res/xml/multidataset_service.xml
index 88768151..de58167c 100644
--- a/input/autofill/AutofillFramework/afservice/src/main/res/xml/multidataset_service.xml
+++ b/input/autofill/AutofillFramework/afservice/src/main/res/xml/multidataset_service.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,6 +18,5 @@
Attributes for the AutoFill service that tell the framework what will act as the Autofill service's
Settings Activity. This is pointed to in the service's meta-data in the application's manifest.
-->
-<autofill-service
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:settingsActivity="com.example.android.autofill.service.settings.SettingsActivity"/> \ No newline at end of file
+<autofill-service xmlns:android="http://schemas.android.com/apk/res/android"
+ android:settingsActivity="com.example.android.autofill.service.settings.SettingsActivity" /> \ No newline at end of file