Clean up FeatureFactory.getFeature()

Bug: 286764889
Test: m Settings
Change-Id: I7e472e6b0ca6b7a735c1b92742ddf06c545176fc
This commit is contained in:
Chaohui Wang
2023-08-04 15:42:43 +08:00
parent 0062308347
commit 8e2ae547d6
220 changed files with 282 additions and 306 deletions

View File

@@ -84,7 +84,7 @@ public class LockScreenNotificationPreferenceController extends AbstractPreferen
mWorkSettingKey = workSettingKey;
mProfileUserId = Utils.getManagedProfileId(UserManager.get(context), UserHandle.myUserId());
final LockPatternUtils utils = FeatureFactory.getFactory(context)
final LockPatternUtils utils = FeatureFactory.getFeatureFactory()
.getSecurityFeatureProvider()
.getLockPatternUtils(context);
mSecure = utils.isSecure(UserHandle.myUserId());
@@ -278,7 +278,7 @@ public class LockScreenNotificationPreferenceController extends AbstractPreferen
public static int getSummaryResource(Context context) {
final boolean enabled = getLockscreenNotificationsEnabled(context);
final boolean secure = FeatureFactory.getFactory(context)
final boolean secure = FeatureFactory.getFeatureFactory()
.getSecurityFeatureProvider()
.getLockPatternUtils(context)
.isSecure(UserHandle.myUserId());

View File

@@ -130,7 +130,7 @@ public class RedactNotificationPreferenceController extends TogglePreferenceCont
? UserHandle.myUserId() : mProfileUserId;
// hide if lockscreen isn't secure for this user
final LockPatternUtils utils = FeatureFactory.getFactory(mContext)
final LockPatternUtils utils = FeatureFactory.getFeatureFactory()
.getSecurityFeatureProvider()
.getLockPatternUtils(mContext);
if (!utils.isSecure(userId)) {

View File

@@ -68,7 +68,7 @@ abstract public class AbstractZenModePreferenceController extends
mNotificationManager = (NotificationManager) context.getSystemService(
Context.NOTIFICATION_SERVICE);
final FeatureFactory featureFactory = FeatureFactory.getFactory(mContext);
final FeatureFactory featureFactory = FeatureFactory.getFeatureFactory();
mMetricsFeatureProvider = featureFactory.getMetricsFeatureProvider();
mBackend = ZenModeBackend.getInstance(context);
}

View File

@@ -180,7 +180,7 @@ public class ZenOnboardingActivity extends Activity {
private static boolean withinShowTimeThreshold(Context context) {
final SuggestionFeatureProvider featureProvider =
FeatureFactory.getFactory(context).getSuggestionFeatureProvider();
FeatureFactory.getFeatureFactory().getSuggestionFeatureProvider();
final SharedPreferences prefs = featureProvider.getSharedPrefs(context);
final long currentTimeMs = System.currentTimeMillis();
final long firstDisplayTimeMs;