diff --git a/SystemUIShared/src/com/android/systemui/flags/FlagManager.kt b/SystemUIShared/src/com/android/systemui/flags/FlagManager.kt index e61cb5c9a5..b7e4d249dc 100644 --- a/SystemUIShared/src/com/android/systemui/flags/FlagManager.kt +++ b/SystemUIShared/src/com/android/systemui/flags/FlagManager.kt @@ -94,7 +94,7 @@ class FlagManager constructor( fun isEnabled(id: Int): Boolean? { val data: String? = Settings.Secure.getString( context.contentResolver, keyToSettingsPrefix(id)) - if (data == null || data?.isEmpty()) { + if (data?.isEmpty() == true) { return null } val json: JSONObject diff --git a/build.gradle b/build.gradle index 53a714156e..f5f6dab2cf 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,8 @@ buildscript { ext { - kotlin_version = '1.6.21' - compose_version = '1.2.0-rc01' + kotlin_version = "1.7.0" + compose_version = "1.2.0-rc03" + compose_compiler_version = "1.2.0" accompanist_version = '0.24.10-beta' libsu_version = '3.1.2' protocVersion = '3.18.0' @@ -18,6 +19,7 @@ buildscript { classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" classpath 'com.google.android.gms:oss-licenses-plugin:0.10.5' classpath 'dev.rikka.tools.refine:gradle-plugin:3.1.1' + classpath "com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:1.7.0-1.0.6" } } @@ -89,7 +91,7 @@ apply plugin: 'kotlin-android' apply plugin: 'com.google.protobuf' apply plugin: 'com.google.android.gms.oss-licenses-plugin' apply plugin: 'kotlin-parcelize' -apply plugin: 'kotlin-kapt' +apply plugin: "com.google.devtools.ksp" apply plugin: 'org.jetbrains.kotlin.plugin.serialization' apply plugin: 'dev.rikka.tools.refine' @@ -147,6 +149,8 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true + + ksp { arg("room.schemaLocation", "$projectDir/schemas".toString()) } } applicationVariants.all { variant -> @@ -161,7 +165,7 @@ android { } composeOptions { - kotlinCompilerExtensionVersion = compose_version + kotlinCompilerExtensionVersion = compose_compiler_version } if (keystorePropertiesFile.exists()) { @@ -359,14 +363,14 @@ dependencies { implementation "androidx.compose.ui:ui-text-google-fonts:$compose_version" implementation "androidx.compose.foundation:foundation:$compose_version" implementation "androidx.compose.material:material:$compose_version" - implementation "androidx.compose.material3:material3:1.0.0-alpha13" + implementation "androidx.compose.material3:material3:1.0.0-alpha14" implementation "androidx.compose.runtime:runtime-livedata:$compose_version" implementation "androidx.compose.runtime:runtime-rxjava2:$compose_version" - implementation "androidx.compose.compiler:compiler:$compose_version" + implementation "androidx.compose.compiler:compiler:$compose_compiler_version" implementation "androidx.constraintlayout:constraintlayout:2.1.4" - implementation 'androidx.activity:activity-compose:1.4.0' - implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.4.1' - implementation "androidx.navigation:navigation-compose:2.4.2" + implementation "androidx.activity:activity-compose:1.5.0" + implementation "androidx.lifecycle:lifecycle-viewmodel-compose:2.5.0" + implementation "androidx.navigation:navigation-compose:2.5.0" implementation "androidx.palette:palette-ktx:${ANDROID_X_VERSION}" implementation "androidx.slice:slice-core:1.1.0-alpha02" implementation "com.google.accompanist:accompanist-drawablepainter:$accompanist_version" @@ -388,7 +392,8 @@ dependencies { implementation "androidx.room:room-runtime:$room_version" implementation "androidx.room:room-ktx:$room_version" - kapt "androidx.room:room-compiler:$room_version" + implementation "androidx.room:room-rxjava2:$room_version" + ksp "androidx.room:room-compiler:$room_version" implementation "com.github.topjohnwu.libsu:core:$libsu_version" implementation "com.github.topjohnwu.libsu:service:$libsu_version" diff --git a/schemas/app.lawnchair.data.AppDatabase/1.json b/schemas/app.lawnchair.data.AppDatabase/1.json new file mode 100644 index 0000000000..7746647438 --- /dev/null +++ b/schemas/app.lawnchair.data.AppDatabase/1.json @@ -0,0 +1,58 @@ +{ + "formatVersion": 1, + "database": { + "version": 1, + "identityHash": "71ed6db3b850c6cd5f76eb15cccf233d", + "entities": [ + { + "tableName": "IconOverride", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`target` TEXT NOT NULL, `packPackageName` TEXT NOT NULL, `drawableName` TEXT NOT NULL, `label` TEXT NOT NULL, `type` TEXT NOT NULL, PRIMARY KEY(`target`))", + "fields": [ + { + "fieldPath": "target", + "columnName": "target", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconPickerItem.packPackageName", + "columnName": "packPackageName", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconPickerItem.drawableName", + "columnName": "drawableName", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconPickerItem.label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconPickerItem.type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "target" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + } + ], + "views": [], + "setupQueries": [ + "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", + "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '71ed6db3b850c6cd5f76eb15cccf233d')" + ] + } +}