mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-21 11:55:31 -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)
|
||||
mChargePref!!.onPreferenceChangeListener = this
|
||||
mChargePref!!.isChecked = Battery.fastChargeSysfs == 0
|
||||
val mBatteryInfo = findPreference<ListPreference>(BATTERY_INFO)
|
||||
val mBatteryInfo : ListPreference = findPreference(BATTERY_INFO)!!
|
||||
val items = arrayOf<CharSequence>(
|
||||
Battery.getGeneralBatteryStats(1).toString() + " mAh",
|
||||
Battery.getGeneralBatteryStats(2).toString() + " %",
|
||||
|
|
@ -46,12 +46,11 @@ class BatteryFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChang
|
|||
if (Battery.getGeneralBatteryStats(4) == 1) "Charging" else "Discharging",
|
||||
Battery.getGeneralBatteryStats(5).toString() + " \u2103"
|
||||
)
|
||||
assert(mBatteryInfo != null)
|
||||
mBatteryInfo!!.entryValues = items
|
||||
mBatteryInfo.entryValues = items
|
||||
mBatteryInfo.onPreferenceChangeListener =
|
||||
Preference.OnPreferenceChangeListener { _: Preference?, newValue: Any? ->
|
||||
Toast.makeText(
|
||||
context, newValue as String?, Toast.LENGTH_SHORT
|
||||
context, newValue as String, Toast.LENGTH_SHORT
|
||||
).show()
|
||||
true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ class DolbyFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChangeL
|
|||
addPreferencesFromResource(R.xml.dolby_settings)
|
||||
DolbyModesPreference = findPreference(DOLBY_MODES)
|
||||
DolbyEnablePreference = findPreference(PREF_DOLBY)
|
||||
assert(DolbyEnablePreference != null)
|
||||
DolbyEnablePreference!!.isChecked = dolbyCore.isRunning()
|
||||
DolbyEnablePreference!!.onPreferenceChangeListener = this
|
||||
val items = arrayOf<CharSequence>(
|
||||
|
|
@ -39,7 +38,7 @@ class DolbyFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChangeL
|
|||
DolbyModesPreference!!.entryValues = items
|
||||
DolbyModesPreference!!.onPreferenceChangeListener =
|
||||
Preference.OnPreferenceChangeListener { _: Preference?, newValue: Any ->
|
||||
when ((newValue as String?)?.toInt()) {
|
||||
when ((newValue as String).toInt()) {
|
||||
1 -> dolbyCore.startDolbyEffect(DolbyCore.PROFILE_AUTO)
|
||||
2 -> dolbyCore.startDolbyEffect(DolbyCore.PROFILE_GAME)
|
||||
3 -> dolbyCore.startDolbyEffect(DolbyCore.PROFILE_GAME_1)
|
||||
|
|
|
|||
|
|
@ -230,11 +230,11 @@ open class CustomSeekBarPreference @JvmOverloads constructor(
|
|||
}
|
||||
|
||||
private fun setDefaultValue(newValue: Int, update: Boolean) {
|
||||
var newValue = newValue
|
||||
newValue = getLimitedValue(newValue)
|
||||
if (!mDefaultValueExists || mDefaultValue != newValue) {
|
||||
var mNewValue = newValue
|
||||
mNewValue = getLimitedValue(mNewValue)
|
||||
if (!mDefaultValueExists || mDefaultValue != mNewValue) {
|
||||
mDefaultValueExists = true
|
||||
mDefaultValue = newValue
|
||||
mDefaultValue = mNewValue
|
||||
if (update) updateValueViews()
|
||||
}
|
||||
}
|
||||
|
|
@ -259,10 +259,10 @@ open class CustomSeekBarPreference @JvmOverloads constructor(
|
|||
}
|
||||
|
||||
fun setValue(newValue: Int, update: Boolean) {
|
||||
var newValue = newValue
|
||||
newValue = getLimitedValue(newValue)
|
||||
if (mValue != newValue) {
|
||||
if (update) mSeekBar.progress = getSeekValue(newValue) else mValue = newValue
|
||||
var mNewValue = newValue
|
||||
mNewValue = getLimitedValue(mNewValue)
|
||||
if (mValue != mNewValue) {
|
||||
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.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.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.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 \
|
||||
|
|
|
|||
Loading…
Reference in a new issue