Snap for 7761443 from eb79498e0f to sc-v2-release
Change-Id: I8bae7a2642b486d5aa48b962862edc63f6472e0a
This commit is contained in:
@@ -8489,6 +8489,9 @@
|
||||
<!-- Sound: Title for the other sounds option and associated settings page. [CHAR LIMIT=30] -->
|
||||
<string name="other_sound_settings">Other sounds</string>
|
||||
|
||||
<!-- Sound: Title for the option enabling spatializer effect. [CHAR LIMIT=30] -->
|
||||
<string name="spatial_audio_title">Spatial audio</string>
|
||||
|
||||
<!-- Sound: Other sounds: Title for the option enabling touch sounds for dial pad tones. [CHAR LIMIT=30] -->
|
||||
<string name="dial_pad_tones_title">Dial pad tones</string>
|
||||
|
||||
|
||||
@@ -154,6 +154,13 @@
|
||||
android:ringtoneType="alarm"
|
||||
android:order="-60"/>
|
||||
|
||||
<!-- Spatial audio -->
|
||||
<SwitchPreference
|
||||
android:key="spatial_audio"
|
||||
android:title="@string/spatial_audio_title"
|
||||
android:order="-55"
|
||||
settings:controller="com.android.settings.notification.SpatialAudioPreferenceController"/>
|
||||
|
||||
<!-- Dial pad tones -->
|
||||
<SwitchPreference
|
||||
android:key="dial_pad_tones"
|
||||
|
||||
@@ -380,9 +380,11 @@ public class SettingsActivity extends SettingsBaseActivity
|
||||
// It's a deep link intent, SettingsHomepageActivity will set SplitPairRule and start it.
|
||||
final Intent trampolineIntent =
|
||||
new Intent(android.provider.Settings.ACTION_SETTINGS_LARGE_SCREEN_DEEP_LINK);
|
||||
trampolineIntent.replaceExtras(intent);
|
||||
trampolineIntent.putExtra(
|
||||
android.provider.Settings.EXTRA_SETTINGS_LARGE_SCREEN_DEEP_LINK_INTENT_URI,
|
||||
intent.toUri(Intent.URI_INTENT_SCHEME));
|
||||
trampolineIntent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
|
||||
startActivity(trampolineIntent);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (C) 2021 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 metrics related features.
|
||||
*/
|
||||
public interface AccessibilityMetricsFeatureProvider {
|
||||
|
||||
/**
|
||||
* Returns {@link android.app.settings.SettingsEnums} value according to the {@code
|
||||
* componentName}.
|
||||
*
|
||||
* @param componentName the component name of the downloaded service or activity
|
||||
* @return value in {@link android.app.settings.SettingsEnums}
|
||||
*/
|
||||
int getDownloadedFeatureMetricsCategory(@Nullable ComponentName componentName);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (C) 2021 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.app.settings.SettingsEnums;
|
||||
import android.content.ComponentName;
|
||||
|
||||
/**
|
||||
* Provider implementation for Accessibility metrics related features.
|
||||
*/
|
||||
public class AccessibilityMetricsFeatureProviderImpl implements
|
||||
AccessibilityMetricsFeatureProvider {
|
||||
|
||||
@Override
|
||||
public int getDownloadedFeatureMetricsCategory(ComponentName componentName) {
|
||||
return SettingsEnums.ACCESSIBILITY_SERVICE;
|
||||
}
|
||||
}
|
||||
@@ -41,6 +41,7 @@ import androidx.annotation.Nullable;
|
||||
import androidx.preference.Preference;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -51,6 +52,19 @@ public class LaunchAccessibilityActivityPreferenceFragment extends ToggleFeature
|
||||
private static final String EMPTY_STRING = "";
|
||||
protected static final String KEY_LAUNCH_PREFERENCE = "launch_preference";
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
// Retrieve from getArguments() directly because this function will be executed from
|
||||
// onAttach(), but variable mComponentName only available after onProcessArguments()
|
||||
// which comes from onCreateView().
|
||||
final ComponentName componentName = getArguments().getParcelable(
|
||||
AccessibilitySettings.EXTRA_COMPONENT_NAME);
|
||||
|
||||
return FeatureFactory.getFactory(getActivity().getApplicationContext())
|
||||
.getAccessibilityMetricsFeatureProvider()
|
||||
.getDownloadedFeatureMetricsCategory(componentName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
@@ -60,7 +74,7 @@ public class LaunchAccessibilityActivityPreferenceFragment extends ToggleFeature
|
||||
initLaunchPreference();
|
||||
removePreference(KEY_USE_SERVICE_PREFERENCE);
|
||||
return view;
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPreferenceToggled(String preferenceKey, boolean enabled) {
|
||||
@@ -70,7 +84,6 @@ public class LaunchAccessibilityActivityPreferenceFragment extends ToggleFeature
|
||||
@Override
|
||||
protected void onProcessArguments(Bundle arguments) {
|
||||
super.onProcessArguments(arguments);
|
||||
|
||||
mComponentName = arguments.getParcelable(AccessibilitySettings.EXTRA_COMPONENT_NAME);
|
||||
final ActivityInfo info = getAccessibilityShortcutInfo().getActivityInfo();
|
||||
mPackageName = info.loadLabel(getPackageManager()).toString();
|
||||
|
||||
@@ -54,6 +54,7 @@ import androidx.annotation.Nullable;
|
||||
import com.android.internal.widget.LockPatternUtils;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.accessibility.AccessibilityUtil.UserShortcutType;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settings.password.ConfirmDeviceCredentialActivity;
|
||||
import com.android.settingslib.accessibility.AccessibilityUtils;
|
||||
|
||||
@@ -84,7 +85,15 @@ public class ToggleAccessibilityServicePreferenceFragment extends
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return SettingsEnums.ACCESSIBILITY_SERVICE;
|
||||
// Retrieve from getArguments() directly because this function will be executed from
|
||||
// onAttach(), but variable mComponentName only available after onProcessArguments()
|
||||
// which comes from onCreateView().
|
||||
final ComponentName componentName = getArguments().getParcelable(
|
||||
AccessibilitySettings.EXTRA_COMPONENT_NAME);
|
||||
|
||||
return FeatureFactory.getFactory(getActivity().getApplicationContext())
|
||||
.getAccessibilityMetricsFeatureProvider()
|
||||
.getDownloadedFeatureMetricsCategory(componentName);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -263,7 +263,9 @@ public final class BatteryBackupHelper implements BackupHelper {
|
||||
private boolean isSystemOrDefaultApp(String packageName) {
|
||||
final PowerAllowlistBackend powerAllowlistBackend = getPowerAllowlistBackend();
|
||||
return powerAllowlistBackend.isSysAllowlisted(packageName)
|
||||
|| powerAllowlistBackend.isDefaultActiveApp(packageName);
|
||||
|| powerAllowlistBackend.isDefaultActiveApp(packageName)
|
||||
// Optimize mode only for app which is in the allow list not idle app.
|
||||
|| powerAllowlistBackend.isAllowlistedExceptIdle(packageName);
|
||||
}
|
||||
|
||||
private List<ApplicationInfo> getInstalledApplications() {
|
||||
|
||||
@@ -212,6 +212,10 @@ public class SettingsHomepageActivity extends FragmentActivity implements
|
||||
intent.setAction(null);
|
||||
|
||||
targetIntent.setFlags(targetIntent.getFlags() & ~Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
targetIntent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
|
||||
|
||||
// Sender of intent may want to send intent extra data to the destination of targetIntent.
|
||||
targetIntent.replaceExtras(intent);
|
||||
|
||||
targetIntent.putExtra(EXTRA_IS_FROM_SETTINGS_HOMEPAGE, true);
|
||||
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (C) 2021 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.notification;
|
||||
|
||||
import android.content.Context;
|
||||
import android.media.AudioManager;
|
||||
import android.media.Spatializer;
|
||||
|
||||
import com.android.settings.core.TogglePreferenceController;
|
||||
|
||||
/**
|
||||
* The controller of the Spatial audio setting in the SoundSettings.
|
||||
*/
|
||||
public class SpatialAudioPreferenceController extends TogglePreferenceController {
|
||||
|
||||
private static final String KEY_SPATIAL_AUDIO = "spatial_audio";
|
||||
|
||||
private final Spatializer mSpatializer;
|
||||
|
||||
public SpatialAudioPreferenceController(Context context) {
|
||||
super(context, KEY_SPATIAL_AUDIO);
|
||||
AudioManager audioManager = context.getSystemService(AudioManager.class);
|
||||
mSpatializer = audioManager.getSpatializer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return mSpatializer.getImmersiveAudioLevel() == Spatializer.SPATIALIZER_IMMERSIVE_LEVEL_NONE
|
||||
? UNSUPPORTED_ON_DEVICE : AVAILABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isChecked() {
|
||||
return mSpatializer.isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setChecked(boolean isChecked) {
|
||||
mSpatializer.setEnabled(isChecked);
|
||||
return isChecked == isChecked();
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,7 @@ import android.util.Log;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.accessibility.AccessibilityMetricsFeatureProvider;
|
||||
import com.android.settings.accessibility.AccessibilitySearchFeatureProvider;
|
||||
import com.android.settings.accounts.AccountFeatureProvider;
|
||||
import com.android.settings.applications.ApplicationFeatureProvider;
|
||||
@@ -111,13 +112,13 @@ public abstract class FeatureFactory {
|
||||
public abstract PowerUsageFeatureProvider getPowerUsageFeatureProvider(Context context);
|
||||
|
||||
/**
|
||||
* Retrieve implementation for Battery Status feature.
|
||||
* Retrieves implementation for Battery Status feature.
|
||||
*/
|
||||
public abstract BatteryStatusFeatureProvider getBatteryStatusFeatureProvider(
|
||||
Context context);
|
||||
|
||||
/**
|
||||
* Get implementation for Battery Settings provider.
|
||||
* Gets implementation for Battery Settings provider.
|
||||
*/
|
||||
public abstract BatterySettingsFeatureProvider getBatterySettingsFeatureProvider(
|
||||
Context context);
|
||||
@@ -161,25 +162,30 @@ public abstract class FeatureFactory {
|
||||
public abstract WifiTrackerLibProvider getWifiTrackerLibProvider();
|
||||
|
||||
/**
|
||||
* Retrieve implementation for Extra App Info feature.
|
||||
* Retrieves implementation for Extra App Info feature.
|
||||
*/
|
||||
public abstract ExtraAppInfoFeatureProvider getExtraAppInfoFeatureProvider();
|
||||
|
||||
/**
|
||||
* Retrieve implementation for SecuritySettings feature.
|
||||
* Retrieves implementation for SecuritySettings feature.
|
||||
*/
|
||||
public abstract SecuritySettingsFeatureProvider getSecuritySettingsFeatureProvider();
|
||||
|
||||
/**
|
||||
* Retrieve implementation for Game Settings feature.
|
||||
* Retrieves implementation for Game Settings feature.
|
||||
*/
|
||||
public abstract GameSettingsFeatureProvider getGameSettingsFeatureProvider();
|
||||
|
||||
/**
|
||||
* Retrieve implementation for Accessibility search index feature.
|
||||
* Retrieves implementation for Accessibility search index feature.
|
||||
*/
|
||||
public abstract AccessibilitySearchFeatureProvider getAccessibilitySearchFeatureProvider();
|
||||
|
||||
/**
|
||||
* Retrieves implementation for Accessibility metrics category feature.
|
||||
*/
|
||||
public abstract AccessibilityMetricsFeatureProvider getAccessibilityMetricsFeatureProvider();
|
||||
|
||||
public static final class FactoryNotFoundException extends RuntimeException {
|
||||
public FactoryNotFoundException(Throwable throwable) {
|
||||
super("Unable to create factory. Did you misconfigure Proguard?", throwable);
|
||||
|
||||
@@ -25,6 +25,8 @@ import android.os.UserManager;
|
||||
|
||||
import androidx.annotation.Keep;
|
||||
|
||||
import com.android.settings.accessibility.AccessibilityMetricsFeatureProvider;
|
||||
import com.android.settings.accessibility.AccessibilityMetricsFeatureProviderImpl;
|
||||
import com.android.settings.accessibility.AccessibilitySearchFeatureProvider;
|
||||
import com.android.settings.accessibility.AccessibilitySearchFeatureProviderImpl;
|
||||
import com.android.settings.accounts.AccountFeatureProvider;
|
||||
@@ -109,6 +111,7 @@ public class FeatureFactoryImpl extends FeatureFactory {
|
||||
private SecuritySettingsFeatureProvider mSecuritySettingsFeatureProvider;
|
||||
private GameSettingsFeatureProvider mGameSettingsFeatureProvider;
|
||||
private AccessibilitySearchFeatureProvider mAccessibilitySearchFeatureProvider;
|
||||
private AccessibilityMetricsFeatureProvider mAccessibilityMetricsFeatureProvider;
|
||||
|
||||
@Override
|
||||
public SupportFeatureProvider getSupportFeatureProvider(Context context) {
|
||||
@@ -346,4 +349,12 @@ public class FeatureFactoryImpl extends FeatureFactory {
|
||||
}
|
||||
return mAccessibilitySearchFeatureProvider;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccessibilityMetricsFeatureProvider getAccessibilityMetricsFeatureProvider() {
|
||||
if (mAccessibilityMetricsFeatureProvider == null) {
|
||||
mAccessibilityMetricsFeatureProvider = new AccessibilityMetricsFeatureProviderImpl();
|
||||
}
|
||||
return mAccessibilityMetricsFeatureProvider;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,6 +114,9 @@ public final class BatteryBackupHelperTest {
|
||||
mockUid(1001 /*fake uid*/, PACKAGE_NAME1);
|
||||
mockUid(1002 /*fake uid*/, PACKAGE_NAME2);
|
||||
mockUid(BatteryUtils.UID_NULL, PACKAGE_NAME3);
|
||||
doReturn(false).when(mPowerAllowlistBackend).isDefaultActiveApp(anyString());
|
||||
doReturn(false).when(mPowerAllowlistBackend).isDefaultActiveApp(anyString());
|
||||
doReturn(false).when(mPowerAllowlistBackend).isAllowlistedExceptIdle(anyString());
|
||||
}
|
||||
|
||||
@After
|
||||
@@ -218,7 +221,6 @@ public final class BatteryBackupHelperTest {
|
||||
createTestingData(PACKAGE_NAME1, PACKAGE_NAME2, PACKAGE_NAME3);
|
||||
// Sets "com.android.testing.1" as system app.
|
||||
doReturn(true).when(mPowerAllowlistBackend).isSysAllowlisted(PACKAGE_NAME1);
|
||||
doReturn(false).when(mPowerAllowlistBackend).isDefaultActiveApp(anyString());
|
||||
|
||||
mBatteryBackupHelper.backupOptimizationMode(mBackupDataOutput, allowlistedApps);
|
||||
|
||||
@@ -234,7 +236,21 @@ public final class BatteryBackupHelperTest {
|
||||
createTestingData(PACKAGE_NAME1, PACKAGE_NAME2, PACKAGE_NAME3);
|
||||
// Sets "com.android.testing.1" as device default app.
|
||||
doReturn(true).when(mPowerAllowlistBackend).isDefaultActiveApp(PACKAGE_NAME1);
|
||||
doReturn(false).when(mPowerAllowlistBackend).isSysAllowlisted(anyString());
|
||||
|
||||
mBatteryBackupHelper.backupOptimizationMode(mBackupDataOutput, allowlistedApps);
|
||||
|
||||
// "com.android.testing.2" for RESTRICTED mode.
|
||||
final String expectedResult = PACKAGE_NAME2 + ":1,";
|
||||
verifyBackupData(expectedResult);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void backupOptimizationMode_backupOptimizationAndIgnoreAppInTheAllowlist()
|
||||
throws Exception {
|
||||
final List<String> allowlistedApps = Arrays.asList(PACKAGE_NAME1);
|
||||
createTestingData(PACKAGE_NAME1, PACKAGE_NAME2, PACKAGE_NAME3);
|
||||
// Sets "com.android.testing.1" in the allowlist.
|
||||
doReturn(true).when(mPowerAllowlistBackend).isAllowlistedExceptIdle(PACKAGE_NAME1);
|
||||
|
||||
mBatteryBackupHelper.backupOptimizationMode(mBackupDataOutput, allowlistedApps);
|
||||
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* Copyright (C) 2021 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.notification;
|
||||
|
||||
import static com.android.settings.core.BasePreferenceController.AVAILABLE;
|
||||
import static com.android.settings.core.BasePreferenceController.UNSUPPORTED_ON_DEVICE;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import static org.mockito.Mockito.spy;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import android.content.Context;
|
||||
import android.media.AudioManager;
|
||||
import android.media.Spatializer;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Answers;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.RuntimeEnvironment;
|
||||
|
||||
@Ignore("b/200896161")
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class SpatialAudioPreferenceControllerTest {
|
||||
|
||||
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
|
||||
private Context mContext;
|
||||
@Mock
|
||||
private AudioManager mAudioManager;
|
||||
@Mock
|
||||
private Spatializer mSpatializer;
|
||||
|
||||
private SpatialAudioPreferenceController mController;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
mContext = spy(RuntimeEnvironment.application);
|
||||
when((Object) mContext.getSystemService(AudioManager.class)).thenReturn(mAudioManager);
|
||||
when(mAudioManager.getSpatializer()).thenReturn(mSpatializer);
|
||||
mController = new SpatialAudioPreferenceController(mContext);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getAvailabilityStatus_levelNone_shouldReturnUnsupported() {
|
||||
when(mSpatializer.getImmersiveAudioLevel()).thenReturn(
|
||||
Spatializer.SPATIALIZER_IMMERSIVE_LEVEL_NONE);
|
||||
assertThat(mController.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getAvailabilityStatus_levelMultiChannel_shouldReturnAvailable() {
|
||||
when(mSpatializer.getImmersiveAudioLevel()).thenReturn(
|
||||
Spatializer.SPATIALIZER_IMMERSIVE_LEVEL_MULTICHANNEL);
|
||||
assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void setChecked_withTrue_shouldEnableSpatializer() {
|
||||
mController.setChecked(true);
|
||||
|
||||
verify(mSpatializer).setEnabled(true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void setChecked_withFalse_shouldDisableSpatializer() {
|
||||
mController.setChecked(false);
|
||||
|
||||
verify(mSpatializer).setEnabled(false);
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,7 @@ import static org.mockito.Mockito.when;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.android.settings.accessibility.AccessibilityMetricsFeatureProvider;
|
||||
import com.android.settings.accessibility.AccessibilitySearchFeatureProvider;
|
||||
import com.android.settings.accounts.AccountFeatureProvider;
|
||||
import com.android.settings.applications.ApplicationFeatureProvider;
|
||||
@@ -89,6 +90,7 @@ public class FakeFeatureFactory extends FeatureFactory {
|
||||
public SecuritySettingsFeatureProvider securitySettingsFeatureProvider;
|
||||
public GameSettingsFeatureProvider gameSettingsFeatureProvider;
|
||||
public AccessibilitySearchFeatureProvider mAccessibilitySearchFeatureProvider;
|
||||
public AccessibilityMetricsFeatureProvider mAccessibilityMetricsFeatureProvider;
|
||||
|
||||
/**
|
||||
* Call this in {@code @Before} method of the test class to use fake factory.
|
||||
@@ -139,6 +141,7 @@ public class FakeFeatureFactory extends FeatureFactory {
|
||||
securitySettingsFeatureProvider = mock(SecuritySettingsFeatureProvider.class);
|
||||
gameSettingsFeatureProvider = mock(GameSettingsFeatureProvider.class);
|
||||
mAccessibilitySearchFeatureProvider = mock(AccessibilitySearchFeatureProvider.class);
|
||||
mAccessibilityMetricsFeatureProvider = mock(AccessibilityMetricsFeatureProvider.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -280,4 +283,9 @@ public class FakeFeatureFactory extends FeatureFactory {
|
||||
public AccessibilitySearchFeatureProvider getAccessibilitySearchFeatureProvider() {
|
||||
return mAccessibilitySearchFeatureProvider;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccessibilityMetricsFeatureProvider getAccessibilityMetricsFeatureProvider() {
|
||||
return mAccessibilityMetricsFeatureProvider;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import static org.mockito.Mockito.mock;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.android.settings.accessibility.AccessibilityMetricsFeatureProvider;
|
||||
import com.android.settings.accessibility.AccessibilitySearchFeatureProvider;
|
||||
import com.android.settings.accounts.AccountFeatureProvider;
|
||||
import com.android.settings.applications.ApplicationFeatureProvider;
|
||||
@@ -84,6 +85,7 @@ public class FakeFeatureFactory extends FeatureFactory {
|
||||
public SecuritySettingsFeatureProvider securitySettingsFeatureProvider;
|
||||
public GameSettingsFeatureProvider gameSettingsFeatureProvider;
|
||||
public AccessibilitySearchFeatureProvider mAccessibilitySearchFeatureProvider;
|
||||
public AccessibilityMetricsFeatureProvider mAccessibilityMetricsFeatureProvider;
|
||||
|
||||
/**
|
||||
* Call this in {@code @Before} method of the test class to use fake factory.
|
||||
@@ -124,6 +126,8 @@ public class FakeFeatureFactory extends FeatureFactory {
|
||||
extraAppInfoFeatureProvider = mock(ExtraAppInfoFeatureProvider.class);
|
||||
securitySettingsFeatureProvider = mock(SecuritySettingsFeatureProvider.class);
|
||||
gameSettingsFeatureProvider = mock(GameSettingsFeatureProvider.class);
|
||||
mAccessibilitySearchFeatureProvider = mock(AccessibilitySearchFeatureProvider.class);
|
||||
mAccessibilityMetricsFeatureProvider = mock(AccessibilityMetricsFeatureProvider.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -265,4 +269,9 @@ public class FakeFeatureFactory extends FeatureFactory {
|
||||
public AccessibilitySearchFeatureProvider getAccessibilitySearchFeatureProvider() {
|
||||
return mAccessibilitySearchFeatureProvider;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccessibilityMetricsFeatureProvider getAccessibilityMetricsFeatureProvider() {
|
||||
return mAccessibilityMetricsFeatureProvider;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user