feat(A11yFeedback): Pixel overlay to expose the feedback bucket ID
This change introduces a feature provider for Pixel overlays, allowing customization of the feedback bucket ID on Android. Bug: 393980229 Test: Manual testing for Pixel and non-Pixel overlay in real device Test: atest AccessibilitySettingsTest FeedbackManagerTest Flag: com.android.server.accessibility.enable_low_vision_generic_feedback Change-Id: Ieeb1dba4de5c13a275e66781621cbfcca7219a5e
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (C) 2025 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.settings.accessibility;
|
||||
|
||||
import android.content.ComponentName;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Provider for Accessibility feedback related features.
|
||||
*/
|
||||
public interface AccessibilityFeedbackFeatureProvider {
|
||||
|
||||
/**
|
||||
* Returns value according to the {@code componentName}.
|
||||
*
|
||||
* @param componentName the component name of the downloaded service or activity
|
||||
* @return Feedback bucket ID
|
||||
*/
|
||||
@Nullable
|
||||
String getCategory(@Nullable ComponentName componentName);
|
||||
}
|
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (C) 2025 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.settings.accessibility;
|
||||
|
||||
import android.content.ComponentName;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
/** Default implementation of {@link AccessibilityFeedbackFeatureProvider}. */
|
||||
public class AccessibilityFeedbackFeatureProviderImpl implements
|
||||
AccessibilityFeedbackFeatureProvider{
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public String getCategory(@Nullable ComponentName componentName) {
|
||||
return "";
|
||||
}
|
||||
}
|
@@ -16,6 +16,7 @@
|
||||
package com.android.settings.accessibility;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
|
||||
@@ -23,6 +24,7 @@ import androidx.annotation.Nullable;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
|
||||
import com.android.server.accessibility.Flags;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settingslib.DeviceInfoUtils;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
@@ -33,14 +35,11 @@ import java.lang.ref.WeakReference;
|
||||
*/
|
||||
public class FeedbackManager {
|
||||
|
||||
// TODO(b/393980229): Add a feature provider for Pixel overlay to expose the feedback bucket ID
|
||||
static final String ACCESSIBILITY_FEEDBACK_REQUEST_BUCKET_ID =
|
||||
"com.google.android.settings.intelligence.ACCESSIBILITY_FEEDBACK_REQUEST";
|
||||
static final String CATEGORY_TAG = "category_tag";
|
||||
private static final int FEEDBACK_INTENT_RESULT_CODE = 0;
|
||||
|
||||
private final WeakReference<Activity> mActivityWeakReference;
|
||||
@Nullable private final String mFeedbackReporterPackage;
|
||||
@Nullable private final String mReporterPackage;
|
||||
@Nullable private final String mCategoryTag;
|
||||
|
||||
/**
|
||||
@@ -49,14 +48,36 @@ public class FeedbackManager {
|
||||
* @param activity The activity context. A WeakReference is used to prevent memory leaks.
|
||||
*/
|
||||
public FeedbackManager(@Nullable Activity activity) {
|
||||
this(activity, DeviceInfoUtils.getFeedbackReporterPackage(activity));
|
||||
this(activity, /* componentName= */ null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new FeedbackManager.
|
||||
*
|
||||
* @param activity The activity context. A WeakReference is used to prevent memory leaks.
|
||||
* @param componentName The component name associated with the feedback.
|
||||
*/
|
||||
public FeedbackManager(@Nullable Activity activity, @Nullable ComponentName componentName) {
|
||||
this(activity,
|
||||
DeviceInfoUtils.getFeedbackReporterPackage(activity),
|
||||
FeatureFactory.getFeatureFactory()
|
||||
.getAccessibilityFeedbackFeatureProvider()
|
||||
.getCategory(componentName));
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new FeedbackManager. This constructor is visible for testing.
|
||||
*
|
||||
* @param activity The activity context. A WeakReference is used to prevent memory leaks.
|
||||
* @param reporterPackage The package name of the feedback reporter.
|
||||
* @param category The feedback bucket ID.
|
||||
*/
|
||||
@VisibleForTesting
|
||||
public FeedbackManager(@Nullable Activity activity, @Nullable String feedbackReporterPackage) {
|
||||
public FeedbackManager(@Nullable Activity activity, @Nullable String reporterPackage,
|
||||
@Nullable String category) {
|
||||
this.mActivityWeakReference = new WeakReference<>(activity);
|
||||
this.mFeedbackReporterPackage = feedbackReporterPackage;
|
||||
this.mCategoryTag = ACCESSIBILITY_FEEDBACK_REQUEST_BUCKET_ID;
|
||||
this.mReporterPackage = reporterPackage;
|
||||
this.mCategoryTag = category;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -69,7 +90,9 @@ public class FeedbackManager {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !TextUtils.isEmpty(mFeedbackReporterPackage) && mActivityWeakReference.get() != null;
|
||||
return !TextUtils.isEmpty(mReporterPackage)
|
||||
&& !TextUtils.isEmpty(mCategoryTag)
|
||||
&& mActivityWeakReference.get() != null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -87,7 +110,7 @@ public class FeedbackManager {
|
||||
}
|
||||
|
||||
final Intent intent = new Intent(Intent.ACTION_BUG_REPORT);
|
||||
intent.setPackage(mFeedbackReporterPackage);
|
||||
intent.setPackage(mReporterPackage);
|
||||
intent.putExtra(CATEGORY_TAG, mCategoryTag);
|
||||
activity.startActivityForResult(intent, FEEDBACK_INTENT_RESULT_CODE);
|
||||
return true;
|
||||
|
@@ -16,6 +16,7 @@
|
||||
package com.android.settings.overlay
|
||||
|
||||
import android.content.Context
|
||||
import com.android.settings.accessibility.AccessibilityFeedbackFeatureProvider
|
||||
import com.android.settings.accessibility.AccessibilityMetricsFeatureProvider
|
||||
import com.android.settings.accessibility.AccessibilitySearchFeatureProvider
|
||||
import com.android.settings.accounts.AccountFeatureProvider
|
||||
@@ -133,6 +134,11 @@ abstract class FeatureFactory {
|
||||
*/
|
||||
abstract val securitySettingsFeatureProvider: SecuritySettingsFeatureProvider
|
||||
|
||||
/**
|
||||
* Retrieves implementation for Accessibility feedback category feature.
|
||||
*/
|
||||
abstract val accessibilityFeedbackFeatureProvider: AccessibilityFeedbackFeatureProvider
|
||||
|
||||
/**
|
||||
* Retrieves implementation for Accessibility search index feature.
|
||||
*/
|
||||
|
@@ -20,6 +20,8 @@ import android.content.Context
|
||||
import android.net.ConnectivityManager
|
||||
import android.net.VpnManager
|
||||
import android.os.UserManager
|
||||
import com.android.settings.accessibility.AccessibilityFeedbackFeatureProvider
|
||||
import com.android.settings.accessibility.AccessibilityFeedbackFeatureProviderImpl
|
||||
import com.android.settings.accessibility.AccessibilityMetricsFeatureProvider
|
||||
import com.android.settings.accessibility.AccessibilityMetricsFeatureProviderImpl
|
||||
import com.android.settings.accessibility.AccessibilitySearchFeatureProvider
|
||||
@@ -165,6 +167,9 @@ open class FeatureFactoryImpl : FeatureFactory() {
|
||||
SecuritySettingsFeatureProviderImpl()
|
||||
}
|
||||
|
||||
override val accessibilityFeedbackFeatureProvider: AccessibilityFeedbackFeatureProvider
|
||||
by lazy { AccessibilityFeedbackFeatureProviderImpl() }
|
||||
|
||||
override val accessibilitySearchFeatureProvider: AccessibilitySearchFeatureProvider by lazy {
|
||||
AccessibilitySearchFeatureProviderImpl()
|
||||
}
|
||||
|
@@ -113,6 +113,7 @@ public class AccessibilitySettingsTest {
|
||||
private static final String EMPTY_STRING = "";
|
||||
private static final String DEFAULT_SUMMARY = "default summary";
|
||||
private static final String DEFAULT_DESCRIPTION = "default description";
|
||||
private static final String DEFAULT_CATEGORY = "default category";
|
||||
private static final String DEFAULT_LABEL = "default label";
|
||||
private static final Boolean SERVICE_ENABLED = true;
|
||||
private static final Boolean SERVICE_DISABLED = false;
|
||||
@@ -455,7 +456,8 @@ public class AccessibilitySettingsTest {
|
||||
@EnableFlags(com.android.server.accessibility.Flags.FLAG_ENABLE_LOW_VISION_GENERIC_FEEDBACK)
|
||||
public void onCreateOptionsMenu_enableLowVisionGenericFeedback_shouldAddSendFeedbackMenu() {
|
||||
setupFragment();
|
||||
mFragment.setFeedbackManager(new FeedbackManager(mFragment.getActivity(), PACKAGE_NAME));
|
||||
mFragment.setFeedbackManager(
|
||||
new FeedbackManager(mFragment.getActivity(), PACKAGE_NAME, DEFAULT_CATEGORY));
|
||||
when(mMenu.add(anyInt(), anyInt(), anyInt(), anyInt())).thenReturn(mMenuItem);
|
||||
|
||||
mFragment.onCreateOptionsMenu(mMenu, /* inflater= */ null);
|
||||
@@ -468,7 +470,8 @@ public class AccessibilitySettingsTest {
|
||||
@DisableFlags(com.android.server.accessibility.Flags.FLAG_ENABLE_LOW_VISION_GENERIC_FEEDBACK)
|
||||
public void onCreateOptionsMenu_disableLowVisionGenericFeedback_shouldNotAddSendFeedbackMenu() {
|
||||
setupFragment();
|
||||
mFragment.setFeedbackManager(new FeedbackManager(mFragment.getActivity(), PACKAGE_NAME));
|
||||
mFragment.setFeedbackManager(
|
||||
new FeedbackManager(mFragment.getActivity(), PACKAGE_NAME, DEFAULT_CATEGORY));
|
||||
when(mMenu.add(anyInt(), anyInt(), anyInt(), anyInt())).thenReturn(mMenuItem);
|
||||
|
||||
mFragment.onCreateOptionsMenu(mMenu, /* inflater= */ null);
|
||||
@@ -481,7 +484,8 @@ public class AccessibilitySettingsTest {
|
||||
@EnableFlags(com.android.server.accessibility.Flags.FLAG_ENABLE_LOW_VISION_GENERIC_FEEDBACK)
|
||||
public void onOptionsItemSelected_enableLowVisionGenericFeedback_shouldStartSendFeedback() {
|
||||
setupFragment();
|
||||
mFragment.setFeedbackManager(new FeedbackManager(mFragment.getActivity(), PACKAGE_NAME));
|
||||
mFragment.setFeedbackManager(
|
||||
new FeedbackManager(mFragment.getActivity(), PACKAGE_NAME, DEFAULT_CATEGORY));
|
||||
when(mMenu.add(anyInt(), anyInt(), anyInt(), anyInt())).thenReturn(mMenuItem);
|
||||
mFragment.onCreateOptionsMenu(mMenu, /* inflater= */ null);
|
||||
when(mMenuItem.getItemId()).thenReturn(AccessibilitySettings.MENU_ID_SEND_FEEDBACK);
|
||||
@@ -496,7 +500,8 @@ public class AccessibilitySettingsTest {
|
||||
@DisableFlags(com.android.server.accessibility.Flags.FLAG_ENABLE_LOW_VISION_GENERIC_FEEDBACK)
|
||||
public void onOptionsItemSelected_disableLowVisionGenericFeedback_shouldNotStartSendFeedback() {
|
||||
setupFragment();
|
||||
mFragment.setFeedbackManager(new FeedbackManager(mFragment.getActivity(), PACKAGE_NAME));
|
||||
mFragment.setFeedbackManager(
|
||||
new FeedbackManager(mFragment.getActivity(), PACKAGE_NAME, DEFAULT_CATEGORY));
|
||||
when(mMenu.add(anyInt(), anyInt(), anyInt(), anyInt())).thenReturn(mMenuItem);
|
||||
mFragment.onCreateOptionsMenu(mMenu, /* inflater= */ null);
|
||||
when(mMenuItem.getItemId()).thenReturn(AccessibilitySettings.MENU_ID_SEND_FEEDBACK);
|
||||
|
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.android.settings.accessibility;
|
||||
|
||||
import static com.android.settings.accessibility.FeedbackManager.ACCESSIBILITY_FEEDBACK_REQUEST_BUCKET_ID;
|
||||
import static com.android.settings.accessibility.FeedbackManager.CATEGORY_TAG;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
@@ -44,7 +43,8 @@ public class FeedbackManagerTest {
|
||||
@Rule
|
||||
public final SetFlagsRule mSetFlagsRule = new SetFlagsRule();
|
||||
|
||||
private static final String FEEDBACK_PACKAGE = "test.feedback.package";
|
||||
private static final String PACKAGE_NAME = "test.feedback.package";
|
||||
private static final String DEFAULT_CATEGORY = "default category";
|
||||
|
||||
private Activity mActivity;
|
||||
|
||||
@@ -55,8 +55,9 @@ public class FeedbackManagerTest {
|
||||
|
||||
@Test
|
||||
@EnableFlags(Flags.FLAG_ENABLE_LOW_VISION_GENERIC_FEEDBACK)
|
||||
public void isAvailable_enableLowVisionGenericFeedbackWithPackageAndActivity_returnsTrue() {
|
||||
FeedbackManager feedbackManager = new FeedbackManager(mActivity, FEEDBACK_PACKAGE);
|
||||
public void isAvailable_enableLowVisionGenericFeedbackWithValidParams_returnsTrue() {
|
||||
FeedbackManager feedbackManager =
|
||||
new FeedbackManager(mActivity, PACKAGE_NAME, DEFAULT_CATEGORY);
|
||||
|
||||
assertThat(feedbackManager.isAvailable()).isTrue();
|
||||
}
|
||||
@@ -64,15 +65,26 @@ public class FeedbackManagerTest {
|
||||
@Test
|
||||
@DisableFlags(Flags.FLAG_ENABLE_LOW_VISION_GENERIC_FEEDBACK)
|
||||
public void isAvailable_disableLowVisionGenericFeedback_returnsFalse() {
|
||||
FeedbackManager feedbackManager = new FeedbackManager(mActivity, FEEDBACK_PACKAGE);
|
||||
FeedbackManager feedbackManager =
|
||||
new FeedbackManager(mActivity, PACKAGE_NAME, DEFAULT_CATEGORY);
|
||||
|
||||
assertThat(feedbackManager.isAvailable()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
@EnableFlags(Flags.FLAG_ENABLE_LOW_VISION_GENERIC_FEEDBACK)
|
||||
public void isAvailable_withNullPackage_returnsFalse() {
|
||||
FeedbackManager feedbackManager = new FeedbackManager(mActivity, null);
|
||||
public void isAvailable_withNullCategory_returnsFalse() {
|
||||
FeedbackManager feedbackManager =
|
||||
new FeedbackManager(mActivity, PACKAGE_NAME, /* category= */ null);
|
||||
|
||||
assertThat(feedbackManager.isAvailable()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
@EnableFlags(Flags.FLAG_ENABLE_LOW_VISION_GENERIC_FEEDBACK)
|
||||
public void isAvailable_withNullReporterPackage_returnsFalse() {
|
||||
FeedbackManager feedbackManager =
|
||||
new FeedbackManager(mActivity, /* reporterPackage= */ null, DEFAULT_CATEGORY);
|
||||
|
||||
assertThat(feedbackManager.isAvailable()).isFalse();
|
||||
}
|
||||
@@ -80,40 +92,52 @@ public class FeedbackManagerTest {
|
||||
@Test
|
||||
@EnableFlags(Flags.FLAG_ENABLE_LOW_VISION_GENERIC_FEEDBACK)
|
||||
public void isAvailable_withNullActivity_returnsFalse() {
|
||||
FeedbackManager feedbackManager = new FeedbackManager(null, FEEDBACK_PACKAGE);
|
||||
FeedbackManager feedbackManager =
|
||||
new FeedbackManager(/* activity= */ null, PACKAGE_NAME, DEFAULT_CATEGORY);
|
||||
|
||||
assertThat(feedbackManager.isAvailable()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
@EnableFlags(Flags.FLAG_ENABLE_LOW_VISION_GENERIC_FEEDBACK)
|
||||
public void sendFeedback_enableLowVisionGenericFeedbackWithPackageAndActivity_success() {
|
||||
FeedbackManager feedbackManager = new FeedbackManager(mActivity, FEEDBACK_PACKAGE);
|
||||
public void sendFeedback_enableLowVisionGenericFeedbackWithValidParams_success() {
|
||||
FeedbackManager feedbackManager =
|
||||
new FeedbackManager(mActivity, PACKAGE_NAME, DEFAULT_CATEGORY);
|
||||
|
||||
assertThat(feedbackManager.sendFeedback()).isTrue();
|
||||
|
||||
Intent startedIntent = Shadows.shadowOf(mActivity).getNextStartedActivity();
|
||||
assertThat(startedIntent).isNotNull();
|
||||
assertThat(startedIntent.getAction()).isEqualTo(Intent.ACTION_BUG_REPORT);
|
||||
assertThat(startedIntent.getPackage()).isEqualTo(FEEDBACK_PACKAGE);
|
||||
assertThat(startedIntent.getPackage()).isEqualTo(PACKAGE_NAME);
|
||||
Bundle extras = startedIntent.getExtras();
|
||||
assertThat(extras).isNotNull();
|
||||
assertThat(extras.getString(CATEGORY_TAG)).isEqualTo(
|
||||
ACCESSIBILITY_FEEDBACK_REQUEST_BUCKET_ID);
|
||||
assertThat(extras.getString(CATEGORY_TAG)).isEqualTo(DEFAULT_CATEGORY);
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisableFlags(Flags.FLAG_ENABLE_LOW_VISION_GENERIC_FEEDBACK)
|
||||
public void sendFeedback_disableLowVisionGenericFeedback_returnsFalse() {
|
||||
FeedbackManager feedbackManager = new FeedbackManager(mActivity, FEEDBACK_PACKAGE);
|
||||
FeedbackManager feedbackManager =
|
||||
new FeedbackManager(mActivity, PACKAGE_NAME, DEFAULT_CATEGORY);
|
||||
|
||||
assertThat(feedbackManager.sendFeedback()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
@EnableFlags(Flags.FLAG_ENABLE_LOW_VISION_GENERIC_FEEDBACK)
|
||||
public void sendFeedback_withNullPackage_returnsFalse() {
|
||||
FeedbackManager feedbackManager = new FeedbackManager(mActivity, null);
|
||||
public void sendFeedback_withNullCategory_returnsFalse() {
|
||||
FeedbackManager feedbackManager =
|
||||
new FeedbackManager(mActivity, PACKAGE_NAME, /* category= */ null);
|
||||
|
||||
assertThat(feedbackManager.sendFeedback()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
@EnableFlags(Flags.FLAG_ENABLE_LOW_VISION_GENERIC_FEEDBACK)
|
||||
public void sendFeedback_withNullReporterPackage_returnsFalse() {
|
||||
FeedbackManager feedbackManager =
|
||||
new FeedbackManager(mActivity, /* reporterPackage= */ null, DEFAULT_CATEGORY);
|
||||
|
||||
assertThat(feedbackManager.sendFeedback()).isFalse();
|
||||
}
|
||||
@@ -121,7 +145,8 @@ public class FeedbackManagerTest {
|
||||
@Test
|
||||
@EnableFlags(Flags.FLAG_ENABLE_LOW_VISION_GENERIC_FEEDBACK)
|
||||
public void sendFeedback_withNullActivity_returnsFalse() {
|
||||
FeedbackManager feedbackManager = new FeedbackManager(null, FEEDBACK_PACKAGE);
|
||||
FeedbackManager feedbackManager =
|
||||
new FeedbackManager(/* activity= */ null, PACKAGE_NAME, DEFAULT_CATEGORY);
|
||||
|
||||
assertThat(feedbackManager.sendFeedback()).isFalse();
|
||||
}
|
||||
|
@@ -19,6 +19,7 @@ import static org.mockito.Mockito.mock;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.android.settings.accessibility.AccessibilityFeedbackFeatureProvider;
|
||||
import com.android.settings.accessibility.AccessibilityMetricsFeatureProvider;
|
||||
import com.android.settings.accessibility.AccessibilitySearchFeatureProvider;
|
||||
import com.android.settings.accounts.AccountFeatureProvider;
|
||||
@@ -103,6 +104,7 @@ public class FakeFeatureFactory extends FeatureFactory {
|
||||
public PrivateSpaceLoginFeatureProvider mPrivateSpaceLoginFeatureProvider;
|
||||
public DisplayFeatureProvider mDisplayFeatureProvider;
|
||||
public SyncAcrossDevicesFeatureProvider mSyncAcrossDevicesFeatureProvider;
|
||||
public AccessibilityFeedbackFeatureProvider mAccessibilityFeedbackFeatureProvider;
|
||||
|
||||
/**
|
||||
* Call this in {@code @Before} method of the test class to use fake factory.
|
||||
@@ -340,5 +342,9 @@ public class FakeFeatureFactory extends FeatureFactory {
|
||||
public SyncAcrossDevicesFeatureProvider getSyncAcrossDevicesFeatureProvider() {
|
||||
return mSyncAcrossDevicesFeatureProvider;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccessibilityFeedbackFeatureProvider getAccessibilityFeedbackFeatureProvider() {
|
||||
return mAccessibilityFeedbackFeatureProvider;
|
||||
}
|
||||
}
|
||||
|
@@ -17,6 +17,7 @@
|
||||
package com.android.settings.testutils
|
||||
|
||||
import android.content.Context
|
||||
import com.android.settings.accessibility.AccessibilityFeedbackFeatureProvider
|
||||
import com.android.settings.accessibility.AccessibilityMetricsFeatureProvider
|
||||
import com.android.settings.accessibility.AccessibilitySearchFeatureProvider
|
||||
import com.android.settings.accounts.AccountFeatureProvider
|
||||
@@ -125,6 +126,8 @@ class FakeFeatureFactory : FeatureFactory() {
|
||||
get() = TODO("Not yet implemented")
|
||||
override val securitySettingsFeatureProvider: SecuritySettingsFeatureProvider
|
||||
get() = TODO("Not yet implemented")
|
||||
override val accessibilityFeedbackFeatureProvider: AccessibilityFeedbackFeatureProvider
|
||||
get() = TODO("Not yet implemented")
|
||||
override val accessibilitySearchFeatureProvider: AccessibilitySearchFeatureProvider
|
||||
get() = TODO("Not yet implemented")
|
||||
override val accessibilityMetricsFeatureProvider: AccessibilityMetricsFeatureProvider
|
||||
|
@@ -19,6 +19,7 @@ import static org.mockito.Mockito.mock;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.android.settings.accessibility.AccessibilityFeedbackFeatureProvider;
|
||||
import com.android.settings.accessibility.AccessibilityMetricsFeatureProvider;
|
||||
import com.android.settings.accessibility.AccessibilitySearchFeatureProvider;
|
||||
import com.android.settings.accounts.AccountFeatureProvider;
|
||||
@@ -102,6 +103,7 @@ public class FakeFeatureFactory extends FeatureFactory {
|
||||
public PrivateSpaceLoginFeatureProvider mPrivateSpaceLoginFeatureProvider;
|
||||
public DisplayFeatureProvider mDisplayFeatureProvider;
|
||||
public SyncAcrossDevicesFeatureProvider mSyncAcrossDevicesFeatureProvider;
|
||||
public AccessibilityFeedbackFeatureProvider mAccessibilityFeedbackFeatureProvider;
|
||||
|
||||
/** Call this in {@code @Before} method of the test class to use fake factory. */
|
||||
public static FakeFeatureFactory setupForTest() {
|
||||
@@ -341,4 +343,9 @@ public class FakeFeatureFactory extends FeatureFactory {
|
||||
public SyncAcrossDevicesFeatureProvider getSyncAcrossDevicesFeatureProvider() {
|
||||
return mSyncAcrossDevicesFeatureProvider;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccessibilityFeedbackFeatureProvider getAccessibilityFeedbackFeatureProvider() {
|
||||
return mAccessibilityFeedbackFeatureProvider;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user