Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 107037df authored by Yi-an Chen's avatar Yi-an Chen Committed by Automerger Merge Worker
Browse files

Merge "Fix SafetyProtectionUtils" into udc-dev am: b7793f58 am: 3989cb46

parents ab2b8f5c 3989cb46
Loading
Loading
Loading
Loading
+15 −9
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ public class SafetyProtectionUtils {
     * @hide
     */
    public static boolean shouldShowSafetyProtectionResources(Context context) {
        try {
            return DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_PRIVACY,
                            SAFETY_PROTECTION_RESOURCES_ENABLED, false)
                    && context.getResources().getBoolean(
@@ -47,7 +48,12 @@ public class SafetyProtectionUtils {
                                    .getIdentifier("config_safetyProtectionEnabled",
                                            "bool", "android"))
                    && context.getDrawable(android.R.drawable.ic_safety_protection) != null
                && context.getString(android.R.string.safety_protection_display_text) != null
                && !context.getString(android.R.string.safety_protection_display_text).isEmpty();
                    && !context.getString(
                            android.R.string.safety_protection_display_text).isEmpty();
        } catch (Resources.NotFoundException e) {
            // We should expect the resources to not exist for non-pixel devices
            // (except for the OEMs that opt-in)
            return false;
        }
    }
}