Merge "Use correct Settings API to set mirror/extend" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
3a40af147e
@@ -38,13 +38,13 @@ class MirrorPreference(context: Context): SwitchPreferenceCompat(context) {
|
|||||||
|
|
||||||
override fun onAttached() {
|
override fun onAttached() {
|
||||||
super.onAttached()
|
super.onAttached()
|
||||||
setChecked(0 != Settings.Global.getInt(
|
setChecked(0 != Settings.Secure.getInt(
|
||||||
context.contentResolver, Settings.Secure.MIRROR_BUILT_IN_DISPLAY, 0))
|
context.contentResolver, Settings.Secure.MIRROR_BUILT_IN_DISPLAY, 0))
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onClick() {
|
override fun onClick() {
|
||||||
super.onClick()
|
super.onClick()
|
||||||
Settings.Global.putInt(
|
Settings.Secure.putInt(
|
||||||
context.contentResolver, Settings.Secure.MIRROR_BUILT_IN_DISPLAY,
|
context.contentResolver, Settings.Secure.MIRROR_BUILT_IN_DISPLAY,
|
||||||
if (isChecked()) 1 else 0)
|
if (isChecked()) 1 else 0)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user