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

Commit 20385d8a authored by Roman Birg's avatar Roman Birg
Browse files

Settings: hide keyguard visualizer toggle on low end gfx devices



The visualizer is disabled on low end gfx devices

Change-Id: I67178f59baa18fe7586bb08835f9f255c31f84f6
Signed-off-by: default avatarRoman Birg <roman@cyngn.com>
parent 869d79b3
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.settings.lockscreen;

import android.app.Activity;
import android.app.ActivityManager;
import android.app.admin.DevicePolicyManager;
import android.content.Context;
import android.content.Intent;
@@ -69,6 +70,7 @@ public class LockScreenSettings extends SettingsPreferenceFragment
    private static final String KEY_POWER_INSTANTLY_LOCKS = "power_button_instantly_locks";
    private static final String KEY_TRUST_AGENT = "trust_agent";
    private static final String KEY_MANAGE_TRUST_AGENTS = "manage_trust_agents";
    private static final String KEY_SHOW_VISUALIZER = "lockscreen_visualizer";

    private static final int SET_OR_CHANGE_LOCK_METHOD_REQUEST = 123;
    private static final int CONFIRM_EXISTING_FOR_BIOMETRIC_WEAK_IMPROVE_REQUEST = 124;
@@ -196,6 +198,15 @@ public class LockScreenSettings extends SettingsPreferenceFragment
            }
        }

        // remove lockscreen visualizer option on low end gfx devices
        if (!ActivityManager.isHighEndGfx() && securityCategory != null) {
            SwitchPreference displayVisualizer = (SwitchPreference)
                    securityCategory.findPreference(KEY_SHOW_VISUALIZER);
            if (displayVisualizer != null) {
                securityCategory.removePreference(displayVisualizer);
            }
        }

        // Trust Agent preferences
        if (securityCategory != null) {
            final boolean hasSecurity = mLockPatternUtils.isSecure();
@@ -557,6 +568,11 @@ public class LockScreenSettings extends SettingsPreferenceFragment
                keys.add(KEY_MANAGE_TRUST_AGENTS);
            }

            // hidden on low end gfx devices.
            if (!ActivityManager.isHighEndGfx()) {
                keys.add(KEY_SHOW_VISUALIZER);
            }

            return keys;
        }
    }