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

Commit d678cdeb authored by Steve Kondik's avatar Steve Kondik
Browse files

settings: Deprecate has_led_flash, move to framework.

 * We need this to configure default tiles in SystemUI so move it.
 * Leave the old one in place so we don't kill every device.

Change-Id: I883f9595f74ab52c8c8152e0105400aaefff4afe
parent bcefa3b5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@

    <!-- **** CYANOGENMOD ADDITIONS START **** -->
    <!-- LED Flashlight -->
    <!-- DEPRECATED!! Use config_enableTorch in framework -->
    <bool name="has_led_flash">false</bool>

    <!-- Home button Wake Support. Some devices do not support this.
+2 −5
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import android.preference.PreferenceScreen;
import android.provider.Settings;
import android.text.TextUtils;

import com.android.internal.util.cm.QSUtils;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.Utils;
@@ -55,10 +56,6 @@ public class LockscreenButtons extends SettingsPreferenceFragment
    private ListPreference mLongMenuAction;
    private ListPreference[] mActions;

    private boolean torchSupported() {
        return getResources().getBoolean(R.bool.has_led_flash);
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
@@ -98,7 +95,7 @@ public class LockscreenButtons extends SettingsPreferenceFragment
            mLongBackAction, mLongHomeAction, mLongMenuAction
        };
        for (ListPreference pref : mActions) {
            if (torchSupported()) {
            if (QSUtils.deviceSupportsTorch(getActivity())) {
                final CharSequence[] oldEntries = pref.getEntries();
                final CharSequence[] oldValues = pref.getEntryValues();
                ArrayList<CharSequence> newEntries = new ArrayList<CharSequence>();
+1 −1
Original line number Diff line number Diff line
@@ -197,7 +197,7 @@ public class QuickSettingsUtil {
        }

        // Don't show the Torch tile if not supported
        if (!context.getResources().getBoolean(R.bool.has_led_flash)) {
        if (!QSUtils.deviceSupportsTorch(context)) {
            removeTile(TILE_TORCH);
        }