1/* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package com.android.settings.applications; 18 19import android.view.autofill.AutofillManager; 20 21/** 22 * This interface replicates a subset of the android.view.autofill.AutofillManager (AFM). The 23 * interface exists so that we can use a thin wrapper around the AFM in production code and a mock 24 * in tests. We cannot directly mock or shadow the AFM, because some of the methods we rely on are 25 * newer than the API version supported by Robolectric. 26 */ 27public interface AutofillManagerWrapper { 28 /** 29 * Calls {@code AutofillManager.hasAutofillFeature()}. 30 * 31 * @see AutofillManager#hasAutofillFeature 32 */ 33 public boolean hasAutofillFeature(); 34 35 /** 36 * Calls {@code AutofillManager.isAutofillSupported()}. 37 * 38 * @see AutofillManager#isAutofillSupported 39 */ 40 public boolean isAutofillSupported(); 41} 42