Skip to content

Commit e7ec6d4

Browse files
committed
Fix bugs
Fix crash when calling dpm.isStatusBarDisabled in work profile (#292) Fix Cross profile intent filter database bug (#294) Update dependencies
1 parent 56acfad commit e7ec6d4

6 files changed

Lines changed: 19 additions & 10 deletions

File tree

app/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ android {
1616
}
1717
}
1818
namespace = "com.bintianqi.owndroid"
19-
compileSdk = 36
19+
compileSdk = 37
2020

2121
lint.checkReleaseBuilds = false
2222
lint.disable += "All"

app/src/main/java/com/bintianqi/owndroid/MyDbHelper.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import android.content.Context
44
import android.database.sqlite.SQLiteDatabase
55
import android.database.sqlite.SQLiteOpenHelper
66

7-
class MyDbHelper(context: Context): SQLiteOpenHelper(context, "data", null, 6) {
7+
class MyDbHelper(context: Context): SQLiteOpenHelper(context, "data", null, 7) {
88
override fun onCreate(db: SQLiteDatabase) {
99
db.execSQL(DHIZUKU_CLIENTS_TABLE)
1010
db.execSQL(SECURITY_LOGS_TABLE)
@@ -28,6 +28,9 @@ class MyDbHelper(context: Context): SQLiteOpenHelper(context, "data", null, 6) {
2828
if (oldVersion < 6) {
2929
db.execSQL(UPGRADE_CP_INTENTS_TABLE)
3030
}
31+
if (oldVersion < 7) {
32+
db.execSQL(RENAME_CP_COLUMN)
33+
}
3134
}
3235
companion object {
3336
const val DHIZUKU_CLIENTS_TABLE = "CREATE TABLE dhizuku_clients (uid INTEGER PRIMARY KEY," +
@@ -44,5 +47,7 @@ class MyDbHelper(context: Context): SQLiteOpenHelper(context, "data", null, 6) {
4447
"action_str TEXT, category TEXT, mime_type TEXT, direction INTEGER, time INTEGER)"
4548
const val UPGRADE_CP_INTENTS_TABLE = "ALTER TABLE cross_profile_intent_filters " +
4649
"ADD COLUMN created_at INTEGER NOT NULL DEFAULT 0"
50+
const val RENAME_CP_COLUMN = "ALTER TABLE cross_profile_intent_filters " +
51+
"RENAME COLUMN created_at TO time"
4752
}
4853
}

app/src/main/java/com/bintianqi/owndroid/feature/system/SystemOptionsScreen.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ fun SystemOptionsScreen(vm: SystemOptionsViewModel, onNavigateUp: () -> Unit) {
4747
R.string.disable_screen_capture, status.screenCaptureDisabled,
4848
vm::setScreenCaptureDisabled, R.drawable.screenshot_fill0
4949
)
50-
if (VERSION.SDK_INT >= 34 && privilege.run { device || (profile && affiliated) }) {
50+
if (VERSION.SDK_INT >= 34 && privilege.run { device || (profile && !work && affiliated) }) {
5151
SwitchItem(
5252
R.string.disable_status_bar, status.statusBarDisabled,
5353
vm::setStatusBarDisabled, R.drawable.notifications_fill0
@@ -119,7 +119,7 @@ fun SystemOptionsScreen(vm: SystemOptionsViewModel, onNavigateUp: () -> Unit) {
119119
}, it.icon)
120120
}
121121
}
122-
if (VERSION.SDK_INT < 34) {
122+
if (VERSION.SDK_INT < 34 && privilege.run { device || (profile && !work && affiliated) }) {
123123
Row(
124124
Modifier
125125
.fillMaxWidth()

app/src/main/java/com/bintianqi/owndroid/feature/system/SystemOptionsViewModel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class SystemOptionsViewModel(
2626
cameraDisabled = dpm.getCameraDisabled(null),
2727
screenCaptureDisabled = dpm.getScreenCaptureDisabled(null),
2828
statusBarDisabled = if (VERSION.SDK_INT >= 34 &&
29-
privilege.run { device || (profile && affiliated) }
29+
privilege.run { device || (profile && !work && affiliated) }
3030
)
3131
dpm.isStatusBarDisabled else false,
3232
autoTimeEnabled = if (VERSION.SDK_INT >= 30 && (privilege.device || privilege.org))

app/src/main/java/com/bintianqi/owndroid/feature/users/UsersScreen.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,11 @@ fun UsersScreen(vm: UsersViewModel, onNavigateUp: () -> Unit, onNavigate: (Desti
114114
val launcher = rememberLauncherForActivityResult(ActivityResultContracts.GetContent()) {
115115
if (it != null) uriToStream(context, it) { stream ->
116116
bitmap = BitmapFactory.decodeStream(stream)
117-
if (bitmap != null) changeUserIconDialog = true
117+
if (bitmap != null) {
118+
changeUserIconDialog = true
119+
} else {
120+
vm.toastChannel.sendStatus(false)
121+
}
118122
}
119123
}
120124
FunctionItem(R.string.change_user_icon, icon = R.drawable.account_circle_fill0) {
@@ -473,7 +477,7 @@ fun AffiliationIdScreen(
473477
},
474478
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Done)
475479
)
476-
Button(vm::applyAffiliationIds) {
480+
Button(vm::applyAffiliationIds, Modifier.fillMaxWidth()) {
477481
Text(stringResource(R.string.apply))
478482
}
479483
Notes(R.string.info_affiliation_id)

gradle/libs.versions.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
agp = "9.2.1"
33
kotlin = "2.4.0"
44

5-
nav3 = "1.1.2"
6-
composeBom = "2026.05.01"
7-
lifecycle = "2.10.0"
5+
nav3 = "1.1.3"
6+
composeBom = "2026.06.00"
7+
lifecycle = "2.11.0"
88
accompanist-drawablepainter = "0.37.3"
99
accompanist-permissions = "0.37.3"
1010
shizuku = "13.1.5"

0 commit comments

Comments
 (0)