Loading src/com/android/settings/applications/autofill/AutofillPickerTrampolineActivity.java +14 −14 Original line number Diff line number Diff line Loading @@ -14,9 +14,9 @@ package com.android.settings.applications.autofill; import android.app.Activity; import android.content.ComponentName; import android.content.Intent; import android.os.Bundle; import android.os.UserHandle; import android.view.autofill.AutofillManager; import com.android.settings.applications.defaultapps.DefaultAutofillPicker; Loading @@ -34,20 +34,9 @@ public class AutofillPickerTrampolineActivity extends Activity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // First check if the current user's service already belongs to the app... final Intent intent = getIntent(); final String packageName = intent.getData().getSchemeSpecificPart(); final String currentService = DefaultAutofillPicker.getDefaultKey( this, UserHandle.myUserId()); if (currentService != null && currentService.startsWith(packageName)) { // ...and succeed right away if it does. setResult(RESULT_OK); finish(); return; } // Then check if the Autofill is available for the current user... final AutofillManager afm = getSystemService(AutofillManager.class); // First check if the Autofill is available for the current user... if (afm == null || !afm.hasAutofillFeature() || !afm.isAutofillSupported()) { // ... and fail right away if it is not. setResult(RESULT_CANCELED); Loading @@ -55,6 +44,17 @@ public class AutofillPickerTrampolineActivity extends Activity { return; } // Then check if the current user's service already belongs to the app... final Intent intent = getIntent(); final String packageName = intent.getData().getSchemeSpecificPart(); final ComponentName currentService = afm.getAutofillServiceComponentName(); if (currentService != null && currentService.getPackageName().equals(packageName)) { // ...and succeed right away if it does. setResult(RESULT_OK); finish(); return; } // Otherwise, go ahead and show the real UI... final Intent newIntent = new Intent(this, AutofillPickerActivity.class) .setFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT) Loading Loading
src/com/android/settings/applications/autofill/AutofillPickerTrampolineActivity.java +14 −14 Original line number Diff line number Diff line Loading @@ -14,9 +14,9 @@ package com.android.settings.applications.autofill; import android.app.Activity; import android.content.ComponentName; import android.content.Intent; import android.os.Bundle; import android.os.UserHandle; import android.view.autofill.AutofillManager; import com.android.settings.applications.defaultapps.DefaultAutofillPicker; Loading @@ -34,20 +34,9 @@ public class AutofillPickerTrampolineActivity extends Activity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // First check if the current user's service already belongs to the app... final Intent intent = getIntent(); final String packageName = intent.getData().getSchemeSpecificPart(); final String currentService = DefaultAutofillPicker.getDefaultKey( this, UserHandle.myUserId()); if (currentService != null && currentService.startsWith(packageName)) { // ...and succeed right away if it does. setResult(RESULT_OK); finish(); return; } // Then check if the Autofill is available for the current user... final AutofillManager afm = getSystemService(AutofillManager.class); // First check if the Autofill is available for the current user... if (afm == null || !afm.hasAutofillFeature() || !afm.isAutofillSupported()) { // ... and fail right away if it is not. setResult(RESULT_CANCELED); Loading @@ -55,6 +44,17 @@ public class AutofillPickerTrampolineActivity extends Activity { return; } // Then check if the current user's service already belongs to the app... final Intent intent = getIntent(); final String packageName = intent.getData().getSchemeSpecificPart(); final ComponentName currentService = afm.getAutofillServiceComponentName(); if (currentService != null && currentService.getPackageName().equals(packageName)) { // ...and succeed right away if it does. setResult(RESULT_OK); finish(); return; } // Otherwise, go ahead and show the real UI... final Intent newIntent = new Intent(this, AutofillPickerActivity.class) .setFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT) Loading