Merge "Refactor FeatureFactory"
This commit is contained in:
@@ -106,7 +106,6 @@ android_library {
|
|||||||
plugins: ["androidx.room_room-compiler-plugin"],
|
plugins: ["androidx.room_room-compiler-plugin"],
|
||||||
|
|
||||||
libs: [
|
libs: [
|
||||||
"keepanno-annotations",
|
|
||||||
"telephony-common",
|
"telephony-common",
|
||||||
"ims-common",
|
"ims-common",
|
||||||
],
|
],
|
||||||
|
@@ -38,9 +38,6 @@
|
|||||||
<!-- Whether to show Camera laser sensor switch in Developer Options -->
|
<!-- Whether to show Camera laser sensor switch in Developer Options -->
|
||||||
<bool name="config_show_camera_laser_sensor">false</bool>
|
<bool name="config_show_camera_laser_sensor">false</bool>
|
||||||
|
|
||||||
<!-- Fully-qualified class name for the implementation of the FeatureFactory to be instantiated. -->
|
|
||||||
<string name="config_featureFactory" translatable="false">com.android.settings.overlay.FeatureFactoryImpl</string>
|
|
||||||
|
|
||||||
<!-- Package name and fully-qualified class name for the wallpaper picker activity. -->
|
<!-- Package name and fully-qualified class name for the wallpaper picker activity. -->
|
||||||
<string name="config_wallpaper_picker_package" translatable="false">com.android.settings</string>
|
<string name="config_wallpaper_picker_package" translatable="false">com.android.settings</string>
|
||||||
<string name="config_wallpaper_picker_class" translatable="false">com.android.settings.Settings$WallpaperSettingsActivity</string>
|
<string name="config_wallpaper_picker_class" translatable="false">com.android.settings.Settings$WallpaperSettingsActivity</string>
|
||||||
|
@@ -17,15 +17,20 @@
|
|||||||
package com.android.settings;
|
package com.android.settings;
|
||||||
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
|
import android.content.Context;
|
||||||
import android.database.ContentObserver;
|
import android.database.ContentObserver;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.util.FeatureFlagUtils;
|
import android.util.FeatureFlagUtils;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import com.android.settings.activityembedding.ActivityEmbeddingRulesController;
|
import com.android.settings.activityembedding.ActivityEmbeddingRulesController;
|
||||||
import com.android.settings.activityembedding.ActivityEmbeddingUtils;
|
import com.android.settings.activityembedding.ActivityEmbeddingUtils;
|
||||||
import com.android.settings.core.instrumentation.ElapsedTimeUtils;
|
import com.android.settings.core.instrumentation.ElapsedTimeUtils;
|
||||||
import com.android.settings.homepage.SettingsHomepageActivity;
|
import com.android.settings.homepage.SettingsHomepageActivity;
|
||||||
|
import com.android.settings.overlay.FeatureFactory;
|
||||||
|
import com.android.settings.overlay.FeatureFactoryImpl;
|
||||||
import com.android.settings.spa.SettingsSpaEnvironment;
|
import com.android.settings.spa.SettingsSpaEnvironment;
|
||||||
import com.android.settingslib.applications.AppIconCacheManager;
|
import com.android.settingslib.applications.AppIconCacheManager;
|
||||||
import com.android.settingslib.spa.framework.common.SpaEnvironmentFactory;
|
import com.android.settingslib.spa.framework.common.SpaEnvironmentFactory;
|
||||||
@@ -39,6 +44,12 @@ public class SettingsApplication extends Application {
|
|||||||
|
|
||||||
private WeakReference<SettingsHomepageActivity> mHomeActivity = new WeakReference<>(null);
|
private WeakReference<SettingsHomepageActivity> mHomeActivity = new WeakReference<>(null);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void attachBaseContext(Context base) {
|
||||||
|
super.attachBaseContext(base);
|
||||||
|
FeatureFactory.setFactory(this, getFeatureFactory());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
@@ -62,6 +73,11 @@ public class SettingsApplication extends Application {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
protected FeatureFactory getFeatureFactory() {
|
||||||
|
return new FeatureFactoryImpl();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the spa environment instance.
|
* Set the spa environment instance.
|
||||||
* Override this function to set different spa environment for different Settings app.
|
* Override this function to set different spa environment for different Settings app.
|
||||||
|
@@ -1,225 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2016 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.overlay;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.text.TextUtils;
|
|
||||||
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;
|
|
||||||
import com.android.settings.biometrics.face.FaceFeatureProvider;
|
|
||||||
import com.android.settings.biometrics2.factory.BiometricsRepositoryProvider;
|
|
||||||
import com.android.settings.bluetooth.BluetoothFeatureProvider;
|
|
||||||
import com.android.settings.dashboard.DashboardFeatureProvider;
|
|
||||||
import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider;
|
|
||||||
import com.android.settings.deviceinfo.hardwareinfo.HardwareInfoFeatureProvider;
|
|
||||||
import com.android.settings.enterprise.EnterprisePrivacyFeatureProvider;
|
|
||||||
import com.android.settings.fuelgauge.BatterySettingsFeatureProvider;
|
|
||||||
import com.android.settings.fuelgauge.BatteryStatusFeatureProvider;
|
|
||||||
import com.android.settings.fuelgauge.PowerUsageFeatureProvider;
|
|
||||||
import com.android.settings.gestures.AssistGestureFeatureProvider;
|
|
||||||
import com.android.settings.homepage.contextualcards.ContextualCardFeatureProvider;
|
|
||||||
import com.android.settings.inputmethod.KeyboardSettingsFeatureProvider;
|
|
||||||
import com.android.settings.localepicker.LocaleFeatureProvider;
|
|
||||||
import com.android.settings.panel.PanelFeatureProvider;
|
|
||||||
import com.android.settings.search.SearchFeatureProvider;
|
|
||||||
import com.android.settings.security.SecurityFeatureProvider;
|
|
||||||
import com.android.settings.security.SecuritySettingsFeatureProvider;
|
|
||||||
import com.android.settings.slices.SlicesFeatureProvider;
|
|
||||||
import com.android.settings.users.UserFeatureProvider;
|
|
||||||
import com.android.settings.vpn2.AdvancedVpnFeatureProvider;
|
|
||||||
import com.android.settings.wifi.WifiTrackerLibProvider;
|
|
||||||
import com.android.settings.wifi.factory.WifiFeatureProvider;
|
|
||||||
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
|
|
||||||
import com.android.tools.r8.keepanno.annotations.KeepItemKind;
|
|
||||||
import com.android.tools.r8.keepanno.annotations.KeepTarget;
|
|
||||||
import com.android.tools.r8.keepanno.annotations.UsesReflection;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Abstract class for creating feature controllers. Allows OEM implementations to define their own
|
|
||||||
* factories with their own controllers containing whatever code is needed to implement
|
|
||||||
* the features. To provide a factory implementation, implementors should override
|
|
||||||
* {@link R.string#config_featureFactory} in their override.
|
|
||||||
*/
|
|
||||||
public abstract class FeatureFactory {
|
|
||||||
private static final String LOG_TAG = "FeatureFactory";
|
|
||||||
private static final boolean DEBUG = false;
|
|
||||||
|
|
||||||
protected static FeatureFactory sFactory;
|
|
||||||
protected static Context sAppContext;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a factory for creating feature controllers. Creates the factory if it does not
|
|
||||||
* already exist. Uses the value of {@link R.string#config_featureFactory} to instantiate
|
|
||||||
* a factory implementation.
|
|
||||||
*/
|
|
||||||
@UsesReflection(
|
|
||||||
description = "This method instantiates subclasses of FeatureFactory via reflection.",
|
|
||||||
value = {
|
|
||||||
@KeepTarget(
|
|
||||||
kind = KeepItemKind.CLASS_AND_MEMBERS,
|
|
||||||
extendsClassConstant = FeatureFactory.class,
|
|
||||||
methodName = "<init>")
|
|
||||||
})
|
|
||||||
public static FeatureFactory getFactory(Context context) {
|
|
||||||
if (sFactory != null) {
|
|
||||||
return sFactory;
|
|
||||||
}
|
|
||||||
if (sAppContext == null) {
|
|
||||||
sAppContext = context.getApplicationContext();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (DEBUG) Log.d(LOG_TAG, "getFactory");
|
|
||||||
final String clsName = context.getString(R.string.config_featureFactory);
|
|
||||||
if (TextUtils.isEmpty(clsName)) {
|
|
||||||
throw new UnsupportedOperationException("No feature factory configured");
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
sFactory = (FeatureFactory) context.getClassLoader().loadClass(clsName).newInstance();
|
|
||||||
} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
|
|
||||||
throw new FactoryNotFoundException(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (DEBUG) Log.d(LOG_TAG, "started " + sFactory.getClass().getSimpleName());
|
|
||||||
return sFactory;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an application {@link Context} used to create this {@link FeatureFactory}. If the
|
|
||||||
* factory has not been properly created yet (aka {@link #getFactory} has not been called), this
|
|
||||||
* will return null.
|
|
||||||
*/
|
|
||||||
@Nullable
|
|
||||||
public static Context getAppContext() {
|
|
||||||
return sAppContext;
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract AssistGestureFeatureProvider getAssistGestureFeatureProvider();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets implementation for the Suggestion Feature provider.
|
|
||||||
*/
|
|
||||||
public abstract SuggestionFeatureProvider getSuggestionFeatureProvider();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieves implementation for Hardware Info feature.
|
|
||||||
*/
|
|
||||||
public abstract HardwareInfoFeatureProvider getHardwareInfoFeatureProvider();
|
|
||||||
|
|
||||||
public abstract SupportFeatureProvider getSupportFeatureProvider(Context context);
|
|
||||||
|
|
||||||
public abstract MetricsFeatureProvider getMetricsFeatureProvider();
|
|
||||||
|
|
||||||
public abstract PowerUsageFeatureProvider getPowerUsageFeatureProvider(Context context);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieves implementation for Battery Status feature.
|
|
||||||
*/
|
|
||||||
public abstract BatteryStatusFeatureProvider getBatteryStatusFeatureProvider(
|
|
||||||
Context context);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets implementation for Battery Settings provider.
|
|
||||||
*/
|
|
||||||
public abstract BatterySettingsFeatureProvider getBatterySettingsFeatureProvider();
|
|
||||||
|
|
||||||
public abstract DashboardFeatureProvider getDashboardFeatureProvider(Context context);
|
|
||||||
|
|
||||||
public abstract DockUpdaterFeatureProvider getDockUpdaterFeatureProvider();
|
|
||||||
|
|
||||||
public abstract ApplicationFeatureProvider getApplicationFeatureProvider(Context context);
|
|
||||||
|
|
||||||
public abstract LocaleFeatureProvider getLocaleFeatureProvider();
|
|
||||||
|
|
||||||
public abstract EnterprisePrivacyFeatureProvider getEnterprisePrivacyFeatureProvider(
|
|
||||||
Context context);
|
|
||||||
|
|
||||||
public abstract SearchFeatureProvider getSearchFeatureProvider();
|
|
||||||
|
|
||||||
public abstract SurveyFeatureProvider getSurveyFeatureProvider(Context context);
|
|
||||||
|
|
||||||
public abstract SecurityFeatureProvider getSecurityFeatureProvider();
|
|
||||||
|
|
||||||
public abstract UserFeatureProvider getUserFeatureProvider(Context context);
|
|
||||||
|
|
||||||
public abstract SlicesFeatureProvider getSlicesFeatureProvider();
|
|
||||||
|
|
||||||
public abstract AccountFeatureProvider getAccountFeatureProvider();
|
|
||||||
|
|
||||||
public abstract PanelFeatureProvider getPanelFeatureProvider();
|
|
||||||
|
|
||||||
public abstract ContextualCardFeatureProvider getContextualCardFeatureProvider(Context context);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieves implementation for Bluetooth feature.
|
|
||||||
*/
|
|
||||||
public abstract BluetoothFeatureProvider getBluetoothFeatureProvider();
|
|
||||||
|
|
||||||
public abstract FaceFeatureProvider getFaceFeatureProvider();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets implementation for Biometrics repository provider.
|
|
||||||
*/
|
|
||||||
public abstract BiometricsRepositoryProvider getBiometricsRepositoryProvider();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets implementation for the WifiTrackerLib.
|
|
||||||
*/
|
|
||||||
public abstract WifiTrackerLibProvider getWifiTrackerLibProvider();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieves implementation for SecuritySettings feature.
|
|
||||||
*/
|
|
||||||
public abstract SecuritySettingsFeatureProvider getSecuritySettingsFeatureProvider();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieves implementation for Accessibility search index feature.
|
|
||||||
*/
|
|
||||||
public abstract AccessibilitySearchFeatureProvider getAccessibilitySearchFeatureProvider();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieves implementation for Accessibility metrics category feature.
|
|
||||||
*/
|
|
||||||
public abstract AccessibilityMetricsFeatureProvider getAccessibilityMetricsFeatureProvider();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieves implementation for advanced vpn feature.
|
|
||||||
*/
|
|
||||||
public abstract AdvancedVpnFeatureProvider getAdvancedVpnFeatureProvider();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieves implementation for Wi-Fi feature.
|
|
||||||
*/
|
|
||||||
public abstract WifiFeatureProvider getWifiFeatureProvider();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieves implementation for keyboard settings feature.
|
|
||||||
*/
|
|
||||||
public abstract KeyboardSettingsFeatureProvider getKeyboardSettingsFeatureProvider();
|
|
||||||
|
|
||||||
public static final class FactoryNotFoundException extends RuntimeException {
|
|
||||||
public FactoryNotFoundException(Throwable throwable) {
|
|
||||||
super("Unable to create factory. Did you misconfigure Proguard?", throwable);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
183
src/com/android/settings/overlay/FeatureFactory.kt
Normal file
183
src/com/android/settings/overlay/FeatureFactory.kt
Normal file
@@ -0,0 +1,183 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2016 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.overlay
|
||||||
|
|
||||||
|
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
|
||||||
|
import com.android.settings.biometrics.face.FaceFeatureProvider
|
||||||
|
import com.android.settings.biometrics2.factory.BiometricsRepositoryProvider
|
||||||
|
import com.android.settings.bluetooth.BluetoothFeatureProvider
|
||||||
|
import com.android.settings.dashboard.DashboardFeatureProvider
|
||||||
|
import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider
|
||||||
|
import com.android.settings.deviceinfo.hardwareinfo.HardwareInfoFeatureProvider
|
||||||
|
import com.android.settings.enterprise.EnterprisePrivacyFeatureProvider
|
||||||
|
import com.android.settings.fuelgauge.BatterySettingsFeatureProvider
|
||||||
|
import com.android.settings.fuelgauge.BatteryStatusFeatureProvider
|
||||||
|
import com.android.settings.fuelgauge.PowerUsageFeatureProvider
|
||||||
|
import com.android.settings.gestures.AssistGestureFeatureProvider
|
||||||
|
import com.android.settings.homepage.contextualcards.ContextualCardFeatureProvider
|
||||||
|
import com.android.settings.inputmethod.KeyboardSettingsFeatureProvider
|
||||||
|
import com.android.settings.localepicker.LocaleFeatureProvider
|
||||||
|
import com.android.settings.overlay.FeatureFactory.Companion.setFactory
|
||||||
|
import com.android.settings.panel.PanelFeatureProvider
|
||||||
|
import com.android.settings.search.SearchFeatureProvider
|
||||||
|
import com.android.settings.security.SecurityFeatureProvider
|
||||||
|
import com.android.settings.security.SecuritySettingsFeatureProvider
|
||||||
|
import com.android.settings.slices.SlicesFeatureProvider
|
||||||
|
import com.android.settings.users.UserFeatureProvider
|
||||||
|
import com.android.settings.vpn2.AdvancedVpnFeatureProvider
|
||||||
|
import com.android.settings.wifi.WifiTrackerLibProvider
|
||||||
|
import com.android.settings.wifi.factory.WifiFeatureProvider
|
||||||
|
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Abstract class for creating feature controllers.
|
||||||
|
*
|
||||||
|
* Allows OEM implementations to define their own factories with their own controllers containing
|
||||||
|
* whatever code is needed to implement the features.
|
||||||
|
* To provide a factory implementation, implementors should call [setFactory] in their Application.
|
||||||
|
*/
|
||||||
|
abstract class FeatureFactory {
|
||||||
|
abstract val assistGestureFeatureProvider: AssistGestureFeatureProvider
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets implementation for the Suggestion Feature provider.
|
||||||
|
*/
|
||||||
|
abstract val suggestionFeatureProvider: SuggestionFeatureProvider
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves implementation for Hardware Info feature.
|
||||||
|
*/
|
||||||
|
abstract val hardwareInfoFeatureProvider: HardwareInfoFeatureProvider
|
||||||
|
|
||||||
|
abstract fun getSupportFeatureProvider(context: Context): SupportFeatureProvider?
|
||||||
|
abstract val metricsFeatureProvider: MetricsFeatureProvider
|
||||||
|
abstract fun getPowerUsageFeatureProvider(context: Context): PowerUsageFeatureProvider
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves implementation for Battery Status feature.
|
||||||
|
*/
|
||||||
|
abstract fun getBatteryStatusFeatureProvider(
|
||||||
|
context: Context
|
||||||
|
): BatteryStatusFeatureProvider
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets implementation for Battery Settings provider.
|
||||||
|
*/
|
||||||
|
abstract val batterySettingsFeatureProvider: BatterySettingsFeatureProvider
|
||||||
|
|
||||||
|
abstract fun getDashboardFeatureProvider(context: Context): DashboardFeatureProvider
|
||||||
|
abstract val dockUpdaterFeatureProvider: DockUpdaterFeatureProvider
|
||||||
|
abstract fun getApplicationFeatureProvider(context: Context): ApplicationFeatureProvider
|
||||||
|
abstract val localeFeatureProvider: LocaleFeatureProvider
|
||||||
|
|
||||||
|
abstract fun getEnterprisePrivacyFeatureProvider(
|
||||||
|
context: Context,
|
||||||
|
): EnterprisePrivacyFeatureProvider
|
||||||
|
|
||||||
|
abstract val searchFeatureProvider: SearchFeatureProvider
|
||||||
|
abstract fun getSurveyFeatureProvider(context: Context): SurveyFeatureProvider?
|
||||||
|
abstract val securityFeatureProvider: SecurityFeatureProvider
|
||||||
|
abstract fun getUserFeatureProvider(context: Context): UserFeatureProvider
|
||||||
|
abstract val slicesFeatureProvider: SlicesFeatureProvider
|
||||||
|
abstract val accountFeatureProvider: AccountFeatureProvider
|
||||||
|
abstract val panelFeatureProvider: PanelFeatureProvider
|
||||||
|
abstract fun getContextualCardFeatureProvider(context: Context): ContextualCardFeatureProvider
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves implementation for Bluetooth feature.
|
||||||
|
*/
|
||||||
|
abstract val bluetoothFeatureProvider: BluetoothFeatureProvider
|
||||||
|
|
||||||
|
abstract val faceFeatureProvider: FaceFeatureProvider
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets implementation for Biometrics repository provider.
|
||||||
|
*/
|
||||||
|
abstract val biometricsRepositoryProvider: BiometricsRepositoryProvider
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets implementation for the WifiTrackerLib.
|
||||||
|
*/
|
||||||
|
abstract val wifiTrackerLibProvider: WifiTrackerLibProvider
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves implementation for SecuritySettings feature.
|
||||||
|
*/
|
||||||
|
abstract val securitySettingsFeatureProvider: SecuritySettingsFeatureProvider
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves implementation for Accessibility search index feature.
|
||||||
|
*/
|
||||||
|
abstract val accessibilitySearchFeatureProvider: AccessibilitySearchFeatureProvider
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves implementation for Accessibility metrics category feature.
|
||||||
|
*/
|
||||||
|
abstract val accessibilityMetricsFeatureProvider: AccessibilityMetricsFeatureProvider
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves implementation for advanced vpn feature.
|
||||||
|
*/
|
||||||
|
abstract val advancedVpnFeatureProvider: AdvancedVpnFeatureProvider
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves implementation for Wi-Fi feature.
|
||||||
|
*/
|
||||||
|
abstract val wifiFeatureProvider: WifiFeatureProvider
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves implementation for keyboard settings feature.
|
||||||
|
*/
|
||||||
|
abstract val keyboardSettingsFeatureProvider: KeyboardSettingsFeatureProvider
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private var _factory: FeatureFactory? = null
|
||||||
|
|
||||||
|
/** Returns a factory for creating feature controllers. */
|
||||||
|
@JvmStatic
|
||||||
|
val factory: FeatureFactory
|
||||||
|
get() = _factory ?: throw UnsupportedOperationException("No feature factory configured")
|
||||||
|
|
||||||
|
private var _appContext: Context? = null
|
||||||
|
|
||||||
|
/** Returns an application [Context] used to create this [FeatureFactory]. */
|
||||||
|
@JvmStatic
|
||||||
|
val appContext: Context
|
||||||
|
get() = _appContext
|
||||||
|
?: throw UnsupportedOperationException("No feature factory configured")
|
||||||
|
|
||||||
|
@JvmStatic
|
||||||
|
fun setFactory(appContext: Context, factory: FeatureFactory) {
|
||||||
|
_appContext = appContext
|
||||||
|
_factory = factory
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Returns a factory for creating feature controllers. */
|
||||||
|
@Deprecated(
|
||||||
|
"Replace with factory without Context",
|
||||||
|
ReplaceWith(
|
||||||
|
"factory",
|
||||||
|
"com.android.settings.overlay.FeatureFactory.Companion.factory",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
@JvmStatic
|
||||||
|
fun getFactory(context: Context?): FeatureFactory = factory
|
||||||
|
}
|
||||||
|
}
|
@@ -1,375 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2016 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.overlay;
|
|
||||||
|
|
||||||
import android.app.AppGlobals;
|
|
||||||
import android.app.admin.DevicePolicyManager;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.net.ConnectivityManager;
|
|
||||||
import android.net.VpnManager;
|
|
||||||
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;
|
|
||||||
import com.android.settings.accounts.AccountFeatureProviderImpl;
|
|
||||||
import com.android.settings.applications.ApplicationFeatureProvider;
|
|
||||||
import com.android.settings.applications.ApplicationFeatureProviderImpl;
|
|
||||||
import com.android.settings.biometrics.face.FaceFeatureProvider;
|
|
||||||
import com.android.settings.biometrics.face.FaceFeatureProviderImpl;
|
|
||||||
import com.android.settings.biometrics2.factory.BiometricsRepositoryProvider;
|
|
||||||
import com.android.settings.biometrics2.factory.BiometricsRepositoryProviderImpl;
|
|
||||||
import com.android.settings.bluetooth.BluetoothFeatureProvider;
|
|
||||||
import com.android.settings.bluetooth.BluetoothFeatureProviderImpl;
|
|
||||||
import com.android.settings.connecteddevice.dock.DockUpdaterFeatureProviderImpl;
|
|
||||||
import com.android.settings.core.instrumentation.SettingsMetricsFeatureProvider;
|
|
||||||
import com.android.settings.dashboard.DashboardFeatureProvider;
|
|
||||||
import com.android.settings.dashboard.DashboardFeatureProviderImpl;
|
|
||||||
import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider;
|
|
||||||
import com.android.settings.dashboard.suggestions.SuggestionFeatureProviderImpl;
|
|
||||||
import com.android.settings.deviceinfo.hardwareinfo.HardwareInfoFeatureProvider;
|
|
||||||
import com.android.settings.deviceinfo.hardwareinfo.HardwareInfoFeatureProviderImpl;
|
|
||||||
import com.android.settings.enterprise.EnterprisePrivacyFeatureProvider;
|
|
||||||
import com.android.settings.enterprise.EnterprisePrivacyFeatureProviderImpl;
|
|
||||||
import com.android.settings.fuelgauge.BatterySettingsFeatureProvider;
|
|
||||||
import com.android.settings.fuelgauge.BatterySettingsFeatureProviderImpl;
|
|
||||||
import com.android.settings.fuelgauge.BatteryStatusFeatureProvider;
|
|
||||||
import com.android.settings.fuelgauge.BatteryStatusFeatureProviderImpl;
|
|
||||||
import com.android.settings.fuelgauge.PowerUsageFeatureProvider;
|
|
||||||
import com.android.settings.fuelgauge.PowerUsageFeatureProviderImpl;
|
|
||||||
import com.android.settings.gestures.AssistGestureFeatureProvider;
|
|
||||||
import com.android.settings.gestures.AssistGestureFeatureProviderImpl;
|
|
||||||
import com.android.settings.homepage.contextualcards.ContextualCardFeatureProvider;
|
|
||||||
import com.android.settings.homepage.contextualcards.ContextualCardFeatureProviderImpl;
|
|
||||||
import com.android.settings.inputmethod.KeyboardSettingsFeatureProvider;
|
|
||||||
import com.android.settings.inputmethod.KeyboardSettingsFeatureProviderImpl;
|
|
||||||
import com.android.settings.localepicker.LocaleFeatureProvider;
|
|
||||||
import com.android.settings.localepicker.LocaleFeatureProviderImpl;
|
|
||||||
import com.android.settings.panel.PanelFeatureProvider;
|
|
||||||
import com.android.settings.panel.PanelFeatureProviderImpl;
|
|
||||||
import com.android.settings.search.SearchFeatureProvider;
|
|
||||||
import com.android.settings.search.SearchFeatureProviderImpl;
|
|
||||||
import com.android.settings.security.SecurityFeatureProvider;
|
|
||||||
import com.android.settings.security.SecurityFeatureProviderImpl;
|
|
||||||
import com.android.settings.security.SecuritySettingsFeatureProvider;
|
|
||||||
import com.android.settings.security.SecuritySettingsFeatureProviderImpl;
|
|
||||||
import com.android.settings.slices.SlicesFeatureProvider;
|
|
||||||
import com.android.settings.slices.SlicesFeatureProviderImpl;
|
|
||||||
import com.android.settings.users.UserFeatureProvider;
|
|
||||||
import com.android.settings.users.UserFeatureProviderImpl;
|
|
||||||
import com.android.settings.vpn2.AdvancedVpnFeatureProvider;
|
|
||||||
import com.android.settings.vpn2.AdvancedVpnFeatureProviderImpl;
|
|
||||||
import com.android.settings.wifi.WifiTrackerLibProvider;
|
|
||||||
import com.android.settings.wifi.WifiTrackerLibProviderImpl;
|
|
||||||
import com.android.settings.wifi.factory.WifiFeatureProvider;
|
|
||||||
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@link FeatureFactory} implementation for AOSP Settings.
|
|
||||||
*/
|
|
||||||
@Keep
|
|
||||||
public class FeatureFactoryImpl extends FeatureFactory {
|
|
||||||
|
|
||||||
private ApplicationFeatureProvider mApplicationFeatureProvider;
|
|
||||||
private MetricsFeatureProvider mMetricsFeatureProvider;
|
|
||||||
private DashboardFeatureProviderImpl mDashboardFeatureProvider;
|
|
||||||
private DockUpdaterFeatureProvider mDockUpdaterFeatureProvider;
|
|
||||||
private LocaleFeatureProvider mLocaleFeatureProvider;
|
|
||||||
private EnterprisePrivacyFeatureProvider mEnterprisePrivacyFeatureProvider;
|
|
||||||
private SearchFeatureProvider mSearchFeatureProvider;
|
|
||||||
private SecurityFeatureProvider mSecurityFeatureProvider;
|
|
||||||
private SuggestionFeatureProvider mSuggestionFeatureProvider;
|
|
||||||
private PowerUsageFeatureProvider mPowerUsageFeatureProvider;
|
|
||||||
private BatteryStatusFeatureProvider mBatteryStatusFeatureProvider;
|
|
||||||
private BatterySettingsFeatureProvider mBatterySettingsFeatureProvider;
|
|
||||||
private AssistGestureFeatureProvider mAssistGestureFeatureProvider;
|
|
||||||
private UserFeatureProvider mUserFeatureProvider;
|
|
||||||
private SlicesFeatureProvider mSlicesFeatureProvider;
|
|
||||||
private AccountFeatureProvider mAccountFeatureProvider;
|
|
||||||
private PanelFeatureProvider mPanelFeatureProvider;
|
|
||||||
private ContextualCardFeatureProvider mContextualCardFeatureProvider;
|
|
||||||
private BluetoothFeatureProvider mBluetoothFeatureProvider;
|
|
||||||
private FaceFeatureProvider mFaceFeatureProvider;
|
|
||||||
private BiometricsRepositoryProvider mBiometricsRepositoryProvider;
|
|
||||||
private WifiTrackerLibProvider mWifiTrackerLibProvider;
|
|
||||||
private SecuritySettingsFeatureProvider mSecuritySettingsFeatureProvider;
|
|
||||||
private AccessibilitySearchFeatureProvider mAccessibilitySearchFeatureProvider;
|
|
||||||
private AccessibilityMetricsFeatureProvider mAccessibilityMetricsFeatureProvider;
|
|
||||||
private AdvancedVpnFeatureProvider mAdvancedVpnFeatureProvider;
|
|
||||||
private WifiFeatureProvider mWifiFeatureProvider;
|
|
||||||
private KeyboardSettingsFeatureProvider mKeyboardSettingsFeatureProvider;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public HardwareInfoFeatureProvider getHardwareInfoFeatureProvider() {
|
|
||||||
return HardwareInfoFeatureProviderImpl.INSTANCE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public SupportFeatureProvider getSupportFeatureProvider(Context context) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public MetricsFeatureProvider getMetricsFeatureProvider() {
|
|
||||||
if (mMetricsFeatureProvider == null) {
|
|
||||||
mMetricsFeatureProvider = new SettingsMetricsFeatureProvider();
|
|
||||||
}
|
|
||||||
return mMetricsFeatureProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PowerUsageFeatureProvider getPowerUsageFeatureProvider(Context context) {
|
|
||||||
if (mPowerUsageFeatureProvider == null) {
|
|
||||||
mPowerUsageFeatureProvider = new PowerUsageFeatureProviderImpl(
|
|
||||||
context.getApplicationContext());
|
|
||||||
}
|
|
||||||
return mPowerUsageFeatureProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BatteryStatusFeatureProvider getBatteryStatusFeatureProvider(Context context) {
|
|
||||||
if (mBatteryStatusFeatureProvider == null) {
|
|
||||||
mBatteryStatusFeatureProvider = new BatteryStatusFeatureProviderImpl(
|
|
||||||
context.getApplicationContext());
|
|
||||||
}
|
|
||||||
return mBatteryStatusFeatureProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BatterySettingsFeatureProvider getBatterySettingsFeatureProvider() {
|
|
||||||
if (mBatterySettingsFeatureProvider == null) {
|
|
||||||
mBatterySettingsFeatureProvider = new BatterySettingsFeatureProviderImpl();
|
|
||||||
}
|
|
||||||
return mBatterySettingsFeatureProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DashboardFeatureProvider getDashboardFeatureProvider(Context context) {
|
|
||||||
if (mDashboardFeatureProvider == null) {
|
|
||||||
mDashboardFeatureProvider = new DashboardFeatureProviderImpl(
|
|
||||||
context.getApplicationContext());
|
|
||||||
}
|
|
||||||
return mDashboardFeatureProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DockUpdaterFeatureProvider getDockUpdaterFeatureProvider() {
|
|
||||||
if (mDockUpdaterFeatureProvider == null) {
|
|
||||||
mDockUpdaterFeatureProvider = new DockUpdaterFeatureProviderImpl();
|
|
||||||
}
|
|
||||||
return mDockUpdaterFeatureProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ApplicationFeatureProvider getApplicationFeatureProvider(Context context) {
|
|
||||||
if (mApplicationFeatureProvider == null) {
|
|
||||||
final Context appContext = context.getApplicationContext();
|
|
||||||
mApplicationFeatureProvider = new ApplicationFeatureProviderImpl(appContext,
|
|
||||||
appContext.getPackageManager(),
|
|
||||||
AppGlobals.getPackageManager(),
|
|
||||||
(DevicePolicyManager) appContext
|
|
||||||
.getSystemService(Context.DEVICE_POLICY_SERVICE));
|
|
||||||
}
|
|
||||||
return mApplicationFeatureProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public LocaleFeatureProvider getLocaleFeatureProvider() {
|
|
||||||
if (mLocaleFeatureProvider == null) {
|
|
||||||
mLocaleFeatureProvider = new LocaleFeatureProviderImpl();
|
|
||||||
}
|
|
||||||
return mLocaleFeatureProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnterprisePrivacyFeatureProvider getEnterprisePrivacyFeatureProvider(Context context) {
|
|
||||||
if (mEnterprisePrivacyFeatureProvider == null) {
|
|
||||||
final Context appContext = context.getApplicationContext();
|
|
||||||
mEnterprisePrivacyFeatureProvider = new EnterprisePrivacyFeatureProviderImpl(appContext,
|
|
||||||
(DevicePolicyManager) appContext.getSystemService(
|
|
||||||
Context.DEVICE_POLICY_SERVICE),
|
|
||||||
appContext.getPackageManager(),
|
|
||||||
UserManager.get(appContext),
|
|
||||||
appContext.getSystemService(ConnectivityManager.class),
|
|
||||||
appContext.getSystemService(VpnManager.class),
|
|
||||||
appContext.getResources());
|
|
||||||
}
|
|
||||||
return mEnterprisePrivacyFeatureProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public SearchFeatureProvider getSearchFeatureProvider() {
|
|
||||||
if (mSearchFeatureProvider == null) {
|
|
||||||
mSearchFeatureProvider = new SearchFeatureProviderImpl();
|
|
||||||
}
|
|
||||||
return mSearchFeatureProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public SurveyFeatureProvider getSurveyFeatureProvider(Context context) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public SecurityFeatureProvider getSecurityFeatureProvider() {
|
|
||||||
if (mSecurityFeatureProvider == null) {
|
|
||||||
mSecurityFeatureProvider = new SecurityFeatureProviderImpl();
|
|
||||||
}
|
|
||||||
return mSecurityFeatureProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public SuggestionFeatureProvider getSuggestionFeatureProvider() {
|
|
||||||
if (mSuggestionFeatureProvider == null) {
|
|
||||||
mSuggestionFeatureProvider = new SuggestionFeatureProviderImpl();
|
|
||||||
}
|
|
||||||
return mSuggestionFeatureProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public UserFeatureProvider getUserFeatureProvider(Context context) {
|
|
||||||
if (mUserFeatureProvider == null) {
|
|
||||||
mUserFeatureProvider = new UserFeatureProviderImpl(context.getApplicationContext());
|
|
||||||
}
|
|
||||||
return mUserFeatureProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public AssistGestureFeatureProvider getAssistGestureFeatureProvider() {
|
|
||||||
if (mAssistGestureFeatureProvider == null) {
|
|
||||||
mAssistGestureFeatureProvider = new AssistGestureFeatureProviderImpl();
|
|
||||||
}
|
|
||||||
return mAssistGestureFeatureProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public SlicesFeatureProvider getSlicesFeatureProvider() {
|
|
||||||
if (mSlicesFeatureProvider == null) {
|
|
||||||
mSlicesFeatureProvider = new SlicesFeatureProviderImpl();
|
|
||||||
}
|
|
||||||
return mSlicesFeatureProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public AccountFeatureProvider getAccountFeatureProvider() {
|
|
||||||
if (mAccountFeatureProvider == null) {
|
|
||||||
mAccountFeatureProvider = new AccountFeatureProviderImpl();
|
|
||||||
}
|
|
||||||
return mAccountFeatureProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PanelFeatureProvider getPanelFeatureProvider() {
|
|
||||||
if (mPanelFeatureProvider == null) {
|
|
||||||
mPanelFeatureProvider = new PanelFeatureProviderImpl();
|
|
||||||
}
|
|
||||||
return mPanelFeatureProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ContextualCardFeatureProvider getContextualCardFeatureProvider(Context context) {
|
|
||||||
if (mContextualCardFeatureProvider == null) {
|
|
||||||
mContextualCardFeatureProvider = new ContextualCardFeatureProviderImpl(
|
|
||||||
context.getApplicationContext());
|
|
||||||
}
|
|
||||||
return mContextualCardFeatureProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BluetoothFeatureProvider getBluetoothFeatureProvider() {
|
|
||||||
if (mBluetoothFeatureProvider == null) {
|
|
||||||
mBluetoothFeatureProvider = new BluetoothFeatureProviderImpl(getAppContext());
|
|
||||||
}
|
|
||||||
return mBluetoothFeatureProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public FaceFeatureProvider getFaceFeatureProvider() {
|
|
||||||
if (mFaceFeatureProvider == null) {
|
|
||||||
mFaceFeatureProvider = new FaceFeatureProviderImpl();
|
|
||||||
}
|
|
||||||
return mFaceFeatureProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BiometricsRepositoryProvider getBiometricsRepositoryProvider() {
|
|
||||||
if (mBiometricsRepositoryProvider == null) {
|
|
||||||
mBiometricsRepositoryProvider = new BiometricsRepositoryProviderImpl();
|
|
||||||
}
|
|
||||||
return mBiometricsRepositoryProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public WifiTrackerLibProvider getWifiTrackerLibProvider() {
|
|
||||||
if (mWifiTrackerLibProvider == null) {
|
|
||||||
mWifiTrackerLibProvider = new WifiTrackerLibProviderImpl();
|
|
||||||
}
|
|
||||||
return mWifiTrackerLibProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public SecuritySettingsFeatureProvider getSecuritySettingsFeatureProvider() {
|
|
||||||
if (mSecuritySettingsFeatureProvider == null) {
|
|
||||||
mSecuritySettingsFeatureProvider = new SecuritySettingsFeatureProviderImpl();
|
|
||||||
}
|
|
||||||
return mSecuritySettingsFeatureProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public AccessibilitySearchFeatureProvider getAccessibilitySearchFeatureProvider() {
|
|
||||||
if (mAccessibilitySearchFeatureProvider == null) {
|
|
||||||
mAccessibilitySearchFeatureProvider = new AccessibilitySearchFeatureProviderImpl();
|
|
||||||
}
|
|
||||||
return mAccessibilitySearchFeatureProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public AccessibilityMetricsFeatureProvider getAccessibilityMetricsFeatureProvider() {
|
|
||||||
if (mAccessibilityMetricsFeatureProvider == null) {
|
|
||||||
mAccessibilityMetricsFeatureProvider = new AccessibilityMetricsFeatureProviderImpl();
|
|
||||||
}
|
|
||||||
return mAccessibilityMetricsFeatureProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public AdvancedVpnFeatureProvider getAdvancedVpnFeatureProvider() {
|
|
||||||
if (mAdvancedVpnFeatureProvider == null) {
|
|
||||||
mAdvancedVpnFeatureProvider = new AdvancedVpnFeatureProviderImpl();
|
|
||||||
}
|
|
||||||
return mAdvancedVpnFeatureProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public WifiFeatureProvider getWifiFeatureProvider() {
|
|
||||||
if (mWifiFeatureProvider == null) {
|
|
||||||
mWifiFeatureProvider = new WifiFeatureProvider(getAppContext());
|
|
||||||
}
|
|
||||||
return mWifiFeatureProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public KeyboardSettingsFeatureProvider getKeyboardSettingsFeatureProvider() {
|
|
||||||
if (mKeyboardSettingsFeatureProvider == null) {
|
|
||||||
mKeyboardSettingsFeatureProvider = new KeyboardSettingsFeatureProviderImpl();
|
|
||||||
}
|
|
||||||
return mKeyboardSettingsFeatureProvider;
|
|
||||||
}
|
|
||||||
}
|
|
187
src/com/android/settings/overlay/FeatureFactoryImpl.kt
Normal file
187
src/com/android/settings/overlay/FeatureFactoryImpl.kt
Normal file
@@ -0,0 +1,187 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2016 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.overlay
|
||||||
|
|
||||||
|
import android.app.AppGlobals
|
||||||
|
import android.content.Context
|
||||||
|
import android.net.ConnectivityManager
|
||||||
|
import android.net.VpnManager
|
||||||
|
import android.os.UserManager
|
||||||
|
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
|
||||||
|
import com.android.settings.accounts.AccountFeatureProviderImpl
|
||||||
|
import com.android.settings.applications.ApplicationFeatureProviderImpl
|
||||||
|
import com.android.settings.biometrics.face.FaceFeatureProvider
|
||||||
|
import com.android.settings.biometrics.face.FaceFeatureProviderImpl
|
||||||
|
import com.android.settings.biometrics2.factory.BiometricsRepositoryProviderImpl
|
||||||
|
import com.android.settings.bluetooth.BluetoothFeatureProvider
|
||||||
|
import com.android.settings.bluetooth.BluetoothFeatureProviderImpl
|
||||||
|
import com.android.settings.connecteddevice.dock.DockUpdaterFeatureProviderImpl
|
||||||
|
import com.android.settings.core.instrumentation.SettingsMetricsFeatureProvider
|
||||||
|
import com.android.settings.dashboard.DashboardFeatureProviderImpl
|
||||||
|
import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider
|
||||||
|
import com.android.settings.dashboard.suggestions.SuggestionFeatureProviderImpl
|
||||||
|
import com.android.settings.deviceinfo.hardwareinfo.HardwareInfoFeatureProvider
|
||||||
|
import com.android.settings.deviceinfo.hardwareinfo.HardwareInfoFeatureProviderImpl
|
||||||
|
import com.android.settings.enterprise.EnterprisePrivacyFeatureProviderImpl
|
||||||
|
import com.android.settings.fuelgauge.BatterySettingsFeatureProviderImpl
|
||||||
|
import com.android.settings.fuelgauge.BatteryStatusFeatureProviderImpl
|
||||||
|
import com.android.settings.fuelgauge.PowerUsageFeatureProviderImpl
|
||||||
|
import com.android.settings.gestures.AssistGestureFeatureProviderImpl
|
||||||
|
import com.android.settings.homepage.contextualcards.ContextualCardFeatureProviderImpl
|
||||||
|
import com.android.settings.inputmethod.KeyboardSettingsFeatureProvider
|
||||||
|
import com.android.settings.inputmethod.KeyboardSettingsFeatureProviderImpl
|
||||||
|
import com.android.settings.localepicker.LocaleFeatureProviderImpl
|
||||||
|
import com.android.settings.panel.PanelFeatureProviderImpl
|
||||||
|
import com.android.settings.search.SearchFeatureProvider
|
||||||
|
import com.android.settings.search.SearchFeatureProviderImpl
|
||||||
|
import com.android.settings.security.SecurityFeatureProviderImpl
|
||||||
|
import com.android.settings.security.SecuritySettingsFeatureProvider
|
||||||
|
import com.android.settings.security.SecuritySettingsFeatureProviderImpl
|
||||||
|
import com.android.settings.slices.SlicesFeatureProviderImpl
|
||||||
|
import com.android.settings.users.UserFeatureProviderImpl
|
||||||
|
import com.android.settings.vpn2.AdvancedVpnFeatureProviderImpl
|
||||||
|
import com.android.settings.wifi.WifiTrackerLibProvider
|
||||||
|
import com.android.settings.wifi.WifiTrackerLibProviderImpl
|
||||||
|
import com.android.settings.wifi.factory.WifiFeatureProvider
|
||||||
|
import com.android.settingslib.spaprivileged.framework.common.devicePolicyManager
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [FeatureFactory] implementation for AOSP Settings.
|
||||||
|
*/
|
||||||
|
open class FeatureFactoryImpl : FeatureFactory() {
|
||||||
|
private val applicationFeatureProvider by lazy {
|
||||||
|
ApplicationFeatureProviderImpl(
|
||||||
|
appContext,
|
||||||
|
appContext.packageManager,
|
||||||
|
AppGlobals.getPackageManager(),
|
||||||
|
appContext.devicePolicyManager,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
private val dashboardFeatureProvider by lazy { DashboardFeatureProviderImpl(appContext) }
|
||||||
|
|
||||||
|
private val enterprisePrivacyFeatureProvider by lazy {
|
||||||
|
EnterprisePrivacyFeatureProviderImpl(
|
||||||
|
appContext,
|
||||||
|
appContext.devicePolicyManager,
|
||||||
|
appContext.packageManager,
|
||||||
|
UserManager.get(appContext),
|
||||||
|
appContext.getSystemService(ConnectivityManager::class.java),
|
||||||
|
appContext.getSystemService(VpnManager::class.java),
|
||||||
|
appContext.resources,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
private val powerUsageFeatureProvider by lazy { PowerUsageFeatureProviderImpl(appContext) }
|
||||||
|
|
||||||
|
private val batteryStatusFeatureProvider by lazy {
|
||||||
|
BatteryStatusFeatureProviderImpl(appContext)
|
||||||
|
}
|
||||||
|
|
||||||
|
private val userFeatureProvider by lazy { UserFeatureProviderImpl(appContext) }
|
||||||
|
|
||||||
|
private val contextualCardFeatureProvider by lazy {
|
||||||
|
ContextualCardFeatureProviderImpl(appContext)
|
||||||
|
}
|
||||||
|
|
||||||
|
override val hardwareInfoFeatureProvider: HardwareInfoFeatureProvider =
|
||||||
|
HardwareInfoFeatureProviderImpl
|
||||||
|
|
||||||
|
override fun getSupportFeatureProvider(context: Context): SupportFeatureProvider? = null
|
||||||
|
|
||||||
|
override val metricsFeatureProvider by lazy { SettingsMetricsFeatureProvider() }
|
||||||
|
|
||||||
|
override fun getPowerUsageFeatureProvider(context: Context) = powerUsageFeatureProvider
|
||||||
|
|
||||||
|
override fun getBatteryStatusFeatureProvider(context: Context) = batteryStatusFeatureProvider
|
||||||
|
|
||||||
|
override val batterySettingsFeatureProvider by lazy { BatterySettingsFeatureProviderImpl() }
|
||||||
|
|
||||||
|
override fun getDashboardFeatureProvider(context: Context) = dashboardFeatureProvider
|
||||||
|
|
||||||
|
override val dockUpdaterFeatureProvider: DockUpdaterFeatureProvider by lazy {
|
||||||
|
DockUpdaterFeatureProviderImpl()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getApplicationFeatureProvider(context: Context) = applicationFeatureProvider
|
||||||
|
|
||||||
|
override val localeFeatureProvider by lazy { LocaleFeatureProviderImpl() }
|
||||||
|
|
||||||
|
override fun getEnterprisePrivacyFeatureProvider(context: Context) =
|
||||||
|
enterprisePrivacyFeatureProvider
|
||||||
|
|
||||||
|
override val searchFeatureProvider: SearchFeatureProvider by lazy {
|
||||||
|
SearchFeatureProviderImpl()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getSurveyFeatureProvider(context: Context): SurveyFeatureProvider? = null
|
||||||
|
|
||||||
|
override val securityFeatureProvider by lazy { SecurityFeatureProviderImpl() }
|
||||||
|
|
||||||
|
override val suggestionFeatureProvider: SuggestionFeatureProvider by lazy {
|
||||||
|
SuggestionFeatureProviderImpl()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getUserFeatureProvider(context: Context) = userFeatureProvider
|
||||||
|
|
||||||
|
override val assistGestureFeatureProvider by lazy { AssistGestureFeatureProviderImpl() }
|
||||||
|
|
||||||
|
override val slicesFeatureProvider by lazy { SlicesFeatureProviderImpl() }
|
||||||
|
|
||||||
|
override val accountFeatureProvider: AccountFeatureProvider by lazy {
|
||||||
|
AccountFeatureProviderImpl()
|
||||||
|
}
|
||||||
|
|
||||||
|
override val panelFeatureProvider by lazy { PanelFeatureProviderImpl() }
|
||||||
|
|
||||||
|
override fun getContextualCardFeatureProvider(context: Context) = contextualCardFeatureProvider
|
||||||
|
|
||||||
|
override val bluetoothFeatureProvider: BluetoothFeatureProvider by lazy {
|
||||||
|
BluetoothFeatureProviderImpl(appContext)
|
||||||
|
}
|
||||||
|
|
||||||
|
override val faceFeatureProvider: FaceFeatureProvider by lazy { FaceFeatureProviderImpl() }
|
||||||
|
|
||||||
|
override val biometricsRepositoryProvider by lazy { BiometricsRepositoryProviderImpl() }
|
||||||
|
|
||||||
|
override val wifiTrackerLibProvider: WifiTrackerLibProvider by lazy {
|
||||||
|
WifiTrackerLibProviderImpl()
|
||||||
|
}
|
||||||
|
|
||||||
|
override val securitySettingsFeatureProvider: SecuritySettingsFeatureProvider by lazy {
|
||||||
|
SecuritySettingsFeatureProviderImpl()
|
||||||
|
}
|
||||||
|
|
||||||
|
override val accessibilitySearchFeatureProvider: AccessibilitySearchFeatureProvider by lazy {
|
||||||
|
AccessibilitySearchFeatureProviderImpl()
|
||||||
|
}
|
||||||
|
|
||||||
|
override val accessibilityMetricsFeatureProvider: AccessibilityMetricsFeatureProvider by lazy {
|
||||||
|
AccessibilityMetricsFeatureProviderImpl()
|
||||||
|
}
|
||||||
|
|
||||||
|
override val advancedVpnFeatureProvider by lazy { AdvancedVpnFeatureProviderImpl() }
|
||||||
|
|
||||||
|
override val wifiFeatureProvider by lazy { WifiFeatureProvider(appContext) }
|
||||||
|
|
||||||
|
override val keyboardSettingsFeatureProvider: KeyboardSettingsFeatureProvider by lazy {
|
||||||
|
KeyboardSettingsFeatureProviderImpl()
|
||||||
|
}
|
||||||
|
}
|
@@ -15,9 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.android.settings.testutils;
|
package com.android.settings.testutils;
|
||||||
|
|
||||||
import static org.mockito.ArgumentMatchers.anyString;
|
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.when;
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
@@ -55,8 +53,6 @@ import com.android.settings.wifi.WifiTrackerLibProvider;
|
|||||||
import com.android.settings.wifi.factory.WifiFeatureProvider;
|
import com.android.settings.wifi.factory.WifiFeatureProvider;
|
||||||
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
|
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
|
||||||
|
|
||||||
import org.mockito.Answers;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test util to provide fake FeatureFactory. To use this factory, call {@code setupForTest} in
|
* Test util to provide fake FeatureFactory. To use this factory, call {@code setupForTest} in
|
||||||
* {@code @Before} method of the test class.
|
* {@code @Before} method of the test class.
|
||||||
@@ -100,17 +96,9 @@ public class FakeFeatureFactory extends FeatureFactory {
|
|||||||
* Call this in {@code @Before} method of the test class to use fake factory.
|
* Call this in {@code @Before} method of the test class to use fake factory.
|
||||||
*/
|
*/
|
||||||
public static FakeFeatureFactory setupForTest() {
|
public static FakeFeatureFactory setupForTest() {
|
||||||
final Context context = mock(Context.class, Answers.RETURNS_DEEP_STUBS);
|
FakeFeatureFactory factory = new FakeFeatureFactory();
|
||||||
sFactory = null;
|
setFactory(getAppContext(), factory);
|
||||||
when(context.getString(com.android.settings.R.string.config_featureFactory))
|
return factory;
|
||||||
.thenReturn(FakeFeatureFactory.class.getName());
|
|
||||||
try {
|
|
||||||
Class c = FakeFeatureFactory.class;
|
|
||||||
when(context.getClassLoader().loadClass(anyString())).thenReturn(c);
|
|
||||||
} catch (ClassNotFoundException e) {
|
|
||||||
// Ignore.
|
|
||||||
}
|
|
||||||
return (FakeFeatureFactory) FakeFeatureFactory.getFactory(context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -47,7 +47,7 @@ import com.android.settings.slices.SlicesFeatureProvider
|
|||||||
import com.android.settings.users.UserFeatureProvider
|
import com.android.settings.users.UserFeatureProvider
|
||||||
import com.android.settings.vpn2.AdvancedVpnFeatureProvider
|
import com.android.settings.vpn2.AdvancedVpnFeatureProvider
|
||||||
import com.android.settings.wifi.WifiTrackerLibProvider
|
import com.android.settings.wifi.WifiTrackerLibProvider
|
||||||
import com.android.settings.wifi.factory.WifiFeatureProvider;
|
import com.android.settings.wifi.factory.WifiFeatureProvider
|
||||||
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider
|
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider
|
||||||
import org.mockito.Mockito.mock
|
import org.mockito.Mockito.mock
|
||||||
|
|
||||||
@@ -59,130 +59,94 @@ class FakeFeatureFactory : FeatureFactory() {
|
|||||||
mock(ApplicationFeatureProvider::class.java)
|
mock(ApplicationFeatureProvider::class.java)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
sFactory = this
|
setFactory(appContext, this)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getAssistGestureFeatureProvider(): AssistGestureFeatureProvider {
|
override val assistGestureFeatureProvider: AssistGestureFeatureProvider
|
||||||
|
get() = TODO("Not yet implemented")
|
||||||
|
override val suggestionFeatureProvider: SuggestionFeatureProvider
|
||||||
|
get() = TODO("Not yet implemented")
|
||||||
|
override val hardwareInfoFeatureProvider: HardwareInfoFeatureProvider
|
||||||
|
get() = TODO("Not yet implemented")
|
||||||
|
|
||||||
|
override fun getSupportFeatureProvider(context: Context): SupportFeatureProvider? {
|
||||||
TODO("Not yet implemented")
|
TODO("Not yet implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getSuggestionFeatureProvider(): SuggestionFeatureProvider {
|
override val metricsFeatureProvider = mockMetricsFeatureProvider
|
||||||
|
|
||||||
|
override fun getPowerUsageFeatureProvider(context: Context): PowerUsageFeatureProvider {
|
||||||
TODO("Not yet implemented")
|
TODO("Not yet implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getSupportFeatureProvider(context: Context?): SupportFeatureProvider {
|
override fun getBatteryStatusFeatureProvider(context: Context): BatteryStatusFeatureProvider {
|
||||||
TODO("Not yet implemented")
|
TODO("Not yet implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getMetricsFeatureProvider(): MetricsFeatureProvider = mockMetricsFeatureProvider
|
override val batterySettingsFeatureProvider: BatterySettingsFeatureProvider
|
||||||
|
get() = TODO("Not yet implemented")
|
||||||
|
|
||||||
override fun getPowerUsageFeatureProvider(context: Context?): PowerUsageFeatureProvider {
|
override fun getDashboardFeatureProvider(context: Context): DashboardFeatureProvider {
|
||||||
TODO("Not yet implemented")
|
TODO("Not yet implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getBatteryStatusFeatureProvider(context: Context?): BatteryStatusFeatureProvider {
|
override val dockUpdaterFeatureProvider: DockUpdaterFeatureProvider
|
||||||
TODO("Not yet implemented")
|
get() = TODO("Not yet implemented")
|
||||||
}
|
|
||||||
|
|
||||||
override fun getBatterySettingsFeatureProvider(): BatterySettingsFeatureProvider {
|
override fun getApplicationFeatureProvider(context: Context) = mockApplicationFeatureProvider
|
||||||
TODO("Not yet implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getDashboardFeatureProvider(context: Context?): DashboardFeatureProvider {
|
override val localeFeatureProvider: LocaleFeatureProvider
|
||||||
TODO("Not yet implemented")
|
get() = TODO("Not yet implemented")
|
||||||
}
|
|
||||||
|
|
||||||
override fun getDockUpdaterFeatureProvider(): DockUpdaterFeatureProvider {
|
|
||||||
TODO("Not yet implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getApplicationFeatureProvider(context: Context?) = mockApplicationFeatureProvider
|
|
||||||
|
|
||||||
override fun getLocaleFeatureProvider(): LocaleFeatureProvider {
|
|
||||||
TODO("Not yet implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getEnterprisePrivacyFeatureProvider(
|
override fun getEnterprisePrivacyFeatureProvider(
|
||||||
context: Context?,
|
context: Context,
|
||||||
): EnterprisePrivacyFeatureProvider {
|
): EnterprisePrivacyFeatureProvider {
|
||||||
TODO("Not yet implemented")
|
TODO("Not yet implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getSearchFeatureProvider(): SearchFeatureProvider {
|
override val searchFeatureProvider: SearchFeatureProvider
|
||||||
|
get() = TODO("Not yet implemented")
|
||||||
|
|
||||||
|
override fun getSurveyFeatureProvider(context: Context): SurveyFeatureProvider? {
|
||||||
TODO("Not yet implemented")
|
TODO("Not yet implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getSurveyFeatureProvider(context: Context?): SurveyFeatureProvider {
|
override val securityFeatureProvider: SecurityFeatureProvider
|
||||||
|
get() = TODO("Not yet implemented")
|
||||||
|
|
||||||
|
override fun getUserFeatureProvider(context: Context): UserFeatureProvider {
|
||||||
TODO("Not yet implemented")
|
TODO("Not yet implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getSecurityFeatureProvider(): SecurityFeatureProvider {
|
override val slicesFeatureProvider: SlicesFeatureProvider
|
||||||
|
get() = TODO("Not yet implemented")
|
||||||
|
override val accountFeatureProvider: AccountFeatureProvider
|
||||||
|
get() = TODO("Not yet implemented")
|
||||||
|
override val panelFeatureProvider: PanelFeatureProvider
|
||||||
|
get() = TODO("Not yet implemented")
|
||||||
|
|
||||||
|
override fun getContextualCardFeatureProvider(context: Context): ContextualCardFeatureProvider {
|
||||||
TODO("Not yet implemented")
|
TODO("Not yet implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getUserFeatureProvider(context: Context?): UserFeatureProvider {
|
override val bluetoothFeatureProvider: BluetoothFeatureProvider
|
||||||
TODO("Not yet implemented")
|
get() = TODO("Not yet implemented")
|
||||||
}
|
override val faceFeatureProvider: FaceFeatureProvider
|
||||||
|
get() = TODO("Not yet implemented")
|
||||||
override fun getSlicesFeatureProvider(): SlicesFeatureProvider {
|
override val biometricsRepositoryProvider: BiometricsRepositoryProvider
|
||||||
TODO("Not yet implemented")
|
get() = TODO("Not yet implemented")
|
||||||
}
|
override val wifiTrackerLibProvider: WifiTrackerLibProvider
|
||||||
|
get() = TODO("Not yet implemented")
|
||||||
override fun getAccountFeatureProvider(): AccountFeatureProvider {
|
override val securitySettingsFeatureProvider: SecuritySettingsFeatureProvider
|
||||||
TODO("Not yet implemented")
|
get() = TODO("Not yet implemented")
|
||||||
}
|
override val accessibilitySearchFeatureProvider: AccessibilitySearchFeatureProvider
|
||||||
|
get() = TODO("Not yet implemented")
|
||||||
override fun getPanelFeatureProvider(): PanelFeatureProvider {
|
override val accessibilityMetricsFeatureProvider: AccessibilityMetricsFeatureProvider
|
||||||
TODO("Not yet implemented")
|
get() = TODO("Not yet implemented")
|
||||||
}
|
override val advancedVpnFeatureProvider: AdvancedVpnFeatureProvider
|
||||||
|
get() = TODO("Not yet implemented")
|
||||||
override fun getContextualCardFeatureProvider(
|
override val wifiFeatureProvider: WifiFeatureProvider
|
||||||
context: Context?,
|
get() = TODO("Not yet implemented")
|
||||||
): ContextualCardFeatureProvider {
|
override val keyboardSettingsFeatureProvider: KeyboardSettingsFeatureProvider
|
||||||
TODO("Not yet implemented")
|
get() = TODO("Not yet implemented")
|
||||||
}
|
|
||||||
|
|
||||||
override fun getBluetoothFeatureProvider(): BluetoothFeatureProvider {
|
|
||||||
TODO("Not yet implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getFaceFeatureProvider(): FaceFeatureProvider {
|
|
||||||
TODO("Not yet implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getBiometricsRepositoryProvider(): BiometricsRepositoryProvider {
|
|
||||||
TODO("Not yet implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getWifiTrackerLibProvider(): WifiTrackerLibProvider {
|
|
||||||
TODO("Not yet implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getSecuritySettingsFeatureProvider(): SecuritySettingsFeatureProvider {
|
|
||||||
TODO("Not yet implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getAccessibilitySearchFeatureProvider(): AccessibilitySearchFeatureProvider {
|
|
||||||
TODO("Not yet implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getAccessibilityMetricsFeatureProvider(): AccessibilityMetricsFeatureProvider {
|
|
||||||
TODO("Not yet implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getHardwareInfoFeatureProvider(): HardwareInfoFeatureProvider {
|
|
||||||
TODO("Not yet implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getAdvancedVpnFeatureProvider(): AdvancedVpnFeatureProvider {
|
|
||||||
TODO("Not yet implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getWifiFeatureProvider(): WifiFeatureProvider {
|
|
||||||
TODO("Not yet implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getKeyboardSettingsFeatureProvider(): KeyboardSettingsFeatureProvider {
|
|
||||||
TODO("Not yet implemented")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -95,8 +95,9 @@ public class FakeFeatureFactory extends FeatureFactory {
|
|||||||
* Call this in {@code @Before} method of the test class to use fake factory.
|
* Call this in {@code @Before} method of the test class to use fake factory.
|
||||||
*/
|
*/
|
||||||
public static FakeFeatureFactory setupForTest() {
|
public static FakeFeatureFactory setupForTest() {
|
||||||
sFactory = new FakeFeatureFactory();
|
FakeFeatureFactory factory = new FakeFeatureFactory();
|
||||||
return (FakeFeatureFactory) sFactory;
|
setFactory(getAppContext(), factory);
|
||||||
|
return factory;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user