Merge "Fixed AutofillOptions.isAugmentedAutofillEnabled to use the right client." into qt-dev
This commit is contained in:
@@ -127,7 +127,6 @@ import android.view.autofill.AutofillPopupWindow;
|
||||
import android.view.autofill.IAutofillWindowPresenter;
|
||||
import android.view.contentcapture.ContentCaptureContext;
|
||||
import android.view.contentcapture.ContentCaptureManager;
|
||||
import android.view.contentcapture.ContentCaptureManager.ContentCaptureClient;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.Toast;
|
||||
import android.widget.Toolbar;
|
||||
@@ -724,7 +723,7 @@ public class Activity extends ContextThemeWrapper
|
||||
Window.Callback, KeyEvent.Callback,
|
||||
OnCreateContextMenuListener, ComponentCallbacks2,
|
||||
Window.OnWindowDismissedCallback, WindowControllerCallback,
|
||||
AutofillManager.AutofillClient, ContentCaptureManager.ContentCaptureClient {
|
||||
AutofillManager.AutofillClient {
|
||||
private static final String TAG = "Activity";
|
||||
private static final boolean DEBUG_LIFECYCLE = false;
|
||||
|
||||
@@ -1124,12 +1123,6 @@ public class Activity extends ContextThemeWrapper
|
||||
return this;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public final ContentCaptureClient getContentCaptureClient() {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register an {@link Application.ActivityLifecycleCallbacks} instance that receives
|
||||
* lifecycle callbacks for only this Activity.
|
||||
@@ -6509,12 +6502,6 @@ public class Activity extends ContextThemeWrapper
|
||||
return getComponentName();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public final ComponentName contentCaptureClientGetComponentName() {
|
||||
return getComponentName();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a {@link SharedPreferences} object for accessing preferences
|
||||
* that are private to this activity. This simply calls the underlying
|
||||
|
||||
@@ -24,7 +24,7 @@ import android.os.Parcelable;
|
||||
import android.util.ArraySet;
|
||||
import android.util.Log;
|
||||
import android.view.autofill.AutofillManager;
|
||||
import android.view.contentcapture.ContentCaptureManager.ContentCaptureClient;
|
||||
import android.view.autofill.AutofillManager.AutofillClient;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
|
||||
@@ -73,10 +73,10 @@ public final class AutofillOptions implements Parcelable {
|
||||
public boolean isAugmentedAutofillEnabled(@NonNull Context context) {
|
||||
if (!augmentedAutofillEnabled) return false;
|
||||
|
||||
final ContentCaptureClient contentCaptureClient = context.getContentCaptureClient();
|
||||
if (contentCaptureClient == null) return false;
|
||||
final AutofillClient autofillClient = context.getAutofillClient();
|
||||
if (autofillClient == null) return false;
|
||||
|
||||
final ComponentName component = contentCaptureClient.contentCaptureClientGetComponentName();
|
||||
final ComponentName component = autofillClient.autofillClientGetComponentName();
|
||||
return whitelistedActivitiesForAugmentedAutofill == null
|
||||
|| whitelistedActivitiesForAugmentedAutofill.contains(component);
|
||||
}
|
||||
|
||||
@@ -70,7 +70,6 @@ import android.view.View;
|
||||
import android.view.ViewDebug;
|
||||
import android.view.WindowManager;
|
||||
import android.view.autofill.AutofillManager.AutofillClient;
|
||||
import android.view.contentcapture.ContentCaptureManager.ContentCaptureClient;
|
||||
import android.view.textclassifier.TextClassificationManager;
|
||||
|
||||
import java.io.File;
|
||||
@@ -5411,14 +5410,6 @@ public abstract class Context {
|
||||
public void setAutofillClient(@SuppressWarnings("unused") AutofillClient client) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@Nullable
|
||||
public ContentCaptureClient getContentCaptureClient() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
|
||||
@@ -342,15 +342,6 @@ public final class ContentCaptureManager {
|
||||
@GuardedBy("mLock")
|
||||
private MainContentCaptureSession mMainSession;
|
||||
|
||||
/** @hide */
|
||||
public interface ContentCaptureClient {
|
||||
/**
|
||||
* Gets the component name of the client.
|
||||
*/
|
||||
@NonNull
|
||||
ComponentName contentCaptureClientGetComponentName();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public ContentCaptureManager(@NonNull Context context,
|
||||
@NonNull IContentCaptureManager service, @NonNull ContentCaptureOptions options) {
|
||||
|
||||
Reference in New Issue
Block a user