Loading packages/SystemUI/src/com/android/systemui/flags/FeatureFlags.java +3 −28 Original line number Diff line number Diff line Loading @@ -18,8 +18,6 @@ package com.android.systemui.flags; import android.content.Context; import android.util.FeatureFlagUtils; import android.util.Log; import android.widget.Toast; import com.android.systemui.dagger.SysUISingleton; Loading @@ -33,12 +31,10 @@ import javax.inject.Inject; @SysUISingleton public class FeatureFlags { private final FlagReader mFlagReader; private final Context mContext; @Inject public FeatureFlags(FlagReader flagReader, Context context) { public FeatureFlags(FlagReader flagReader) { mFlagReader = flagReader; mContext = context; } /** Loading @@ -49,22 +45,6 @@ public class FeatureFlags { return mFlagReader.isEnabled(flag); } public void assertLegacyPipelineEnabled() { if (isNewNotifPipelineRenderingEnabled()) { throw new IllegalStateException("Old pipeline code running w/ new pipeline enabled"); } } public boolean checkLegacyPipelineEnabled() { if (!isNewNotifPipelineRenderingEnabled()) { return true; } Log.d("NotifPipeline", "Old pipeline code running w/ new pipeline enabled", new Exception()); Toast.makeText(mContext, "Old pipeline code running!", Toast.LENGTH_SHORT).show(); return false; } public boolean isNewNotifPipelineRenderingEnabled() { return isEnabled(Flags.NEW_NOTIFICATION_PIPELINE_RENDERING); } Loading Loading @@ -129,8 +109,8 @@ public class FeatureFlags { } /** System setting for provider model behavior */ public boolean isProviderModelSettingEnabled() { return FeatureFlagUtils.isEnabled(mContext, FeatureFlagUtils.SETTINGS_PROVIDER_MODEL); public boolean isProviderModelSettingEnabled(Context context) { return FeatureFlagUtils.isEnabled(context, FeatureFlagUtils.SETTINGS_PROVIDER_MODEL); } /** Loading @@ -146,9 +126,4 @@ public class FeatureFlags { public boolean useCombinedQSHeaders() { return isEnabled(Flags.COMBINED_QS_HEADERS); } /** static method for the system setting */ public static boolean isProviderModelSettingEnabled(Context context) { return FeatureFlagUtils.isEnabled(context, FeatureFlagUtils.SETTINGS_PROVIDER_MODEL); } } packages/SystemUI/src/com/android/systemui/flags/Flags.java +3 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,9 @@ public class Flags { /***************************************/ // 600- status bar public static final BooleanFlag STATUS_BAR_PROVIDER_MODEL = new BooleanFlag(600, false); public static final BooleanFlag COMBINED_STATUS_BAR_SIGNAL_ICONS = new BooleanFlag(601, false); Loading packages/SystemUI/src/com/android/systemui/qs/QSTileHost.java +1 −1 Original line number Diff line number Diff line Loading @@ -536,7 +536,7 @@ public class QSTileHost implements QSHost, Tunable, PluginListener<QSFactory>, D } } } if (featureFlags.isProviderModelSettingEnabled()) { if (featureFlags.isProviderModelSettingEnabled(context)) { if (!tiles.contains("internet")) { if (tiles.contains("wifi")) { // Replace the WiFi with Internet, and remove the Cell Loading packages/SystemUI/src/com/android/systemui/qs/customize/TileQueryHelper.java +1 −1 Original line number Diff line number Diff line Loading @@ -121,7 +121,7 @@ public class TileQueryHelper { } final ArrayList<QSTile> tilesToAdd = new ArrayList<>(); if (mFeatureFlags.isProviderModelSettingEnabled()) { if (mFeatureFlags.isProviderModelSettingEnabled(mContext)) { possibleTiles.remove("cell"); possibleTiles.remove("wifi"); } Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationViewHierarchyManager.java +10 −4 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import com.android.systemui.statusbar.dagger.StatusBarModule; import com.android.systemui.statusbar.notification.AssistantFeedbackController; import com.android.systemui.statusbar.notification.DynamicChildBindController; import com.android.systemui.statusbar.notification.DynamicPrivacyController; import com.android.systemui.statusbar.notification.NotifPipelineFlags; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.legacy.LowPriorityInflationHelper; Loading Loading @@ -91,6 +92,7 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle private final DynamicPrivacyController mDynamicPrivacyController; private final KeyguardBypassController mBypassController; private final ForegroundServiceSectionController mFgsSectionController; private final NotifPipelineFlags mNotifPipelineFlags; private AssistantFeedbackController mAssistantFeedbackController; private final Context mContext; Loading Loading @@ -121,7 +123,8 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle ForegroundServiceSectionController fgsSectionController, DynamicChildBindController dynamicChildBindController, LowPriorityInflationHelper lowPriorityInflationHelper, AssistantFeedbackController assistantFeedbackController) { AssistantFeedbackController assistantFeedbackController, NotifPipelineFlags notifPipelineFlags) { mContext = context; mHandler = mainHandler; mFeatureFlags = featureFlags; Loading @@ -132,6 +135,7 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle mStatusBarStateController = (SysuiStatusBarStateController) statusBarStateController; mEntryManager = notificationEntryManager; mFgsSectionController = fgsSectionController; mNotifPipelineFlags = notifPipelineFlags; Resources res = context.getResources(); mAlwaysExpandNonGroupedNotification = res.getBoolean(R.bool.config_alwaysExpandNonGroupedNotifications); Loading @@ -157,7 +161,7 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle //TODO: Rewrite this to focus on Entries, or some other data object instead of views public void updateNotificationViews() { Assert.isMainThread(); if (!mFeatureFlags.checkLegacyPipelineEnabled()) { if (!mNotifPipelineFlags.checkLegacyPipelineEnabled()) { return; } Loading Loading @@ -435,7 +439,7 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle */ public void updateRowStates() { Assert.isMainThread(); if (!mFeatureFlags.checkLegacyPipelineEnabled()) { if (!mNotifPipelineFlags.checkLegacyPipelineEnabled()) { return; } Loading Loading @@ -524,7 +528,9 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle @Override public void onDynamicPrivacyChanged() { mFeatureFlags.assertLegacyPipelineEnabled(); if (mFeatureFlags.isNewNotifPipelineRenderingEnabled()) { throw new IllegalStateException("Old pipeline code running w/ new pipeline enabled"); } if (mPerformingUpdate) { Log.w(TAG, "onDynamicPrivacyChanged made a re-entrant call"); } Loading Loading
packages/SystemUI/src/com/android/systemui/flags/FeatureFlags.java +3 −28 Original line number Diff line number Diff line Loading @@ -18,8 +18,6 @@ package com.android.systemui.flags; import android.content.Context; import android.util.FeatureFlagUtils; import android.util.Log; import android.widget.Toast; import com.android.systemui.dagger.SysUISingleton; Loading @@ -33,12 +31,10 @@ import javax.inject.Inject; @SysUISingleton public class FeatureFlags { private final FlagReader mFlagReader; private final Context mContext; @Inject public FeatureFlags(FlagReader flagReader, Context context) { public FeatureFlags(FlagReader flagReader) { mFlagReader = flagReader; mContext = context; } /** Loading @@ -49,22 +45,6 @@ public class FeatureFlags { return mFlagReader.isEnabled(flag); } public void assertLegacyPipelineEnabled() { if (isNewNotifPipelineRenderingEnabled()) { throw new IllegalStateException("Old pipeline code running w/ new pipeline enabled"); } } public boolean checkLegacyPipelineEnabled() { if (!isNewNotifPipelineRenderingEnabled()) { return true; } Log.d("NotifPipeline", "Old pipeline code running w/ new pipeline enabled", new Exception()); Toast.makeText(mContext, "Old pipeline code running!", Toast.LENGTH_SHORT).show(); return false; } public boolean isNewNotifPipelineRenderingEnabled() { return isEnabled(Flags.NEW_NOTIFICATION_PIPELINE_RENDERING); } Loading Loading @@ -129,8 +109,8 @@ public class FeatureFlags { } /** System setting for provider model behavior */ public boolean isProviderModelSettingEnabled() { return FeatureFlagUtils.isEnabled(mContext, FeatureFlagUtils.SETTINGS_PROVIDER_MODEL); public boolean isProviderModelSettingEnabled(Context context) { return FeatureFlagUtils.isEnabled(context, FeatureFlagUtils.SETTINGS_PROVIDER_MODEL); } /** Loading @@ -146,9 +126,4 @@ public class FeatureFlags { public boolean useCombinedQSHeaders() { return isEnabled(Flags.COMBINED_QS_HEADERS); } /** static method for the system setting */ public static boolean isProviderModelSettingEnabled(Context context) { return FeatureFlagUtils.isEnabled(context, FeatureFlagUtils.SETTINGS_PROVIDER_MODEL); } }
packages/SystemUI/src/com/android/systemui/flags/Flags.java +3 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,9 @@ public class Flags { /***************************************/ // 600- status bar public static final BooleanFlag STATUS_BAR_PROVIDER_MODEL = new BooleanFlag(600, false); public static final BooleanFlag COMBINED_STATUS_BAR_SIGNAL_ICONS = new BooleanFlag(601, false); Loading
packages/SystemUI/src/com/android/systemui/qs/QSTileHost.java +1 −1 Original line number Diff line number Diff line Loading @@ -536,7 +536,7 @@ public class QSTileHost implements QSHost, Tunable, PluginListener<QSFactory>, D } } } if (featureFlags.isProviderModelSettingEnabled()) { if (featureFlags.isProviderModelSettingEnabled(context)) { if (!tiles.contains("internet")) { if (tiles.contains("wifi")) { // Replace the WiFi with Internet, and remove the Cell Loading
packages/SystemUI/src/com/android/systemui/qs/customize/TileQueryHelper.java +1 −1 Original line number Diff line number Diff line Loading @@ -121,7 +121,7 @@ public class TileQueryHelper { } final ArrayList<QSTile> tilesToAdd = new ArrayList<>(); if (mFeatureFlags.isProviderModelSettingEnabled()) { if (mFeatureFlags.isProviderModelSettingEnabled(mContext)) { possibleTiles.remove("cell"); possibleTiles.remove("wifi"); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationViewHierarchyManager.java +10 −4 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import com.android.systemui.statusbar.dagger.StatusBarModule; import com.android.systemui.statusbar.notification.AssistantFeedbackController; import com.android.systemui.statusbar.notification.DynamicChildBindController; import com.android.systemui.statusbar.notification.DynamicPrivacyController; import com.android.systemui.statusbar.notification.NotifPipelineFlags; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.legacy.LowPriorityInflationHelper; Loading Loading @@ -91,6 +92,7 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle private final DynamicPrivacyController mDynamicPrivacyController; private final KeyguardBypassController mBypassController; private final ForegroundServiceSectionController mFgsSectionController; private final NotifPipelineFlags mNotifPipelineFlags; private AssistantFeedbackController mAssistantFeedbackController; private final Context mContext; Loading Loading @@ -121,7 +123,8 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle ForegroundServiceSectionController fgsSectionController, DynamicChildBindController dynamicChildBindController, LowPriorityInflationHelper lowPriorityInflationHelper, AssistantFeedbackController assistantFeedbackController) { AssistantFeedbackController assistantFeedbackController, NotifPipelineFlags notifPipelineFlags) { mContext = context; mHandler = mainHandler; mFeatureFlags = featureFlags; Loading @@ -132,6 +135,7 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle mStatusBarStateController = (SysuiStatusBarStateController) statusBarStateController; mEntryManager = notificationEntryManager; mFgsSectionController = fgsSectionController; mNotifPipelineFlags = notifPipelineFlags; Resources res = context.getResources(); mAlwaysExpandNonGroupedNotification = res.getBoolean(R.bool.config_alwaysExpandNonGroupedNotifications); Loading @@ -157,7 +161,7 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle //TODO: Rewrite this to focus on Entries, or some other data object instead of views public void updateNotificationViews() { Assert.isMainThread(); if (!mFeatureFlags.checkLegacyPipelineEnabled()) { if (!mNotifPipelineFlags.checkLegacyPipelineEnabled()) { return; } Loading Loading @@ -435,7 +439,7 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle */ public void updateRowStates() { Assert.isMainThread(); if (!mFeatureFlags.checkLegacyPipelineEnabled()) { if (!mNotifPipelineFlags.checkLegacyPipelineEnabled()) { return; } Loading Loading @@ -524,7 +528,9 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle @Override public void onDynamicPrivacyChanged() { mFeatureFlags.assertLegacyPipelineEnabled(); if (mFeatureFlags.isNewNotifPipelineRenderingEnabled()) { throw new IllegalStateException("Old pipeline code running w/ new pipeline enabled"); } if (mPerformingUpdate) { Log.w(TAG, "onDynamicPrivacyChanged made a re-entrant call"); } Loading