OmniControl: remove not ported features for bringup 14
We will add back step by step.
Change-Id: Iba8b5ebab9e1919b19a72c4142db598c91258866
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index a2d7c21..3a6d748 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -7,6 +7,7 @@
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
+ <option name="gradleJvm" value="1.8" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml
deleted file mode 100644
index f4c45ba..0000000
--- a/.idea/kotlinc.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
- <component name="KotlinJpsPluginSettings">
- <option name="version" value="1.8.20-release" />
- </component>
-</project>
\ No newline at end of file
diff --git a/app/src/main/java/org/omnirom/control/BatteryLightSettingsFragment.java b/app/src/main/java/org/omnirom/control/BatteryLightSettingsFragment.java
index a67d5c3..08ddd7a 100644
--- a/app/src/main/java/org/omnirom/control/BatteryLightSettingsFragment.java
+++ b/app/src/main/java/org/omnirom/control/BatteryLightSettingsFragment.java
@@ -1,246 +1,246 @@
-/*
- * Copyright (C) 2012 The CyanogenMod Project
- * Copyright (C) 2021 The OmniROM Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.omnirom.control;
-
-import android.content.ContentResolver;
-import android.content.Context;
-import android.content.res.Resources;
-import android.os.Bundle;
-import android.os.UserHandle;
-import android.provider.Settings;
-
-import androidx.annotation.DrawableRes;
-import androidx.annotation.XmlRes;
-import androidx.preference.Preference;
-import androidx.preference.PreferenceGroup;
-import androidx.preference.PreferenceScreen;
-
-import org.omnirom.control.R;
-import org.omnirom.omnilib.preference.SystemSettingsColorSelectPreference;
-import org.omnirom.omnilib.preference.SystemSettingSwitchPreference;
-
-public class BatteryLightSettingsFragment extends AbstractSettingsFragment implements
- Preference.OnPreferenceChangeListener {
-
- private static final String DEFAULT_VALUES = "reset_to_default_key";
- private static final String LOW_COLOR_PREF = "battery_light_low_color";
- private static final String MEDIUM_COLOR_PREF = "battery_light_medium_color";
- private static final String FULL_COLOR_PREF = "battery_light_full_color";
- private static final String REALLY_FULL_COLOR_PREF = "battery_light_really_full_color";
- private static final String FAST_COLOR_PREF = "fast_battery_light_color";
- private static final String FAST_CHARGING_LED_PREF = "fast_charging_led_enabled";
- private static final String BATTERY_DND_PREF = "battery_light_allow_on_dnd";
- private static final String BATTERY_LIGHT_PREF = "battery_light_enabled";
- private static final String BATTERY_PULSE_PREF = "battery_light_pulse";
- private static final String BATTERY_LIGHT_ONLY_FULL_PREF = "battery_light_only_fully_charged";
- private static final String KEY_CATEGORY_FAST_CHARGE = "fast_color_cat";
- private static final String KEY_CATEGORY_CHARGE_COLORS = "colors_list";
-
- private SystemSettingsColorSelectPreference mLowColorPref;
- private SystemSettingsColorSelectPreference mMediumColorPref;
- private SystemSettingsColorSelectPreference mFullColorPref;
- private SystemSettingsColorSelectPreference mReallyFullColorPref;
- private SystemSettingsColorSelectPreference mFastColorPref;
- private Preference mDefaultValues;
- private SystemSettingSwitchPreference mDndPref;
- private SystemSettingSwitchPreference mEnabledPref;
- private SystemSettingSwitchPreference mPulsePref;
- private SystemSettingSwitchPreference mOnlyFullPref;
- private SystemSettingSwitchPreference mFastBatteryLightEnabledPref;
-
- public static final @DrawableRes int ICON_RES = R.drawable.ic_settings_leds;
- public static final @XmlRes int XML_RES = R.xml.battery_light_settings_preferences;
-
- public static boolean isEnabled(Context context) {
- return context.getResources().getBoolean(com.android.internal.R.bool.config_intrusiveBatteryLed);
- }
-
- @Override
- public String getFragmentTitle() {
- return getString(R.string.batterylight_title);
- }
-
- @Override
- public String getFragmentSummary() {
- return getString(R.string.batterylight_summary);
- }
-
- @Override
- public int getFragmentIcon() {
- return ICON_RES;
- }
-
- @Override
- public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
- setPreferencesFromResource(XML_RES, rootKey);
-
- PreferenceScreen prefSet = getPreferenceScreen();
- ContentResolver resolver = getContext().getContentResolver();
- Resources res = getResources();
-
- mDefaultValues = (Preference) findPreference(DEFAULT_VALUES);
- mDefaultValues.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
- @Override
- public boolean onPreferenceClick(Preference preference) {
- resetToDefaults();
- return true;
- }
- });
-
- mDndPref = (SystemSettingSwitchPreference) findPreference(BATTERY_DND_PREF);
- mEnabledPref = (SystemSettingSwitchPreference) findPreference(BATTERY_LIGHT_PREF);
- mPulsePref = (SystemSettingSwitchPreference) findPreference(BATTERY_PULSE_PREF);
- mOnlyFullPref = (SystemSettingSwitchPreference) findPreference(BATTERY_LIGHT_ONLY_FULL_PREF);
- mOnlyFullPref.setOnPreferenceChangeListener(this);
-
- // Does the Device support changing battery LED colors?
- if (getResources().getBoolean(R.bool.config_multiColorBatteryLed)) {
-
- mFastBatteryLightEnabledPref = (SystemSettingSwitchPreference) findPreference(FAST_CHARGING_LED_PREF);
-
- // Low, Medium and full color preferences
- mLowColorPref = (SystemSettingsColorSelectPreference) findPreference(LOW_COLOR_PREF);
- mLowColorPref.setDefaultValue(res.getInteger(com.android.internal.R.integer.config_notificationsBatteryLowARGB));
-
- mMediumColorPref = (SystemSettingsColorSelectPreference) findPreference(MEDIUM_COLOR_PREF);
- mMediumColorPref.setDefaultValue(res.getInteger(com.android.internal.R.integer.config_notificationsBatteryMediumARGB));
-
- mFullColorPref = (SystemSettingsColorSelectPreference) findPreference(FULL_COLOR_PREF);
- mFullColorPref.setDefaultValue(res.getInteger(com.android.internal.R.integer.config_notificationsBatteryFullARGB));
-
- mReallyFullColorPref = (SystemSettingsColorSelectPreference) findPreference(REALLY_FULL_COLOR_PREF);
- mReallyFullColorPref.setDefaultValue(res.getInteger(com.android.internal.R.integer.config_notificationsBatteryFullARGB));
-
- mFastColorPref = (SystemSettingsColorSelectPreference) findPreference(FAST_COLOR_PREF);
- mFastColorPref.setDefaultValue(res.getInteger(com.android.internal.R.integer.config_notificationsFastBatteryARGB));
-
- // Does the Device support fast charge ?
- if (!getResources().getBoolean(R.bool.config_FastChargingLedSupported)) {
- prefSet.removePreference(prefSet.findPreference(KEY_CATEGORY_FAST_CHARGE));
- }
- } else {
- prefSet.removePreference(prefSet.findPreference(KEY_CATEGORY_CHARGE_COLORS));
- // not multi color cant have fast charge
- prefSet.removePreference(prefSet.findPreference(KEY_CATEGORY_FAST_CHARGE));
- }
- boolean showOnlyWhenFull = Settings.System.getInt(resolver,
- Settings.System.OMNI_BATTERY_LIGHT_ONLY_FULLY_CHARGED, 1) != 0;
- updateEnablement(showOnlyWhenFull);
- }
-
- @Override
- public void onResume() {
- super.onResume();
- refreshDefault();
- }
-
- @Override
- public boolean onPreferenceChange(Preference preference, Object objValue) {
- if (preference == mOnlyFullPref) {
- boolean value = (Boolean) objValue;
- // If enabled, disable all but really full color preference.
- updateEnablement(value);
- }
- return true;
- }
-
- private void updateEnablement(boolean showOnlyWhenFull) {
- // If enabled, disable all but really full color preference.
- if (mLowColorPref != null) {
- mLowColorPref.setEnabled(!showOnlyWhenFull);
- }
- if (mMediumColorPref != null) {
- mMediumColorPref.setEnabled(!showOnlyWhenFull);
- }
- if (mFullColorPref != null) {
- mFullColorPref.setEnabled(!showOnlyWhenFull);
- }
- if (mFastColorPref != null) {
- mFastColorPref.setEnabled(!showOnlyWhenFull);
- }
- if (mFastBatteryLightEnabledPref != null) {
- mFastBatteryLightEnabledPref.setEnabled(!showOnlyWhenFull);
- }
- }
-
- protected void resetToDefaults() {
- if (mDndPref != null) {
- mDndPref.setChecked(false);
- }
- if (mEnabledPref != null) {
- mEnabledPref.setChecked(true);
- }
- if (mPulsePref != null) {
- mPulsePref.setChecked(false);
- }
- if (mOnlyFullPref != null) {
- mOnlyFullPref.setChecked(false);
- }
- if (mFastBatteryLightEnabledPref != null) {
- mFastBatteryLightEnabledPref.setChecked(false);
- }
- resetColors();
- boolean showOnlyWhenFull = Settings.System.getInt(getContext().getContentResolver(),
- Settings.System.OMNI_BATTERY_LIGHT_ONLY_FULLY_CHARGED, 1) != 0;
- updateEnablement(showOnlyWhenFull);
- }
-
- protected void resetColors() {
- if (mLowColorPref != null) {
- mLowColorPref.resetToDefaultValue();
- }
-
- if (mMediumColorPref != null) {
- mMediumColorPref.resetToDefaultValue();
- }
-
- if (mFullColorPref != null) {
- mFullColorPref.resetToDefaultValue();
- }
-
- if (mReallyFullColorPref != null) {
- mReallyFullColorPref.resetToDefaultValue();
- }
-
- if (mFastColorPref != null) {
- mFastColorPref.resetToDefaultValue();
- }
- }
-
- private void refreshDefault() {
- if (mLowColorPref != null) {
- mLowColorPref.updateColor();
- }
-
- if (mMediumColorPref != null) {
- mMediumColorPref.updateColor();
- }
-
- if (mFullColorPref != null) {
- mFullColorPref.updateColor();
- }
-
- if (mReallyFullColorPref != null) {
- mReallyFullColorPref.updateColor();
- }
-
- if (mFastColorPref != null) {
- mFastColorPref.updateColor();
- }
- }
-}
+///*
+// * Copyright (C) 2012 The CyanogenMod Project
+// * Copyright (C) 2021 The OmniROM Project
+// *
+// * Licensed under the Apache License, Version 2.0 (the "License");
+// * you may not use this file except in compliance with the License.
+// * You may obtain a copy of the License at
+// *
+// * http://www.apache.org/licenses/LICENSE-2.0
+// *
+// * Unless required by applicable law or agreed to in writing, software
+// * distributed under the License is distributed on an "AS IS" BASIS,
+// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// * See the License for the specific language governing permissions and
+// * limitations under the License.
+// */
+//
+//package org.omnirom.control;
+//
+//import android.content.ContentResolver;
+//import android.content.Context;
+//import android.content.res.Resources;
+//import android.os.Bundle;
+//import android.os.UserHandle;
+//import android.provider.Settings;
+//
+//import androidx.annotation.DrawableRes;
+//import androidx.annotation.XmlRes;
+//import androidx.preference.Preference;
+//import androidx.preference.PreferenceGroup;
+//import androidx.preference.PreferenceScreen;
+//
+//import org.omnirom.control.R;
+//import org.omnirom.omnilib.preference.SystemSettingsColorSelectPreference;
+//import org.omnirom.omnilib.preference.SystemSettingSwitchPreference;
+//
+//public class BatteryLightSettingsFragment extends AbstractSettingsFragment implements
+// Preference.OnPreferenceChangeListener {
+//
+// private static final String DEFAULT_VALUES = "reset_to_default_key";
+// private static final String LOW_COLOR_PREF = "battery_light_low_color";
+// private static final String MEDIUM_COLOR_PREF = "battery_light_medium_color";
+// private static final String FULL_COLOR_PREF = "battery_light_full_color";
+// private static final String REALLY_FULL_COLOR_PREF = "battery_light_really_full_color";
+// private static final String FAST_COLOR_PREF = "fast_battery_light_color";
+// private static final String FAST_CHARGING_LED_PREF = "fast_charging_led_enabled";
+// private static final String BATTERY_DND_PREF = "battery_light_allow_on_dnd";
+// private static final String BATTERY_LIGHT_PREF = "battery_light_enabled";
+// private static final String BATTERY_PULSE_PREF = "battery_light_pulse";
+// private static final String BATTERY_LIGHT_ONLY_FULL_PREF = "battery_light_only_fully_charged";
+// private static final String KEY_CATEGORY_FAST_CHARGE = "fast_color_cat";
+// private static final String KEY_CATEGORY_CHARGE_COLORS = "colors_list";
+//
+// private SystemSettingsColorSelectPreference mLowColorPref;
+// private SystemSettingsColorSelectPreference mMediumColorPref;
+// private SystemSettingsColorSelectPreference mFullColorPref;
+// private SystemSettingsColorSelectPreference mReallyFullColorPref;
+// private SystemSettingsColorSelectPreference mFastColorPref;
+// private Preference mDefaultValues;
+// private SystemSettingSwitchPreference mDndPref;
+// private SystemSettingSwitchPreference mEnabledPref;
+// private SystemSettingSwitchPreference mPulsePref;
+// private SystemSettingSwitchPreference mOnlyFullPref;
+// private SystemSettingSwitchPreference mFastBatteryLightEnabledPref;
+//
+// public static final @DrawableRes int ICON_RES = R.drawable.ic_settings_leds;
+// public static final @XmlRes int XML_RES = R.xml.battery_light_settings_preferences;
+//
+// public static boolean isEnabled(Context context) {
+// return context.getResources().getBoolean(com.android.internal.R.bool.config_intrusiveBatteryLed);
+// }
+//
+// @Override
+// public String getFragmentTitle() {
+// return getString(R.string.batterylight_title);
+// }
+//
+// @Override
+// public String getFragmentSummary() {
+// return getString(R.string.batterylight_summary);
+// }
+//
+// @Override
+// public int getFragmentIcon() {
+// return ICON_RES;
+// }
+//
+// @Override
+// public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
+// setPreferencesFromResource(XML_RES, rootKey);
+//
+// PreferenceScreen prefSet = getPreferenceScreen();
+// ContentResolver resolver = getContext().getContentResolver();
+// Resources res = getResources();
+//
+// mDefaultValues = (Preference) findPreference(DEFAULT_VALUES);
+// mDefaultValues.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
+// @Override
+// public boolean onPreferenceClick(Preference preference) {
+// resetToDefaults();
+// return true;
+// }
+// });
+//
+// mDndPref = (SystemSettingSwitchPreference) findPreference(BATTERY_DND_PREF);
+// mEnabledPref = (SystemSettingSwitchPreference) findPreference(BATTERY_LIGHT_PREF);
+// mPulsePref = (SystemSettingSwitchPreference) findPreference(BATTERY_PULSE_PREF);
+// mOnlyFullPref = (SystemSettingSwitchPreference) findPreference(BATTERY_LIGHT_ONLY_FULL_PREF);
+// mOnlyFullPref.setOnPreferenceChangeListener(this);
+//
+// // Does the Device support changing battery LED colors?
+// if (getResources().getBoolean(R.bool.config_multiColorBatteryLed)) {
+//
+// mFastBatteryLightEnabledPref = (SystemSettingSwitchPreference) findPreference(FAST_CHARGING_LED_PREF);
+//
+// // Low, Medium and full color preferences
+// mLowColorPref = (SystemSettingsColorSelectPreference) findPreference(LOW_COLOR_PREF);
+// mLowColorPref.setDefaultValue(res.getInteger(com.android.internal.R.integer.config_notificationsBatteryLowARGB));
+//
+// mMediumColorPref = (SystemSettingsColorSelectPreference) findPreference(MEDIUM_COLOR_PREF);
+// mMediumColorPref.setDefaultValue(res.getInteger(com.android.internal.R.integer.config_notificationsBatteryMediumARGB));
+//
+// mFullColorPref = (SystemSettingsColorSelectPreference) findPreference(FULL_COLOR_PREF);
+// mFullColorPref.setDefaultValue(res.getInteger(com.android.internal.R.integer.config_notificationsBatteryFullARGB));
+//
+// mReallyFullColorPref = (SystemSettingsColorSelectPreference) findPreference(REALLY_FULL_COLOR_PREF);
+// mReallyFullColorPref.setDefaultValue(res.getInteger(com.android.internal.R.integer.config_notificationsBatteryFullARGB));
+//
+// mFastColorPref = (SystemSettingsColorSelectPreference) findPreference(FAST_COLOR_PREF);
+// mFastColorPref.setDefaultValue(res.getInteger(com.android.internal.R.integer.config_notificationsFastBatteryARGB));
+//
+// // Does the Device support fast charge ?
+// if (!getResources().getBoolean(R.bool.config_FastChargingLedSupported)) {
+// prefSet.removePreference(prefSet.findPreference(KEY_CATEGORY_FAST_CHARGE));
+// }
+// } else {
+// prefSet.removePreference(prefSet.findPreference(KEY_CATEGORY_CHARGE_COLORS));
+// // not multi color cant have fast charge
+// prefSet.removePreference(prefSet.findPreference(KEY_CATEGORY_FAST_CHARGE));
+// }
+// boolean showOnlyWhenFull = Settings.System.getInt(resolver,
+// Settings.System.OMNI_BATTERY_LIGHT_ONLY_FULLY_CHARGED, 1) != 0;
+// updateEnablement(showOnlyWhenFull);
+// }
+//
+// @Override
+// public void onResume() {
+// super.onResume();
+// refreshDefault();
+// }
+//
+// @Override
+// public boolean onPreferenceChange(Preference preference, Object objValue) {
+// if (preference == mOnlyFullPref) {
+// boolean value = (Boolean) objValue;
+// // If enabled, disable all but really full color preference.
+// updateEnablement(value);
+// }
+// return true;
+// }
+//
+// private void updateEnablement(boolean showOnlyWhenFull) {
+// // If enabled, disable all but really full color preference.
+// if (mLowColorPref != null) {
+// mLowColorPref.setEnabled(!showOnlyWhenFull);
+// }
+// if (mMediumColorPref != null) {
+// mMediumColorPref.setEnabled(!showOnlyWhenFull);
+// }
+// if (mFullColorPref != null) {
+// mFullColorPref.setEnabled(!showOnlyWhenFull);
+// }
+// if (mFastColorPref != null) {
+// mFastColorPref.setEnabled(!showOnlyWhenFull);
+// }
+// if (mFastBatteryLightEnabledPref != null) {
+// mFastBatteryLightEnabledPref.setEnabled(!showOnlyWhenFull);
+// }
+// }
+//
+// protected void resetToDefaults() {
+// if (mDndPref != null) {
+// mDndPref.setChecked(false);
+// }
+// if (mEnabledPref != null) {
+// mEnabledPref.setChecked(true);
+// }
+// if (mPulsePref != null) {
+// mPulsePref.setChecked(false);
+// }
+// if (mOnlyFullPref != null) {
+// mOnlyFullPref.setChecked(false);
+// }
+// if (mFastBatteryLightEnabledPref != null) {
+// mFastBatteryLightEnabledPref.setChecked(false);
+// }
+// resetColors();
+// boolean showOnlyWhenFull = Settings.System.getInt(getContext().getContentResolver(),
+// Settings.System.OMNI_BATTERY_LIGHT_ONLY_FULLY_CHARGED, 1) != 0;
+// updateEnablement(showOnlyWhenFull);
+// }
+//
+// protected void resetColors() {
+// if (mLowColorPref != null) {
+// mLowColorPref.resetToDefaultValue();
+// }
+//
+// if (mMediumColorPref != null) {
+// mMediumColorPref.resetToDefaultValue();
+// }
+//
+// if (mFullColorPref != null) {
+// mFullColorPref.resetToDefaultValue();
+// }
+//
+// if (mReallyFullColorPref != null) {
+// mReallyFullColorPref.resetToDefaultValue();
+// }
+//
+// if (mFastColorPref != null) {
+// mFastColorPref.resetToDefaultValue();
+// }
+// }
+//
+// private void refreshDefault() {
+// if (mLowColorPref != null) {
+// mLowColorPref.updateColor();
+// }
+//
+// if (mMediumColorPref != null) {
+// mMediumColorPref.updateColor();
+// }
+//
+// if (mFullColorPref != null) {
+// mFullColorPref.updateColor();
+// }
+//
+// if (mReallyFullColorPref != null) {
+// mReallyFullColorPref.updateColor();
+// }
+//
+// if (mFastColorPref != null) {
+// mFastColorPref.updateColor();
+// }
+// }
+//}
diff --git a/app/src/main/java/org/omnirom/control/FingerprintSettingsFragment.kt b/app/src/main/java/org/omnirom/control/FingerprintSettingsFragment.kt
index 5c5d5b5..82fde8f 100644
--- a/app/src/main/java/org/omnirom/control/FingerprintSettingsFragment.kt
+++ b/app/src/main/java/org/omnirom/control/FingerprintSettingsFragment.kt
@@ -1,283 +1,283 @@
-/*
- * Copyright (C) 2023 The OmniROM Project
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.omnirom.control
-
-import android.app.Activity
-import android.content.ComponentName
-import android.content.Context
-import android.content.Intent
-import android.content.ServiceConnection
-import android.graphics.Bitmap
-import android.graphics.BitmapFactory
-import android.graphics.drawable.BitmapDrawable
-import android.net.Uri
-import android.os.Bundle
-import android.os.IBinder
-import android.provider.MediaStore
-import android.provider.Settings
-import android.util.Log
-import androidx.activity.result.contract.ActivityResultContract
-import androidx.activity.result.contract.ActivityResultContracts
-import androidx.annotation.DrawableRes
-import androidx.annotation.XmlRes
-import androidx.preference.Preference
-import androidx.preference.SwitchPreference
-import com.android.systemui.shared.omni.IOmniSystemUiProxy
-import java.io.File
-import java.io.FileOutputStream
-import java.io.IOException
-
-
-class FingerprintSettingsFragment : AbstractSettingsFragment() {
- private val TAG = "FingerprintSettingsFragment"
- private val FINGERPRINT_CUSTOM_ICON_SELECT = "custom_fingerprint_icon_select"
- private val FINGERPRINT_CUSTOM_ICON_ENABLE = "custom_fingerprint_icon_enable"
- private val UFPSIMAGE_FILE_NAME = "ufpsImage"
-
- companion object {
- @DrawableRes
- val ICON_RES = R.drawable.ic_settings_fingerprint
- @XmlRes
- val XML_RES = R.xml.fingerprint_preferences
-
- fun isEnabled(context: Context) : Boolean {
- return context.resources.getBoolean(R.bool.config_has_udfps)
- }
- }
-
- class PickSinglePhotoContract : ActivityResultContract<Void?, Uri?>() {
- override fun createIntent(context: Context, input: Void?): Intent {
- return Intent(Intent(MediaStore.ACTION_PICK_IMAGES)).apply { type = "image/*" }
- }
-
- override fun parseResult(resultCode: Int, intent: Intent?): Uri? {
- return intent.takeIf { resultCode == Activity.RESULT_OK }?.data
- }
- }
-
- var pickImageLegacy = registerForActivityResult<String, Uri>(
- ActivityResultContracts.GetContent()
- ) { uri: Uri? ->
- if (uri != null) {
- try {
- requireContext().contentResolver.openInputStream(uri).use { inputStream ->
- val bitmap = BitmapFactory.decodeStream(inputStream)
- systemUIProxy?.setUfpsImageBitmap(bitmap)
- savePickerIcon(bitmap)
- }
-
- Settings.System.putString(
- requireContext().contentResolver,
- Settings.System.OMNI_CUSTOM_FP_ICON_UPDATE,
- System.currentTimeMillis().toString()
- )
- } catch (e: Exception) {
- Log.d(TAG, "pickImage", e);
- }
- }
- }
-
- private val pickImage =
- registerForActivityResult(PickSinglePhotoContract()) { uri ->
- Log.d(TAG, "pickImage uri = " + uri)
- if (uri != null) {
- // TODO we should do some check if the image is even a useful one eg size
- try {
- requireContext().contentResolver.openInputStream(uri).use { inputStream ->
- val bitmap = BitmapFactory.decodeStream(inputStream)
- systemUIProxy?.setUfpsImageBitmap(bitmap)
- savePickerIcon(bitmap)
- }
-
- Settings.System.putString(
- requireContext().contentResolver,
- Settings.System.OMNI_CUSTOM_FP_ICON_UPDATE,
- System.currentTimeMillis().toString()
- )
- } catch (e: Exception) {
- Log.d(TAG, "pickImage", e);
- }
- }
- }
-
-
- private val mSystemUIProxyService: ServiceConnection = object : ServiceConnection {
- override fun onServiceConnected(name: ComponentName, service: IBinder) {
- Log.d(
- TAG,
- "onServiceConnected $name $service"
- )
- systemUIProxy = IOmniSystemUiProxy.Stub.asInterface(service)
- }
-
- override fun onServiceDisconnected(name: ComponentName) {
- Log.d(TAG, "onServiceDisconnected $name")
- }
- }
-
- private var mSystemUIProxyBound = false
- private var systemUIProxy: IOmniSystemUiProxy? = null
- private var mFilePicker: Preference? = null
- private var mEnableCustom: SwitchPreference? = null
-
-
- private fun bindSystemUIProxyService() {
- if (!mSystemUIProxyBound) {
- Log.d(TAG, "bindSystemUIProxyService")
- val serviceIntent = Intent("android.intent.action.OMNI_SYSTEMUI_SERVICE")
- .setPackage("com.android.systemui")
- try {
- mSystemUIProxyBound = requireActivity().bindService(
- serviceIntent,
- mSystemUIProxyService,
- Context.BIND_AUTO_CREATE
- )
- } catch (e: SecurityException) {
- Log.e(
- TAG,
- "Unable to bind because of security error",
- e
- )
- }
- }
- }
-
- private fun unbindSystemUIProxyService() {
- if (mSystemUIProxyBound) {
- Log.d(TAG, "unbindSystemUIProxyService")
- requireActivity().unbindService(mSystemUIProxyService)
- mSystemUIProxyBound = false
- }
- }
-
- override fun getFragmentTitle(): String {
- return getString(R.string.fprint_title)
- }
-
- override fun getFragmentSummary(): String {
- return getString(R.string.fprint_summary)
- }
-
- override fun getFragmentIcon(): Int {
- return ICON_RES
- }
-
- override fun onDestroy() {
- super.onDestroy()
- unbindSystemUIProxyService()
- }
-
- override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
- setPreferencesFromResource(XML_RES, rootKey)
-
- mEnableCustom = findPreference<SwitchPreference>(FINGERPRINT_CUSTOM_ICON_ENABLE)
- mEnableCustom?.let {
- it.onPreferenceChangeListener = Preference.OnPreferenceChangeListener { _, newValue ->
- if (newValue as Boolean) {
- if (getCustomImagePath().exists()) {
- enablePickerIcon()
- }
- } else {
- systemUIProxy?.resetUfpsImage()
- }
- true
- }
- }
- mFilePicker = findPreference(FINGERPRINT_CUSTOM_ICON_SELECT)
- mFilePicker?.let {
- bindSystemUIProxyService()
-
- if (getCustomImagePath().exists()) {
- setPickerIcon()
- }
-
- it.onPreferenceClickListener = Preference.OnPreferenceClickListener {
- pickImageLegacy.launch("image/*")
- //pickImage.launch(null)
- true
- }
- }
- }
-
- private fun getCustomImagePath(): File {
- return File(requireContext().filesDir, UFPSIMAGE_FILE_NAME)
- }
-
- private fun setPickerIcon() {
- try {
- val parcelFileDescriptor = requireContext().contentResolver.openFileDescriptor(
- Uri.fromFile(getCustomImagePath()),
- "r"
- )
- parcelFileDescriptor?.let { it ->
- val bitmap = BitmapFactory.decodeFileDescriptor(it.fileDescriptor)
- it.close()
- val d = BitmapDrawable(resources, bitmap)
- mFilePicker?.icon = d
- }
- } catch (e: Exception) {
- Log.e(
- TAG,
- "setPickerIcon",
- e
- )
- }
- }
-
- private fun enablePickerIcon() {
- try {
- val parcelFileDescriptor = requireContext().contentResolver.openFileDescriptor(
- Uri.fromFile(getCustomImagePath()),
- "r"
- )
- parcelFileDescriptor?.let { it ->
- val bitmap = BitmapFactory.decodeFileDescriptor(it.fileDescriptor)
- it.close()
- systemUIProxy?.setUfpsImageBitmap(bitmap)
- }
- } catch (e: Exception) {
- Log.e(
- TAG,
- "setPickerIcon",
- e
- )
- }
- }
-
- private fun savePickerIcon(bitmap: Bitmap) {
- try {
- val fos = FileOutputStream(getCustomImagePath())
- bitmap.compress(Bitmap.CompressFormat.PNG, 90, fos)
- fos.close()
- val d = BitmapDrawable(resources, bitmap)
- mFilePicker?.icon = d
- } catch (e: Exception) {
- Log.e(
- TAG,
- "savePickerIcon",
- e
- )
- }
- }
-
- private fun deletePickerIcon() {
- if (getCustomImagePath().exists()) {
- getCustomImagePath().delete()
- }
- }
-}
\ No newline at end of file
+///*
+// * Copyright (C) 2023 The OmniROM Project
+// *
+// * This program is free software: you can redistribute it and/or modify
+// * it under the terms of the GNU General Public License as published by
+// * the Free Software Foundation, either version 2 of the License, or
+// * (at your option) any later version.
+// *
+// * This program is distributed in the hope that it will be useful,
+// * but WITHOUT ANY WARRANTY; without even the implied warranty of
+// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// * GNU General Public License for more details.
+// *
+// * You should have received a copy of the GNU General Public License
+// * along with this program. If not, see <http://www.gnu.org/licenses/>.
+// *
+// */
+//package org.omnirom.control
+//
+//import android.app.Activity
+//import android.content.ComponentName
+//import android.content.Context
+//import android.content.Intent
+//import android.content.ServiceConnection
+//import android.graphics.Bitmap
+//import android.graphics.BitmapFactory
+//import android.graphics.drawable.BitmapDrawable
+//import android.net.Uri
+//import android.os.Bundle
+//import android.os.IBinder
+//import android.provider.MediaStore
+//import android.provider.Settings
+//import android.util.Log
+//import androidx.activity.result.contract.ActivityResultContract
+//import androidx.activity.result.contract.ActivityResultContracts
+//import androidx.annotation.DrawableRes
+//import androidx.annotation.XmlRes
+//import androidx.preference.Preference
+//import androidx.preference.SwitchPreference
+//import com.android.systemui.shared.omni.IOmniSystemUiProxy
+//import java.io.File
+//import java.io.FileOutputStream
+//import java.io.IOException
+//
+//
+//class FingerprintSettingsFragment : AbstractSettingsFragment() {
+// private val TAG = "FingerprintSettingsFragment"
+// private val FINGERPRINT_CUSTOM_ICON_SELECT = "custom_fingerprint_icon_select"
+// private val FINGERPRINT_CUSTOM_ICON_ENABLE = "custom_fingerprint_icon_enable"
+// private val UFPSIMAGE_FILE_NAME = "ufpsImage"
+//
+// companion object {
+// @DrawableRes
+// val ICON_RES = R.drawable.ic_settings_fingerprint
+// @XmlRes
+// val XML_RES = R.xml.fingerprint_preferences
+//
+// fun isEnabled(context: Context) : Boolean {
+// return context.resources.getBoolean(R.bool.config_has_udfps)
+// }
+// }
+//
+// class PickSinglePhotoContract : ActivityResultContract<Void?, Uri?>() {
+// override fun createIntent(context: Context, input: Void?): Intent {
+// return Intent(Intent(MediaStore.ACTION_PICK_IMAGES)).apply { type = "image/*" }
+// }
+//
+// override fun parseResult(resultCode: Int, intent: Intent?): Uri? {
+// return intent.takeIf { resultCode == Activity.RESULT_OK }?.data
+// }
+// }
+//
+// var pickImageLegacy = registerForActivityResult<String, Uri>(
+// ActivityResultContracts.GetContent()
+// ) { uri: Uri? ->
+// if (uri != null) {
+// try {
+// requireContext().contentResolver.openInputStream(uri).use { inputStream ->
+// val bitmap = BitmapFactory.decodeStream(inputStream)
+// systemUIProxy?.setUfpsImageBitmap(bitmap)
+// savePickerIcon(bitmap)
+// }
+//
+// Settings.System.putString(
+// requireContext().contentResolver,
+// Settings.System.OMNI_CUSTOM_FP_ICON_UPDATE,
+// System.currentTimeMillis().toString()
+// )
+// } catch (e: Exception) {
+// Log.d(TAG, "pickImage", e);
+// }
+// }
+// }
+//
+// private val pickImage =
+// registerForActivityResult(PickSinglePhotoContract()) { uri ->
+// Log.d(TAG, "pickImage uri = " + uri)
+// if (uri != null) {
+// // TODO we should do some check if the image is even a useful one eg size
+// try {
+// requireContext().contentResolver.openInputStream(uri).use { inputStream ->
+// val bitmap = BitmapFactory.decodeStream(inputStream)
+// systemUIProxy?.setUfpsImageBitmap(bitmap)
+// savePickerIcon(bitmap)
+// }
+//
+// Settings.System.putString(
+// requireContext().contentResolver,
+// Settings.System.OMNI_CUSTOM_FP_ICON_UPDATE,
+// System.currentTimeMillis().toString()
+// )
+// } catch (e: Exception) {
+// Log.d(TAG, "pickImage", e);
+// }
+// }
+// }
+//
+//
+// private val mSystemUIProxyService: ServiceConnection = object : ServiceConnection {
+// override fun onServiceConnected(name: ComponentName, service: IBinder) {
+// Log.d(
+// TAG,
+// "onServiceConnected $name $service"
+// )
+// systemUIProxy = IOmniSystemUiProxy.Stub.asInterface(service)
+// }
+//
+// override fun onServiceDisconnected(name: ComponentName) {
+// Log.d(TAG, "onServiceDisconnected $name")
+// }
+// }
+//
+// private var mSystemUIProxyBound = false
+// private var systemUIProxy: IOmniSystemUiProxy? = null
+// private var mFilePicker: Preference? = null
+// private var mEnableCustom: SwitchPreference? = null
+//
+//
+// private fun bindSystemUIProxyService() {
+// if (!mSystemUIProxyBound) {
+// Log.d(TAG, "bindSystemUIProxyService")
+// val serviceIntent = Intent("android.intent.action.OMNI_SYSTEMUI_SERVICE")
+// .setPackage("com.android.systemui")
+// try {
+// mSystemUIProxyBound = requireActivity().bindService(
+// serviceIntent,
+// mSystemUIProxyService,
+// Context.BIND_AUTO_CREATE
+// )
+// } catch (e: SecurityException) {
+// Log.e(
+// TAG,
+// "Unable to bind because of security error",
+// e
+// )
+// }
+// }
+// }
+//
+// private fun unbindSystemUIProxyService() {
+// if (mSystemUIProxyBound) {
+// Log.d(TAG, "unbindSystemUIProxyService")
+// requireActivity().unbindService(mSystemUIProxyService)
+// mSystemUIProxyBound = false
+// }
+// }
+//
+// override fun getFragmentTitle(): String {
+// return getString(R.string.fprint_title)
+// }
+//
+// override fun getFragmentSummary(): String {
+// return getString(R.string.fprint_summary)
+// }
+//
+// override fun getFragmentIcon(): Int {
+// return ICON_RES
+// }
+//
+// override fun onDestroy() {
+// super.onDestroy()
+// unbindSystemUIProxyService()
+// }
+//
+// override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
+// setPreferencesFromResource(XML_RES, rootKey)
+//
+// mEnableCustom = findPreference<SwitchPreference>(FINGERPRINT_CUSTOM_ICON_ENABLE)
+// mEnableCustom?.let {
+// it.onPreferenceChangeListener = Preference.OnPreferenceChangeListener { _, newValue ->
+// if (newValue as Boolean) {
+// if (getCustomImagePath().exists()) {
+// enablePickerIcon()
+// }
+// } else {
+// systemUIProxy?.resetUfpsImage()
+// }
+// true
+// }
+// }
+// mFilePicker = findPreference(FINGERPRINT_CUSTOM_ICON_SELECT)
+// mFilePicker?.let {
+// bindSystemUIProxyService()
+//
+// if (getCustomImagePath().exists()) {
+// setPickerIcon()
+// }
+//
+// it.onPreferenceClickListener = Preference.OnPreferenceClickListener {
+// pickImageLegacy.launch("image/*")
+// //pickImage.launch(null)
+// true
+// }
+// }
+// }
+//
+// private fun getCustomImagePath(): File {
+// return File(requireContext().filesDir, UFPSIMAGE_FILE_NAME)
+// }
+//
+// private fun setPickerIcon() {
+// try {
+// val parcelFileDescriptor = requireContext().contentResolver.openFileDescriptor(
+// Uri.fromFile(getCustomImagePath()),
+// "r"
+// )
+// parcelFileDescriptor?.let { it ->
+// val bitmap = BitmapFactory.decodeFileDescriptor(it.fileDescriptor)
+// it.close()
+// val d = BitmapDrawable(resources, bitmap)
+// mFilePicker?.icon = d
+// }
+// } catch (e: Exception) {
+// Log.e(
+// TAG,
+// "setPickerIcon",
+// e
+// )
+// }
+// }
+//
+// private fun enablePickerIcon() {
+// try {
+// val parcelFileDescriptor = requireContext().contentResolver.openFileDescriptor(
+// Uri.fromFile(getCustomImagePath()),
+// "r"
+// )
+// parcelFileDescriptor?.let { it ->
+// val bitmap = BitmapFactory.decodeFileDescriptor(it.fileDescriptor)
+// it.close()
+// systemUIProxy?.setUfpsImageBitmap(bitmap)
+// }
+// } catch (e: Exception) {
+// Log.e(
+// TAG,
+// "setPickerIcon",
+// e
+// )
+// }
+// }
+//
+// private fun savePickerIcon(bitmap: Bitmap) {
+// try {
+// val fos = FileOutputStream(getCustomImagePath())
+// bitmap.compress(Bitmap.CompressFormat.PNG, 90, fos)
+// fos.close()
+// val d = BitmapDrawable(resources, bitmap)
+// mFilePicker?.icon = d
+// } catch (e: Exception) {
+// Log.e(
+// TAG,
+// "savePickerIcon",
+// e
+// )
+// }
+// }
+//
+// private fun deletePickerIcon() {
+// if (getCustomImagePath().exists()) {
+// getCustomImagePath().delete()
+// }
+// }
+//}
\ No newline at end of file
diff --git a/app/src/main/java/org/omnirom/control/GridViewFragment.kt b/app/src/main/java/org/omnirom/control/GridViewFragment.kt
index df30d71..addd7e2 100644
--- a/app/src/main/java/org/omnirom/control/GridViewFragment.kt
+++ b/app/src/main/java/org/omnirom/control/GridViewFragment.kt
@@ -95,16 +95,16 @@
AppListFragment()
)
)
- if (resources.getBoolean(com.android.internal.R.bool.config_intrusiveBatteryLed)) {
- gridItems.add(
- FragmentGridItem(
- R.string.batterylight_title,
- R.string.batterylight_summary,
- R.drawable.ic_settings_leds,
- BatteryLightSettingsFragment()
- )
- )
- }
+// if (resources.getBoolean(com.android.internal.R.bool.config_intrusiveBatteryLed)) {
+// gridItems.add(
+// FragmentGridItem(
+// R.string.batterylight_title,
+// R.string.batterylight_summary,
+// R.drawable.ic_settings_leds,
+// BatteryLightSettingsFragment()
+// )
+// )
+// }
gridItems.add(
FragmentGridItem(
R.string.bars_settings_title,
@@ -131,16 +131,16 @@
)
)
}
- if (resources.getBoolean(R.bool.config_has_udfps)) {
- gridItems.add(
- FragmentGridItem(
- R.string.fprint_title,
- R.string.fprint_summary,
- R.drawable.ic_settings_fingerprint,
- FingerprintSettingsFragment()
- )
- )
- }
+// if (resources.getBoolean(R.bool.config_has_udfps)) {
+// gridItems.add(
+// FragmentGridItem(
+// R.string.fprint_title,
+// R.string.fprint_summary,
+// R.drawable.ic_settings_fingerprint,
+// FingerprintSettingsFragment()
+// )
+// )
+// }
gridItems.add(
FragmentGridItem(
R.string.lockscreen_item_title,
@@ -157,14 +157,14 @@
OverlaysFragment()
)
)
- gridItems.add(
- FragmentGridItem(
- R.string.qs_settings_title,
- R.string.qs_settings_summary,
- R.drawable.ic_qs_tile,
- QSSettingsFragment()
- )
- )
+// gridItems.add(
+// FragmentGridItem(
+// R.string.qs_settings_title,
+// R.string.qs_settings_summary,
+// R.drawable.ic_qs_tile,
+// QSSettingsFragment()
+// )
+// )
if (Utils.isAvailableApp(requireContext(), "org.omnirom.omniwallpaper")) {
val intent = Intent()
intent.component = ComponentName(
diff --git a/app/src/main/java/org/omnirom/control/QSSettingsFragment.kt b/app/src/main/java/org/omnirom/control/QSSettingsFragment.kt
index 79088e1..08fa359 100644
--- a/app/src/main/java/org/omnirom/control/QSSettingsFragment.kt
+++ b/app/src/main/java/org/omnirom/control/QSSettingsFragment.kt
@@ -1,110 +1,110 @@
-/*
- * Copyright (C) 2021 The OmniROM Project
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.omnirom.control
-
-import android.os.Bundle
-import android.provider.Settings
-import androidx.annotation.DrawableRes
-import androidx.annotation.XmlRes
-import androidx.preference.Preference
-import org.omnirom.omnilib.preference.SeekBarPreference
-
-
-class QSSettingsFragment : AbstractSettingsFragment() {
- companion object {
- @DrawableRes
- val ICON_RES = R.drawable.ic_qs_tile
- @XmlRes
- val XML_RES = R.xml.qs_settings_preferences
- }
- override fun getFragmentTitle(): String {
- return resources.getString(R.string.qs_settings_title)
- }
-
- override fun getFragmentSummary(): String {
- return resources.getString(R.string.qs_settings_summary)
- }
-
- override fun getFragmentIcon(): Int {
- return ICON_RES
- }
-
- override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
- setPreferencesFromResource(XML_RES, rootKey)
-
- val pm = requireContext().packageManager
- val resources = pm.getResourcesForApplication("com.android.systemui")
-
- var defPortraitColumns = 2
- val portraitColumns = findPreference<SeekBarPreference>("qs_layout_columns")
- if (portraitColumns != null) {
- var id =
- resources.getIdentifier(
- "quick_settings_num_columns",
- "integer",
- "com.android.systemui"
- )
- if (id != 0) {
- defPortraitColumns = resources.getInteger(id)
- }
- val settingsPortraitColumns = Settings.System.getInt(
- requireContext().contentResolver, Settings.System.OMNI_QS_LAYOUT_COLUMNS,
- defPortraitColumns
- )
- portraitColumns.setValue(settingsPortraitColumns)
- portraitColumns.onPreferenceChangeListener =
- Preference.OnPreferenceChangeListener { _, newValue ->
- Settings.System.putInt(
- requireContext().contentResolver, Settings.System.OMNI_QS_LAYOUT_COLUMNS,
- newValue as Int
- )
- true
- }
- }
- val landscapeColumns = findPreference<SeekBarPreference>("qs_layout_columns_landscape")
- if (landscapeColumns != null) {
- var defLandspaceColumns = defPortraitColumns
- var id =
- resources.getIdentifier(
- "quick_settings_num_columns_landscape",
- "integer",
- "com.android.systemui"
- )
- if (id != 0) {
- defLandspaceColumns = resources.getInteger(id)
- }
- val settingsLandscapeColumns = Settings.System.getInt(
- requireContext().contentResolver, Settings.System.OMNI_QS_LAYOUT_COLUMNS_LANDSCAPE,
- defLandspaceColumns
- )
- landscapeColumns.setValue(settingsLandscapeColumns)
- landscapeColumns.onPreferenceChangeListener =
- Preference.OnPreferenceChangeListener { _, newValue ->
- Settings.System.putInt(
- requireContext().contentResolver, Settings.System.OMNI_QS_LAYOUT_COLUMNS_LANDSCAPE,
- newValue as Int
- )
- true
- }
- }
- }
-
- override fun onPreferenceTreeClick(preference: Preference): Boolean {
- return super.onPreferenceTreeClick(preference)
- }
-}
+///*
+// * Copyright (C) 2021 The OmniROM Project
+// *
+// * This program is free software: you can redistribute it and/or modify
+// * it under the terms of the GNU General Public License as published by
+// * the Free Software Foundation, either version 2 of the License, or
+// * (at your option) any later version.
+// *
+// * This program is distributed in the hope that it will be useful,
+// * but WITHOUT ANY WARRANTY; without even the implied warranty of
+// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// * GNU General Public License for more details.
+// *
+// * You should have received a copy of the GNU General Public License
+// * along with this program. If not, see <http://www.gnu.org/licenses/>.
+// *
+// */
+//package org.omnirom.control
+//
+//import android.os.Bundle
+//import android.provider.Settings
+//import androidx.annotation.DrawableRes
+//import androidx.annotation.XmlRes
+//import androidx.preference.Preference
+//import org.omnirom.omnilib.preference.SeekBarPreference
+//
+//
+//class QSSettingsFragment : AbstractSettingsFragment() {
+// companion object {
+// @DrawableRes
+// val ICON_RES = R.drawable.ic_qs_tile
+// @XmlRes
+// val XML_RES = R.xml.qs_settings_preferences
+// }
+// override fun getFragmentTitle(): String {
+// return resources.getString(R.string.qs_settings_title)
+// }
+//
+// override fun getFragmentSummary(): String {
+// return resources.getString(R.string.qs_settings_summary)
+// }
+//
+// override fun getFragmentIcon(): Int {
+// return ICON_RES
+// }
+//
+// override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
+// setPreferencesFromResource(XML_RES, rootKey)
+//
+// val pm = requireContext().packageManager
+// val resources = pm.getResourcesForApplication("com.android.systemui")
+//
+// var defPortraitColumns = 2
+// val portraitColumns = findPreference<SeekBarPreference>("qs_layout_columns")
+// if (portraitColumns != null) {
+// var id =
+// resources.getIdentifier(
+// "quick_settings_num_columns",
+// "integer",
+// "com.android.systemui"
+// )
+// if (id != 0) {
+// defPortraitColumns = resources.getInteger(id)
+// }
+// val settingsPortraitColumns = Settings.System.getInt(
+// requireContext().contentResolver, Settings.System.OMNI_QS_LAYOUT_COLUMNS,
+// defPortraitColumns
+// )
+// portraitColumns.setValue(settingsPortraitColumns)
+// portraitColumns.onPreferenceChangeListener =
+// Preference.OnPreferenceChangeListener { _, newValue ->
+// Settings.System.putInt(
+// requireContext().contentResolver, Settings.System.OMNI_QS_LAYOUT_COLUMNS,
+// newValue as Int
+// )
+// true
+// }
+// }
+// val landscapeColumns = findPreference<SeekBarPreference>("qs_layout_columns_landscape")
+// if (landscapeColumns != null) {
+// var defLandspaceColumns = defPortraitColumns
+// var id =
+// resources.getIdentifier(
+// "quick_settings_num_columns_landscape",
+// "integer",
+// "com.android.systemui"
+// )
+// if (id != 0) {
+// defLandspaceColumns = resources.getInteger(id)
+// }
+// val settingsLandscapeColumns = Settings.System.getInt(
+// requireContext().contentResolver, Settings.System.OMNI_QS_LAYOUT_COLUMNS_LANDSCAPE,
+// defLandspaceColumns
+// )
+// landscapeColumns.setValue(settingsLandscapeColumns)
+// landscapeColumns.onPreferenceChangeListener =
+// Preference.OnPreferenceChangeListener { _, newValue ->
+// Settings.System.putInt(
+// requireContext().contentResolver, Settings.System.OMNI_QS_LAYOUT_COLUMNS_LANDSCAPE,
+// newValue as Int
+// )
+// true
+// }
+// }
+// }
+//
+// override fun onPreferenceTreeClick(preference: Preference): Boolean {
+// return super.onPreferenceTreeClick(preference)
+// }
+//}
diff --git a/app/src/main/java/org/omnirom/control/search/SearchProvider.kt b/app/src/main/java/org/omnirom/control/search/SearchProvider.kt
index 1ddf97a..0cbd508 100644
--- a/app/src/main/java/org/omnirom/control/search/SearchProvider.kt
+++ b/app/src/main/java/org/omnirom/control/search/SearchProvider.kt
@@ -23,13 +23,13 @@
import androidx.annotation.XmlRes
import org.omnirom.control.AppListFragment
import org.omnirom.control.BarsSettingsFragment
-import org.omnirom.control.BatteryLightSettingsFragment
+//import org.omnirom.control.BatteryLightSettingsFragment
import org.omnirom.control.ButtonSettingsFragment
import org.omnirom.control.DialerSettingsFragment
-import org.omnirom.control.FingerprintSettingsFragment
+//import org.omnirom.control.FingerprintSettingsFragment
import org.omnirom.control.LockscreenSettingsFragment
import org.omnirom.control.MoreSettingsFragment
-import org.omnirom.control.QSSettingsFragment
+//import org.omnirom.control.QSSettingsFragment
import org.omnirom.control.search.PreferenceXmlParserUtils.METADATA_KEY
import org.omnirom.control.search.PreferenceXmlParserUtils.METADATA_SUMMARY
import org.omnirom.control.search.PreferenceXmlParserUtils.METADATA_TITLE
@@ -88,23 +88,23 @@
this::isEnabled
)
)
- searchItemList.add(
- SearchItem(
- QSSettingsFragment.XML_RES,
- QSSettingsFragment().javaClass.canonicalName,
- QSSettingsFragment.ICON_RES,
- this::isEnabled
- )
- )
-
- searchItemList.add(
- SearchItem(
- FingerprintSettingsFragment.XML_RES,
- FingerprintSettingsFragment().javaClass.canonicalName,
- FingerprintSettingsFragment.ICON_RES,
- FingerprintSettingsFragment::isEnabled
- )
- )
+// searchItemList.add(
+// SearchItem(
+// QSSettingsFragment.XML_RES,
+// QSSettingsFragment().javaClass.canonicalName,
+// QSSettingsFragment.ICON_RES,
+// this::isEnabled
+// )
+// )
+//
+// searchItemList.add(
+// SearchItem(
+// FingerprintSettingsFragment.XML_RES,
+// FingerprintSettingsFragment().javaClass.canonicalName,
+// FingerprintSettingsFragment.ICON_RES,
+// FingerprintSettingsFragment::isEnabled
+// )
+// )
searchItemList.add(
SearchItem(
@@ -124,14 +124,14 @@
)
)
- searchItemList.add(
- SearchItem(
- BatteryLightSettingsFragment.XML_RES,
- BatteryLightSettingsFragment().javaClass.canonicalName,
- BatteryLightSettingsFragment.ICON_RES,
- BatteryLightSettingsFragment::isEnabled
- )
- )
+// searchItemList.add(
+// SearchItem(
+// BatteryLightSettingsFragment.XML_RES,
+// BatteryLightSettingsFragment().javaClass.canonicalName,
+// BatteryLightSettingsFragment.ICON_RES,
+// BatteryLightSettingsFragment::isEnabled
+// )
+// )
searchItemList.add(
SearchItem(