diff options
author | 2024-08-21 15:27:35 +0000 | |
---|---|---|
committer | 2024-08-21 17:43:05 +0000 | |
commit | 04eb98b1a8bf93dac7482a5a51110c4e13f5a238 (patch) | |
tree | affe624cc1fc2ab5bd602f93317793a4007a4205 /service/java | |
parent | 774de14fcd52ce1f9f2faeb0682ca9ae7cb7e1a6 (diff) |
Fix SafetyCenterEnabledChanged broadcasts tests when device config flag not in use.
Bug: 361281194
Bug: 354670125
Test: atest CtsSafetyCenterTestCases
Relnote: Fixing tests after removing Safety Center device config flag
Flag: com.android.permission.flags.safety_center_enabled_no_device_config
LOW_COVERAGE_REASON=b/360423897
Change-Id: I491977e7499ab5d42688a375de0f3afb301286de
Diffstat (limited to 'service/java')
-rw-r--r-- | service/java/com/android/safetycenter/SafetyCenterService.java | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/service/java/com/android/safetycenter/SafetyCenterService.java b/service/java/com/android/safetycenter/SafetyCenterService.java index c9a5e1c03..250be5f25 100644 --- a/service/java/com/android/safetycenter/SafetyCenterService.java +++ b/service/java/com/android/safetycenter/SafetyCenterService.java @@ -244,6 +244,9 @@ public final class SafetyCenterService extends SystemService { @GuardedBy("mApiLock") private void registerSafetyCenterEnabledListenerLocked() { + if (Flags.safetyCenterEnabledNoDeviceConfig() && SdkLevel.isAtLeastU()) { + return; + } SafetyCenterEnabledListener safetyCenterEnabledListener = new SafetyCenterEnabledListener(); DeviceConfig.addOnPropertiesChangedListener( DeviceConfig.NAMESPACE_PRIVACY, @@ -1151,9 +1154,7 @@ public final class SafetyCenterService extends SystemService { if (!UserProfileGroup.isSupported(userId, context)) { Log.i( TAG, - "Received broadcast for user id: " - + userId - + ", which is an unsupported user"); + "Received broadcast for user id: " + userId + ", which is an unsupported user"); return false; } if (Intent.ACTION_USER_SWITCHED.equals(action) @@ -1166,11 +1167,7 @@ public final class SafetyCenterService extends SystemService { return false; } if (isProfileAddedOrAvailable(action) && !UserUtils.isUserExistent(userId, context)) { - Log.w( - TAG, - "Received broadcast for user id: " - + userId - + ", which does not exist"); + Log.w(TAG, "Received broadcast for user id: " + userId + ", which does not exist"); return false; } return true; |