Merge "Applies feature flag on Flash Notifications" into udc-dev am: 95d82c46cf

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21507347

Change-Id: I9682dffd1927e7c0a4844b3ba05d2079ae2022fe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Angela Wang
2023-03-02 02:04:34 +00:00
committed by Automerger Merge Worker
2 changed files with 8 additions and 5 deletions

View File

@@ -164,10 +164,10 @@ public class FeatureFlagUtils {
*/
public static final String SETTINGS_AUDIO_ROUTING = "settings_audio_routing";
/** Flag to enable/disable flash alerts
/** Flag to enable/disable flash notifications
* @hide
*/
public static final String SETTINGS_FLASH_ALERTS = "settings_flash_alerts";
public static final String SETTINGS_FLASH_NOTIFICATIONS = "settings_flash_notifications";
/**
* Flag to disable/enable showing udfps enroll view in settings. If it's disabled, udfps enroll
@@ -232,7 +232,7 @@ public class FeatureFlagUtils {
DEFAULT_FLAGS.put(SETTINGS_ACCESSIBILITY_HEARING_AID_PAGE, "false");
DEFAULT_FLAGS.put(SETTINGS_PREFER_ACCESSIBILITY_MENU_IN_SYSTEM, "false");
DEFAULT_FLAGS.put(SETTINGS_AUDIO_ROUTING, "false");
DEFAULT_FLAGS.put(SETTINGS_FLASH_ALERTS, "false");
DEFAULT_FLAGS.put(SETTINGS_FLASH_NOTIFICATIONS, "true");
DEFAULT_FLAGS.put(SETTINGS_SHOW_UDFPS_ENROLL_IN_SETTINGS, "true");
DEFAULT_FLAGS.put(SETTINGS_ENABLE_LOCKSCREEN_TRANSFER_API, "false");
DEFAULT_FLAGS.put(SETTINGS_REMOTE_DEVICE_CREDENTIAL_VALIDATION, "false");

View File

@@ -53,6 +53,7 @@ import android.os.RemoteException;
import android.os.SystemClock;
import android.os.UserHandle;
import android.provider.Settings;
import android.util.FeatureFlagUtils;
import android.util.Log;
import android.view.Display;
import android.view.View;
@@ -342,10 +343,12 @@ class FlashNotificationsController {
private void requestStartFlashNotification(FlashNotification flashNotification) {
if (DEBUG) Log.d(LOG_TAG, "requestStartFlashNotification");
mIsCameraFlashNotificationEnabled = Settings.System.getIntForUser(
boolean isFeatureOn = FeatureFlagUtils.isEnabled(mContext,
FeatureFlagUtils.SETTINGS_FLASH_NOTIFICATIONS);
mIsCameraFlashNotificationEnabled = isFeatureOn && Settings.System.getIntForUser(
mContext.getContentResolver(), SETTING_KEY_CAMERA_FLASH_NOTIFICATION, 0,
UserHandle.USER_CURRENT) != 0;
mIsScreenFlashNotificationEnabled = Settings.System.getIntForUser(
mIsScreenFlashNotificationEnabled = isFeatureOn && Settings.System.getIntForUser(
mContext.getContentResolver(), SETTING_KEY_SCREEN_FLASH_NOTIFICATION, 0,
UserHandle.USER_CURRENT) != 0;