diff --git a/app/src/main/java/com/machiav3lli/backup/dbs/entity/SpecialInfo.kt b/app/src/main/java/com/machiav3lli/backup/dbs/entity/SpecialInfo.kt index 8a3f6893a..2ebd698fb 100644 --- a/app/src/main/java/com/machiav3lli/backup/dbs/entity/SpecialInfo.kt +++ b/app/src/main/java/com/machiav3lli/backup/dbs/entity/SpecialInfo.kt @@ -104,6 +104,7 @@ open class SpecialInfo : PackageInfo { val systemDir = "/data/system" val userDir = "$systemDir/users/$userId" val systemCeDir = "/data/system_ce/$userId" + val systemDeDirGlobal = "/data/system_de" val vendorDeDir = "/data/vendor_de/$userId" val specPrefix = "$ " @@ -142,6 +143,30 @@ open class SpecialInfo : PackageInfo { ), R.drawable.ic_accounts ) ) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + val baseDir = if (Build.VERSION.SDK_INT < + Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { + systemDeDirGlobal + } else { + systemDir + } + specialInfos + .add( + SpecialInfo( + "special.adaptive.brightness", + specPrefix + context.getString(R.string.spec_adaptiveBrightness), + Build.VERSION.RELEASE, + Build.VERSION.SDK_INT, arrayOf( + // Note: Restoring these two files very likely only works if + // the device is abruptly rebooted immediately after + // restoring them. + "$baseDir/ambient_brightness_stats.xml", + "$baseDir/brightness_events.xml" + ), + R.drawable.ic_adaptive_brightness + ) + ) + } specialInfos .add( SpecialInfo( diff --git a/app/src/main/res/drawable/ic_adaptive_brightness.xml b/app/src/main/res/drawable/ic_adaptive_brightness.xml new file mode 100644 index 000000000..c40d01413 --- /dev/null +++ b/app/src/main/res/drawable/ic_adaptive_brightness.xml @@ -0,0 +1,242 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index dca50fa81..1c960dff0 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -406,4 +406,5 @@ Hell mit dynamischen Farben Systemthema (Schwarz) Dunkel mit dynamischen Farben + Automatische Helligkeit \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b51858d76..16f683bd5 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -232,6 +232,7 @@ Wallpaper Fingerprints Wireless access points + Adaptive brightness Unable to create notification channel Error updating %1$s of schedule %2$d Permission to access external storage is required