mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-23 04:25:33 -04:00
universal7885: SamsungParts: Address 'variable shadowed' warning
This commit is contained in:
parent
1e85da25a4
commit
56881cba9b
4 changed files with 13 additions and 15 deletions
|
|
@ -37,7 +37,7 @@ class BatteryFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChang
|
||||||
assert(mChargePref != null)
|
assert(mChargePref != null)
|
||||||
mChargePref!!.onPreferenceChangeListener = this
|
mChargePref!!.onPreferenceChangeListener = this
|
||||||
mChargePref!!.isChecked = Battery.fastChargeSysfs == 0
|
mChargePref!!.isChecked = Battery.fastChargeSysfs == 0
|
||||||
val mBatteryInfo = findPreference<ListPreference>(BATTERY_INFO)
|
val mBatteryInfo : ListPreference = findPreference(BATTERY_INFO)!!
|
||||||
val items = arrayOf<CharSequence>(
|
val items = arrayOf<CharSequence>(
|
||||||
Battery.getGeneralBatteryStats(1).toString() + " mAh",
|
Battery.getGeneralBatteryStats(1).toString() + " mAh",
|
||||||
Battery.getGeneralBatteryStats(2).toString() + " %",
|
Battery.getGeneralBatteryStats(2).toString() + " %",
|
||||||
|
|
@ -46,12 +46,11 @@ class BatteryFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChang
|
||||||
if (Battery.getGeneralBatteryStats(4) == 1) "Charging" else "Discharging",
|
if (Battery.getGeneralBatteryStats(4) == 1) "Charging" else "Discharging",
|
||||||
Battery.getGeneralBatteryStats(5).toString() + " \u2103"
|
Battery.getGeneralBatteryStats(5).toString() + " \u2103"
|
||||||
)
|
)
|
||||||
assert(mBatteryInfo != null)
|
mBatteryInfo.entryValues = items
|
||||||
mBatteryInfo!!.entryValues = items
|
|
||||||
mBatteryInfo.onPreferenceChangeListener =
|
mBatteryInfo.onPreferenceChangeListener =
|
||||||
Preference.OnPreferenceChangeListener { _: Preference?, newValue: Any? ->
|
Preference.OnPreferenceChangeListener { _: Preference?, newValue: Any? ->
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
context, newValue as String?, Toast.LENGTH_SHORT
|
context, newValue as String, Toast.LENGTH_SHORT
|
||||||
).show()
|
).show()
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@ class DolbyFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChangeL
|
||||||
addPreferencesFromResource(R.xml.dolby_settings)
|
addPreferencesFromResource(R.xml.dolby_settings)
|
||||||
DolbyModesPreference = findPreference(DOLBY_MODES)
|
DolbyModesPreference = findPreference(DOLBY_MODES)
|
||||||
DolbyEnablePreference = findPreference(PREF_DOLBY)
|
DolbyEnablePreference = findPreference(PREF_DOLBY)
|
||||||
assert(DolbyEnablePreference != null)
|
|
||||||
DolbyEnablePreference!!.isChecked = dolbyCore.isRunning()
|
DolbyEnablePreference!!.isChecked = dolbyCore.isRunning()
|
||||||
DolbyEnablePreference!!.onPreferenceChangeListener = this
|
DolbyEnablePreference!!.onPreferenceChangeListener = this
|
||||||
val items = arrayOf<CharSequence>(
|
val items = arrayOf<CharSequence>(
|
||||||
|
|
@ -39,7 +38,7 @@ class DolbyFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChangeL
|
||||||
DolbyModesPreference!!.entryValues = items
|
DolbyModesPreference!!.entryValues = items
|
||||||
DolbyModesPreference!!.onPreferenceChangeListener =
|
DolbyModesPreference!!.onPreferenceChangeListener =
|
||||||
Preference.OnPreferenceChangeListener { _: Preference?, newValue: Any ->
|
Preference.OnPreferenceChangeListener { _: Preference?, newValue: Any ->
|
||||||
when ((newValue as String?)?.toInt()) {
|
when ((newValue as String).toInt()) {
|
||||||
1 -> dolbyCore.startDolbyEffect(DolbyCore.PROFILE_AUTO)
|
1 -> dolbyCore.startDolbyEffect(DolbyCore.PROFILE_AUTO)
|
||||||
2 -> dolbyCore.startDolbyEffect(DolbyCore.PROFILE_GAME)
|
2 -> dolbyCore.startDolbyEffect(DolbyCore.PROFILE_GAME)
|
||||||
3 -> dolbyCore.startDolbyEffect(DolbyCore.PROFILE_GAME_1)
|
3 -> dolbyCore.startDolbyEffect(DolbyCore.PROFILE_GAME_1)
|
||||||
|
|
|
||||||
|
|
@ -230,11 +230,11 @@ open class CustomSeekBarPreference @JvmOverloads constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setDefaultValue(newValue: Int, update: Boolean) {
|
private fun setDefaultValue(newValue: Int, update: Boolean) {
|
||||||
var newValue = newValue
|
var mNewValue = newValue
|
||||||
newValue = getLimitedValue(newValue)
|
mNewValue = getLimitedValue(mNewValue)
|
||||||
if (!mDefaultValueExists || mDefaultValue != newValue) {
|
if (!mDefaultValueExists || mDefaultValue != mNewValue) {
|
||||||
mDefaultValueExists = true
|
mDefaultValueExists = true
|
||||||
mDefaultValue = newValue
|
mDefaultValue = mNewValue
|
||||||
if (update) updateValueViews()
|
if (update) updateValueViews()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -259,10 +259,10 @@ open class CustomSeekBarPreference @JvmOverloads constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setValue(newValue: Int, update: Boolean) {
|
fun setValue(newValue: Int, update: Boolean) {
|
||||||
var newValue = newValue
|
var mNewValue = newValue
|
||||||
newValue = getLimitedValue(newValue)
|
mNewValue = getLimitedValue(mNewValue)
|
||||||
if (mValue != newValue) {
|
if (mValue != mNewValue) {
|
||||||
if (update) mSeekBar.progress = getSeekValue(newValue) else mValue = newValue
|
if (update) mSeekBar.progress = getSeekValue(mNewValue) else mValue = mNewValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -182,7 +182,7 @@ PRODUCT_COPY_FILES += \
|
||||||
frameworks/native/data/etc/android.hardware.sensor.compass.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.compass.xml \
|
frameworks/native/data/etc/android.hardware.sensor.compass.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.compass.xml \
|
||||||
frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.gyroscope.xml \
|
frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.gyroscope.xml \
|
||||||
frameworks/native/data/etc/android.hardware.sensor.proximity.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.proximity.xml \
|
frameworks/native/data/etc/android.hardware.sensor.proximity.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.proximity.xml \
|
||||||
frameworks/native/data/etc/android.hardware.sensor.stepcounter.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepcounter.xml \
|
frameworks/native/data/etc/android.hardware.sensor.stepcounter.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepcounter.xml \
|
||||||
frameworks/native/data/etc/android.hardware.sensor.stepdetector.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepdetector.xml \
|
frameworks/native/data/etc/android.hardware.sensor.stepdetector.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepdetector.xml \
|
||||||
frameworks/native/data/etc/android.hardware.telephony.gsm.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.gsm.xml \
|
frameworks/native/data/etc/android.hardware.telephony.gsm.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.gsm.xml \
|
||||||
frameworks/native/data/etc/android.hardware.telephony.ims.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.ims.xml \
|
frameworks/native/data/etc/android.hardware.telephony.ims.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.ims.xml \
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue