diff --git a/Android.bp b/Android.bp
index f997735..0d58f46 100644
--- a/Android.bp
+++ b/Android.bp
@@ -12,7 +12,7 @@ android_app {
system_ext_specific: true,
min_sdk_version: "29",
- target_sdk_version: "33",
+ target_sdk_version: "34",
static_libs: [
"SettingsLibBannerMessagePreference",
@@ -34,6 +34,8 @@ android_app {
"androidx.room_room-compiler-plugin",
],
+ use_resource_processor: true,
+
optimize: {
optimize: true,
proguard_flags_files: ["proguard.flags"],
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 66c7611..4e39be6 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -16,6 +16,7 @@
+
@@ -132,6 +133,7 @@
@@ -143,6 +145,7 @@
diff --git a/README.md b/README.md
index f790715..91cf3b1 100644
--- a/README.md
+++ b/README.md
@@ -225,20 +225,20 @@ If you're a ROM maintainer and wish to integrate this app into your ROM, follow
1. Choose one of the following methods to add the app to the Android sources:
- As a remote project via [Local Manifests](https://gerrit.googlesource.com/git-repo/+/master/docs/manifest-format.md#Local-Manifests):
```xml
-
+
```
- As an in-tree package within the device tree directory:
```sh
- git clone --depth=1 -b 13.0-dev https://github.com/iusmac/7SIM.git
+ git clone --depth=1 -b 14.0-dev https://github.com/iusmac/7SIM.git
```
- Or better — as Git [Submodule/Subtree](https://training.github.com/downloads/submodule-vs-subtree-cheat-sheet/):
```sh
- git submodule add --depth=1 -b 13.0-dev https://github.com/iusmac/7SIM.git
+ git submodule add --depth=1 -b 14.0-dev https://github.com/iusmac/7SIM.git
```
OR
```sh
- git subtree add --prefix=7SIM https://github.com/iusmac/7SIM.git 13.0-dev --squash
+ git subtree add --prefix=7SIM https://github.com/iusmac/7SIM.git 14.0-dev --squash
```
2. Add app module to a product makefile (e.g., `device.mk`):
```
@@ -270,7 +270,7 @@ If you're a ROM maintainer and wish to integrate this app into your ROM, follow
### Using Gradle Build Tool
**Requirements:**
-- Android 13 SDK or newer with access to hidden APIs and internal resources
+- Android 14 SDK or newer with access to hidden APIs and internal resources
> [!TIP]
> If you don't have one already, you can use our own `android.jar` that you can find at
> [`prebuilts/jars/`](./prebuilts/jars/). Replace it with the stock one in the Android SDK directory.
@@ -280,7 +280,7 @@ If you're a ROM maintainer and wish to integrate this app into your ROM, follow
As mentioned above, the 7SIM app is an extension of the built-in Settings app. In order to have the
same UI, and also write less code, it relies on some parts of the
-[SettingsLib](https://android.googlesource.com/platform/frameworks/base.git/+/refs/tags/android-13.0.0_r75/packages/SettingsLib/)
+[SettingsLib](https://android.googlesource.com/platform/frameworks/base.git/+/refs/tags/android-14.0.0_r31/packages/SettingsLib/)
package that you can download automatically using this script:
```sh
./SettingsLib/fetch.sh
@@ -303,7 +303,7 @@ To enable debug logging on releases with R8, see [Debug Opt-in Logging](#debug-o
### Using Soong Build System
**Requirements:**
-- Android 13 and later source code base
+- Android 14 and later source code base
> [!NOTE]
> The app stability is not guaranteed when building against the upstream source code base.
diff --git a/SettingsLib/.gitignore b/SettingsLib/.gitignore
index fef96b0..4b66cc7 100644
--- a/SettingsLib/.gitignore
+++ b/SettingsLib/.gitignore
@@ -1,7 +1,21 @@
-/*
+/fwb
!/.gitignore
!/fetch.sh
-!/build.gradle
+!/BannerMessagePreference/
+/BannerMessagePreference/*
+!/BannerMessagePreference/build.gradle
+!/CollapsingToolbarBaseActivity/
+/CollapsingToolbarBaseActivity/*
+!/CollapsingToolbarBaseActivity/build.gradle
+!/MainSwitchPreference/
+/MainSwitchPreference/*
+!/MainSwitchPreference/build.gradle
+!/SettingsTheme/
+/SettingsTheme/*
+!/SettingsTheme/build.gradle
+!/TwoTargetPreference/
+/TwoTargetPreference/*
+!/TwoTargetPreference/build.gradle
!/Utils/
/Utils/*
!/Utils/build.gradle
diff --git a/SettingsLib/BannerMessagePreference/build.gradle b/SettingsLib/BannerMessagePreference/build.gradle
new file mode 100644
index 0000000..b372cc4
--- /dev/null
+++ b/SettingsLib/BannerMessagePreference/build.gradle
@@ -0,0 +1,41 @@
+plugins {
+ id 'com.android.library'
+}
+
+def SettingsLibBannerMessagePreference = '../fwb/packages/SettingsLib/BannerMessagePreference'
+
+android {
+ namespace 'com.android.settingslib.widget.preference.banner'
+
+ defaultConfig {
+ minSdk 28
+ targetSdk 34
+ versionCode 1
+ versionName "1.0"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ lint {
+ checkReleaseBuilds false
+ abortOnError false
+ }
+
+ sourceSets {
+ main {
+ res.srcDirs = ["${SettingsLibBannerMessagePreference}/res"]
+ java.srcDirs = ["${SettingsLibBannerMessagePreference}/src"]
+ }
+ }
+}
+
+dependencies {
+ implementation libs.preference
+ implementation project(':SettingsLib:SettingsTheme')
+ implementation project(':SettingsLib:Utils')
+}
diff --git a/SettingsLib/CollapsingToolbarBaseActivity/build.gradle b/SettingsLib/CollapsingToolbarBaseActivity/build.gradle
new file mode 100644
index 0000000..a773b49
--- /dev/null
+++ b/SettingsLib/CollapsingToolbarBaseActivity/build.gradle
@@ -0,0 +1,45 @@
+plugins {
+ id 'com.android.library'
+}
+
+def SettingsLibCollapsingToolbarBaseActivity = '../fwb/packages/SettingsLib/CollapsingToolbarBaseActivity'
+
+android {
+ namespace 'com.android.settingslib.collapsingtoolbar'
+
+ defaultConfig {
+ minSdk 29
+ targetSdk 34
+ versionCode 1
+ versionName "1.0"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ lint {
+ checkReleaseBuilds false
+ abortOnError false
+ }
+
+ sourceSets {
+ main {
+ res.srcDirs = ["${SettingsLibCollapsingToolbarBaseActivity}/res"]
+ java.srcDirs = ["${SettingsLibCollapsingToolbarBaseActivity}/src"]
+ }
+ }
+}
+
+dependencies {
+ implementation libs.annotation
+ implementation libs.appcompat
+ implementation libs.coordinatorlayout
+ implementation libs.material
+ implementation libs.preference
+ implementation project(':SettingsLib:SettingsTheme')
+ implementation project(':SettingsLib:Utils')
+}
diff --git a/SettingsLib/MainSwitchPreference/build.gradle b/SettingsLib/MainSwitchPreference/build.gradle
new file mode 100644
index 0000000..ffa5b5a
--- /dev/null
+++ b/SettingsLib/MainSwitchPreference/build.gradle
@@ -0,0 +1,40 @@
+plugins {
+ id 'com.android.library'
+}
+
+def SettingsLibMainSwitchPreference = '../fwb/packages/SettingsLib/MainSwitchPreference'
+
+android {
+ namespace 'com.android.settingslib.widget.mainswitch'
+
+ defaultConfig {
+ minSdk 28
+ targetSdk 34
+ versionCode 1
+ versionName "1.0"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ lint {
+ checkReleaseBuilds false
+ abortOnError false
+ }
+
+ sourceSets {
+ main {
+ res.srcDirs = ["${SettingsLibMainSwitchPreference}/res"]
+ java.srcDirs = ["${SettingsLibMainSwitchPreference}/src"]
+ }
+ }
+}
+
+dependencies {
+ implementation libs.preference
+ implementation project(':SettingsLib:SettingsTheme')
+}
diff --git a/SettingsLib/SettingsTheme/build.gradle b/SettingsLib/SettingsTheme/build.gradle
new file mode 100644
index 0000000..afd034e
--- /dev/null
+++ b/SettingsLib/SettingsTheme/build.gradle
@@ -0,0 +1,38 @@
+plugins {
+ id 'com.android.library'
+}
+
+def SettingsLibSettingsTheme = '../fwb/packages/SettingsLib/SettingsTheme'
+
+android {
+ namespace 'com.android.settingslib.widget.theme'
+
+ defaultConfig {
+ minSdk 21
+ targetSdk 34
+ versionCode 1
+ versionName "1.0"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ lint {
+ checkReleaseBuilds false
+ abortOnError false
+ }
+
+ sourceSets {
+ main {
+ res.srcDirs = ["${SettingsLibSettingsTheme}/res"]
+ }
+ }
+}
+
+dependencies {
+ implementation libs.preference
+}
diff --git a/SettingsLib/TwoTargetPreference/build.gradle b/SettingsLib/TwoTargetPreference/build.gradle
new file mode 100644
index 0000000..754185d
--- /dev/null
+++ b/SettingsLib/TwoTargetPreference/build.gradle
@@ -0,0 +1,41 @@
+plugins {
+ id 'com.android.library'
+}
+
+def SettingsLibTwoTargetPreference = '../fwb/packages/SettingsLib/TwoTargetPreference'
+
+android {
+ namespace 'com.android.settingslib.widget.preference.twotarget'
+
+ defaultConfig {
+ minSdk 21
+ targetSdk 34
+ versionCode 1
+ versionName "1.0"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ lint {
+ checkReleaseBuilds false
+ abortOnError false
+ }
+
+ sourceSets {
+ main {
+ res.srcDirs = ["${SettingsLibTwoTargetPreference}/res"]
+ java.srcDirs = ["${SettingsLibTwoTargetPreference}/src"]
+ }
+ }
+}
+
+dependencies {
+ implementation libs.annotation
+ implementation libs.preference
+ implementation project(':SettingsLib:SettingsTheme')
+}
diff --git a/SettingsLib/Utils/build.gradle b/SettingsLib/Utils/build.gradle
index 3555b22..bcc8f04 100644
--- a/SettingsLib/Utils/build.gradle
+++ b/SettingsLib/Utils/build.gradle
@@ -9,14 +9,13 @@ android {
defaultConfig {
minSdk 21
- targetSdk 33
+ targetSdk 34
versionCode 1
versionName "1.0"
}
buildTypes {
release {
- debuggable false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
@@ -35,7 +34,7 @@ android {
}
}
-addCompileOnlyJar('android-33.jar')
+addCompileOnlyJar('android-34.jar')
dependencies {
implementation libs.annotation
diff --git a/SettingsLib/build.gradle b/SettingsLib/build.gradle
deleted file mode 100644
index 426b6de..0000000
--- a/SettingsLib/build.gradle
+++ /dev/null
@@ -1,55 +0,0 @@
-plugins {
- id 'com.android.library'
-}
-
-def SettingsLib = 'fwb/packages/SettingsLib'
-
-android {
- namespace 'com.android.settingslib.widget'
-
- defaultConfig {
- targetSdk 33
- versionCode 1
- versionName "1.0"
- }
-
- buildTypes {
- release {
- debuggable false
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
- }
- }
-
- lint {
- checkReleaseBuilds false
- abortOnError false
- }
-
- sourceSets {
- main {
- res.srcDirs = [
- "${SettingsLib}/BannerMessagePreference/res",
- "${SettingsLib}/CollapsingToolbarBaseActivity/res",
- "${SettingsLib}/MainSwitchPreference/res",
- "${SettingsLib}/SettingsTheme/res",
- "${SettingsLib}/TwoTargetPreference/res",
- ]
- java.srcDirs = [
- "${SettingsLib}/BannerMessagePreference/src",
- "${SettingsLib}/CollapsingToolbarBaseActivity/src",
- "${SettingsLib}/MainSwitchPreference/src",
- "${SettingsLib}/TwoTargetPreference/src",
- ]
- }
- }
-}
-
-dependencies {
- implementation libs.annotation
- implementation libs.appcompat
- implementation libs.coordinatorlayout
- implementation libs.material
- implementation libs.preference
- implementation project(path: ':SettingsLib:Utils')
-}
diff --git a/SettingsLib/fetch.sh b/SettingsLib/fetch.sh
index bcfc09d..2300e92 100755
--- a/SettingsLib/fetch.sh
+++ b/SettingsLib/fetch.sh
@@ -8,7 +8,7 @@ declare -r SHORT_OPTS=u:,t:
declare -r LONG_OPTS=set-repo-url:,set-repo-tag:,get-repo-url,get-repo-tag
declare -r FWB_DIR='fwb'
declare REPO_URL='https://android.googlesource.com/platform/frameworks/base.git'
-declare REPO_TAG='android-13.0.0_r75'
+declare REPO_TAG='android-14.0.0_r31'
declare -a LIBS=(
'BannerMessagePreference'
'CollapsingToolbarBaseActivity'
diff --git a/build.gradle b/build.gradle
index c43c7f8..32f9d63 100644
--- a/build.gradle
+++ b/build.gradle
@@ -6,43 +6,43 @@ buildscript {
// https://mvnrepository.com/artifact/androidx.room/room-runtime
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/heads/main/current/androidx/m2repository/androidx/room/room-compiler/
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/heads/main/current/androidx/m2repository/androidx/room/room-runtime/
- def room_version = '2.5.0-alpha01'
+ def room_version = '2.6.1' // TODO: AOSP sources use 2.7.0-alpha01; upgrade when available in maven central
// https://mvnrepository.com/artifact/com.google.dagger/hilt-android
// https://mvnrepository.com/artifact/com.google.dagger/hilt-compiler
// https://android.googlesource.com/platform/external/dagger2
- def hilt_version = '2.35.1'
+ def hilt_version = '2.46.1'
libs = [
// https://mvnrepository.com/artifact/androidx.annotation/annotation
- // https://android.googlesource.com/platform/prebuilts/sdk/+/refs/heads/main/current/androidx/m2repository/androidx/annotation/annotation/
- annotation : 'androidx.annotation:annotation:1.6.0-rc01',
+ // https://android.googlesource.com/platform/prebuilts/sdk/+/refs/heads/main/current/androidx/m2repository/androidx/annotation/annotation-jvm/
+ annotation : 'androidx.annotation:annotation:1.8.0-alpha01',
// https://mvnrepository.com/artifact/androidx.appcompat/appcompat
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/heads/main/current/androidx/m2repository/androidx/appcompat/appcompat/
- appcompat : 'androidx.appcompat:appcompat:1.6.0-alpha05',
+ appcompat : 'androidx.appcompat:appcompat:1.7.0-alpha03', // TODO: AOSP sources use 1.7.0-alpha04; upgrade when available in maven central
// https://mvnrepository.com/artifact/androidx.collection/collection
- // https://android.googlesource.com/platform/prebuilts/sdk/+/refs/heads/main/current/androidx/m2repository/androidx/collection/collection/
- collection : 'androidx.collection:collection:1.3.0-alpha01',
+ // https://android.googlesource.com/platform/prebuilts/sdk/+/refs/heads/main/current/androidx/m2repository/androidx/collection/collection-jvm/
+ collection : 'androidx.collection:collection:1.4.0-alpha02',
// https://mvnrepository.com/artifact/androidx.coordinatorlayout/coordinatorlayout
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/heads/main/current/androidx/m2repository/androidx/coordinatorlayout/coordinatorlayout/
- coordinatorlayout : 'androidx.coordinatorlayout:coordinatorlayout:1.2.0',
+ coordinatorlayout : 'androidx.coordinatorlayout:coordinatorlayout:1.3.0-alpha01',
// https://mvnrepository.com/artifact/androidx.core/core
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/heads/main/current/androidx/m2repository/androidx/core/core/
- core : 'androidx.core:core:1.9.0-alpha05',
+ core : 'androidx.core:core:1.13.0-alpha01',
hilt_android : "com.google.dagger:hilt-android:$hilt_version",
hilt_compiler : "com.google.dagger:hilt-compiler:$hilt_version",
// https://mvnrepository.com/artifact/androidx.lifecycle/lifecycle-livedata
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/heads/main/current/androidx/m2repository/androidx/lifecycle/lifecycle-livedata/
- livedata : 'androidx.lifecycle:lifecycle-livedata:2.5.0-alpha03',
+ livedata : 'androidx.lifecycle:lifecycle-livedata:2.7.0-alpha02',
// https://mvnrepository.com/artifact/com.google.android.material/material
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/heads/main/current/extras/material-design-x/com/google/android/material/material/
material : 'com.google.android.material:material:1.7.0-alpha03',
// https://mvnrepository.com/artifact/androidx.preference/preference
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/heads/main/current/androidx/m2repository/androidx/preference/preference/
- preference : 'androidx.preference:preference:1.2.0-alpha01',
+ preference : 'androidx.preference:preference:1.2.1', // TODO: AOSP sources use 1.3.0-alpha01; upgrade when available in maven central
room_compiler : "androidx.room:room-compiler:$room_version",
room_runtime : "androidx.room:room-runtime:$room_version",
// https://mvnrepository.com/artifact/androidx.lifecycle/lifecycle-viewmodel
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/heads/main/current/androidx/m2repository/androidx/lifecycle/lifecycle-viewmodel/
- viewmodel : 'androidx.lifecycle:lifecycle-viewmodel:2.5.0-alpha03'
+ viewmodel : 'androidx.lifecycle:lifecycle-viewmodel:2.7.0-alpha02'
]
}
}
@@ -109,7 +109,7 @@ android {
defaultConfig {
applicationId 'com.github.iusmac.sevensim'
- targetSdk 33
+ targetSdk 34
versionCode versionNameCommon[0].replaceAll(/\D/, '') as Integer // "x.y.z" => xyz
}
@@ -182,7 +182,7 @@ android {
]
}
-addCompileOnlyJar('android-33.jar')
+addCompileOnlyJar('android-34.jar')
dependencies {
implementation libs.annotation
@@ -198,7 +198,11 @@ dependencies {
implementation libs.room_runtime
kapt libs.room_compiler
- implementation project(path: ':SettingsLib')
+ implementation project(path: ':SettingsLib:BannerMessagePreference')
+ implementation project(path: ':SettingsLib:CollapsingToolbarBaseActivity')
+ implementation project(path: ':SettingsLib:MainSwitchPreference')
+ implementation project(path: ':SettingsLib:SettingsTheme')
+ implementation project(path: ':SettingsLib:TwoTargetPreference')
}
kapt {
diff --git a/gradle.properties b/gradle.properties
index 0009df5..036e852 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -15,7 +15,6 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 -XX:+UseParallelGC
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
-android.nonTransitiveRClass=false
android.defaults.buildfeatures.buildconfig=true
# Disable features we do not use
diff --git a/prebuilts/jars/android-33.jar b/prebuilts/jars/android-34.jar
similarity index 74%
rename from prebuilts/jars/android-33.jar
rename to prebuilts/jars/android-34.jar
index f20e1aa..889f852 100644
Binary files a/prebuilts/jars/android-33.jar and b/prebuilts/jars/android-34.jar differ
diff --git a/res/values-ar-rSA/strings.xml b/res/values-ar-rSA/strings.xml
index 56ec436..b00ca0d 100644
--- a/res/values-ar-rSA/strings.xml
+++ b/res/values-ar-rSA/strings.xml
@@ -43,4 +43,5 @@
"أهمية عالية"
"متوقف مؤقتًا في الخلفية"
"الاتصال قيد التقدم…"
+ "لم يتم الضبط"
diff --git a/res/values-az-rAZ/strings.xml b/res/values-az-rAZ/strings.xml
index 8ed3226..6c3e94e 100644
--- a/res/values-az-rAZ/strings.xml
+++ b/res/values-az-rAZ/strings.xml
@@ -43,4 +43,5 @@
"Çox əhəmiyyətli"
"Arxa fonda dayandırıldı"
"Zəng davam edir…"
+ "Ayarlanmayıb"
diff --git a/res/values-be-rBY/strings.xml b/res/values-be-rBY/strings.xml
index 8baf290..45cf831 100644
--- a/res/values-be-rBY/strings.xml
+++ b/res/values-be-rBY/strings.xml
@@ -43,4 +43,5 @@
"Высокая важнасць"
"Прыпынена ў фон. рэжыме"
"Ідзе выклік…"
+ "Не зададзена"
diff --git a/res/values-bg-rBG/strings.xml b/res/values-bg-rBG/strings.xml
index 0c77872..a254b9c 100644
--- a/res/values-bg-rBG/strings.xml
+++ b/res/values-bg-rBG/strings.xml
@@ -43,4 +43,5 @@
"Голяма важност"
"На пауза на заден план"
"Извършва се обаждане…"
+ "Не е зададено"
diff --git a/res/values-bn-rBD/strings.xml b/res/values-bn-rBD/strings.xml
index ddbb351..5a771e5 100644
--- a/res/values-bn-rBD/strings.xml
+++ b/res/values-bn-rBD/strings.xml
@@ -43,4 +43,5 @@
"খুব গুরুত্বপূর্ণ"
"পশ্চাদপটে বিরাম দেওয়া আছে"
"কল করা হচ্ছে…"
+ "সেট করা হয়নি"
diff --git a/res/values-ca-rES/strings.xml b/res/values-ca-rES/strings.xml
index 51616af..a097f72 100644
--- a/res/values-ca-rES/strings.xml
+++ b/res/values-ca-rES/strings.xml
@@ -43,4 +43,5 @@
"Molt important"
"Posada en pausa de fons"
"Trucada en curs…"
+ "No definit"
diff --git a/res/values-cs-rCZ/strings.xml b/res/values-cs-rCZ/strings.xml
index 511b2cb..f1c0e83 100644
--- a/res/values-cs-rCZ/strings.xml
+++ b/res/values-cs-rCZ/strings.xml
@@ -43,4 +43,5 @@
"Vysoká důležitost"
"Pozastaveno na pozadí"
"Probíhá hovor…"
+ "Nenastaveno"
diff --git a/res/values-da-rDK/strings.xml b/res/values-da-rDK/strings.xml
index 634541a..48abb3d 100644
--- a/res/values-da-rDK/strings.xml
+++ b/res/values-da-rDK/strings.xml
@@ -43,4 +43,5 @@
"Stor vigtighed"
"Standset i baggrunden"
"Opkald i gang …"
+ "Ikke angivet"
diff --git a/res/values-de-rDE/strings.xml b/res/values-de-rDE/strings.xml
index 51185b2..52cd601 100644
--- a/res/values-de-rDE/strings.xml
+++ b/res/values-de-rDE/strings.xml
@@ -43,4 +43,5 @@
"Hohe Wichtigkeit"
"Im Hintergrund pausiert"
"Anruf in Arbeit…"
+ "Nicht festgelegt"
diff --git a/res/values-el-rGR/strings.xml b/res/values-el-rGR/strings.xml
index 9416923..3526391 100644
--- a/res/values-el-rGR/strings.xml
+++ b/res/values-el-rGR/strings.xml
@@ -43,4 +43,5 @@
"Μεγάλης βαρύτητας"
"Σε παύση στο παρασκήνιο"
"Κλήση σε εξέλιξη…"
+ "Δεν έχει οριστεί"
diff --git a/res/values-es-rES/strings.xml b/res/values-es-rES/strings.xml
index f9b1cd7..3582c6a 100644
--- a/res/values-es-rES/strings.xml
+++ b/res/values-es-rES/strings.xml
@@ -43,4 +43,5 @@
"Muy importante"
"Pausada en segundo plano"
"Llamada en curso…"
+ "Sin establecer"
diff --git a/res/values-es-rVE/strings.xml b/res/values-es-rVE/strings.xml
index 6782b08..88947e8 100644
--- a/res/values-es-rVE/strings.xml
+++ b/res/values-es-rVE/strings.xml
@@ -43,4 +43,5 @@
"Muy importante"
"Pausada en segundo plano"
"Llamada en curso…"
+ "Sin establecer"
diff --git a/res/values-et-rEE/strings.xml b/res/values-et-rEE/strings.xml
index a851933..19cd071 100644
--- a/res/values-et-rEE/strings.xml
+++ b/res/values-et-rEE/strings.xml
@@ -43,4 +43,5 @@
"Kõrge tähtsus"
"Peatatud taustal"
"Kõne on pooleli …"
+ "Määramata"
diff --git a/res/values-fa-rIR/strings.xml b/res/values-fa-rIR/strings.xml
index f14c58f..ae78853 100644
--- a/res/values-fa-rIR/strings.xml
+++ b/res/values-fa-rIR/strings.xml
@@ -43,4 +43,5 @@
"اهمیت زیاد"
"در پسزمینه موقتاً متوقف شد"
"تماس در حال انجام…"
+ "تنظیم نشده"
diff --git a/res/values-fi-rFI/strings.xml b/res/values-fi-rFI/strings.xml
index 09409fe..361ba86 100644
--- a/res/values-fi-rFI/strings.xml
+++ b/res/values-fi-rFI/strings.xml
@@ -43,4 +43,5 @@
"Hyvin tärkeä"
"Keskeytetty taustalla"
"Puhelu kesken…"
+ "Ei asetettu"
diff --git a/res/values-fr-rFR/strings.xml b/res/values-fr-rFR/strings.xml
index 1ff70be..58a208f 100644
--- a/res/values-fr-rFR/strings.xml
+++ b/res/values-fr-rFR/strings.xml
@@ -43,4 +43,5 @@
"Importance élevée"
"Interrompu en arr.-plan"
"Appel en cours…"
+ "Non définie"
diff --git a/res/values-hr-rHR/strings.xml b/res/values-hr-rHR/strings.xml
index efc9f31..697b70c 100644
--- a/res/values-hr-rHR/strings.xml
+++ b/res/values-hr-rHR/strings.xml
@@ -43,4 +43,5 @@
"Velika važnost"
"Pauzirano u pozadini"
"Razgovor u tijeku…"
+ "Nije postavljeno"
diff --git a/res/values-hu-rHU/strings.xml b/res/values-hu-rHU/strings.xml
index 1b36e4c..34aa118 100644
--- a/res/values-hu-rHU/strings.xml
+++ b/res/values-hu-rHU/strings.xml
@@ -43,4 +43,5 @@
"Fontos"
"Szünetel a háttérben"
"Hívás folyamatban…"
+ "Nincs beállítva"
diff --git a/res/values-in-rID/strings.xml b/res/values-in-rID/strings.xml
index 95ac1ce..315f8e1 100644
--- a/res/values-in-rID/strings.xml
+++ b/res/values-in-rID/strings.xml
@@ -43,4 +43,5 @@
"Tingkat kepentingan: tinggi"
"Dijeda di latar belakang"
"Panggilan sedang berlangsung…"
+ "Belum disetel"
diff --git a/res/values-it-rIT/strings.xml b/res/values-it-rIT/strings.xml
index 2605b5a..590d5f1 100644
--- a/res/values-it-rIT/strings.xml
+++ b/res/values-it-rIT/strings.xml
@@ -43,4 +43,5 @@
"Importanza elevata"
"In pausa in background"
"Chiamata in corso…"
+ "Non impostato"
diff --git a/res/values-iw-rIL/strings.xml b/res/values-iw-rIL/strings.xml
index 3d20c62..1ee79b6 100644
--- a/res/values-iw-rIL/strings.xml
+++ b/res/values-iw-rIL/strings.xml
@@ -43,4 +43,5 @@
"חשיבות גבוהה"
"עצר ברקע"
"שיחה מתבצעת…"
+ "לא מוגדרת"
diff --git a/res/values-ja-rJP/strings.xml b/res/values-ja-rJP/strings.xml
index ade98a7..e159492 100644
--- a/res/values-ja-rJP/strings.xml
+++ b/res/values-ja-rJP/strings.xml
@@ -43,4 +43,5 @@
"重要度: 高"
"バックグラウンド一時停止"
"通話中…"
+ "未設定"
diff --git a/res/values-ko-rKR/strings.xml b/res/values-ko-rKR/strings.xml
index 050da55..038bdac 100644
--- a/res/values-ko-rKR/strings.xml
+++ b/res/values-ko-rKR/strings.xml
@@ -43,4 +43,5 @@
"중요도가 높은 알림 채널"
"백그라운드에서 일시중지되었습니다"
"전화 거는 중…"
+ "설정되지 않음"
diff --git a/res/values-nl-rNL/strings.xml b/res/values-nl-rNL/strings.xml
index eab7f02..fddacfe 100644
--- a/res/values-nl-rNL/strings.xml
+++ b/res/values-nl-rNL/strings.xml
@@ -43,4 +43,5 @@
"Groot belang"
"Onderbr. op achtergrond"
"Actief gesprek…"
+ "Niet ingesteld"
diff --git a/res/values-pl-rPL/strings.xml b/res/values-pl-rPL/strings.xml
index 2c64051..aa83660 100644
--- a/res/values-pl-rPL/strings.xml
+++ b/res/values-pl-rPL/strings.xml
@@ -43,4 +43,5 @@
"Bardzo ważne"
"Wstrzymane w tle"
"Połączenie w toku…"
+ "Nie ustawiono"
diff --git a/res/values-pt-rBR/strings.xml b/res/values-pt-rBR/strings.xml
index c633ed6..f14e5e0 100644
--- a/res/values-pt-rBR/strings.xml
+++ b/res/values-pt-rBR/strings.xml
@@ -43,4 +43,5 @@
"Importância elevada"
"Paus. em segundo plano"
"Chamada em andamento…"
+ "Não definido"
diff --git a/res/values-pt-rPT/strings.xml b/res/values-pt-rPT/strings.xml
index 86f5cca..ef163e5 100644
--- a/res/values-pt-rPT/strings.xml
+++ b/res/values-pt-rPT/strings.xml
@@ -43,4 +43,5 @@
"Importância alta"
"Interrompida em 2º plano"
"Chamada em curso…"
+ "Não definido"
diff --git a/res/values-ro-rRO/strings.xml b/res/values-ro-rRO/strings.xml
index c0cb34b..bf7d107 100644
--- a/res/values-ro-rRO/strings.xml
+++ b/res/values-ro-rRO/strings.xml
@@ -43,4 +43,5 @@
"Importanță ridicată"
"Întreruptă în fundal"
"Se apelează…"
+ "Nesetată"
diff --git a/res/values-ru-rRU/strings.xml b/res/values-ru-rRU/strings.xml
index 335cc84..26355be 100644
--- a/res/values-ru-rRU/strings.xml
+++ b/res/values-ru-rRU/strings.xml
@@ -43,4 +43,5 @@
"Высокая важность"
"Приостановлено в фоновом режиме"
"Выполняется телефонный звонок…"
+ "Не указано"
diff --git a/res/values-sk-rSK/strings.xml b/res/values-sk-rSK/strings.xml
index 048e540..b06c528 100644
--- a/res/values-sk-rSK/strings.xml
+++ b/res/values-sk-rSK/strings.xml
@@ -43,4 +43,5 @@
"Vysoká dôležitosť"
"Pozastavené na pozadí"
"Prebieha hovor…"
+ "Nenastavené"
diff --git a/res/values-sl-rSI/strings.xml b/res/values-sl-rSI/strings.xml
index 378f5fa..cb0aadb 100644
--- a/res/values-sl-rSI/strings.xml
+++ b/res/values-sl-rSI/strings.xml
@@ -43,4 +43,5 @@
"Visoka pomembnost"
"Začas. ustav. v ozadju"
"Klic poteka …"
+ "Ni nastavljeno"
diff --git a/res/values-sr-rCS/strings.xml b/res/values-sr-rCS/strings.xml
index efbc8aa..96168d1 100644
--- a/res/values-sr-rCS/strings.xml
+++ b/res/values-sr-rCS/strings.xml
@@ -43,4 +43,5 @@
"Велика важност"
"Паузирано у позадини"
"Позивање је у току…"
+ "Није подешено"
diff --git a/res/values-sv-rSE/strings.xml b/res/values-sv-rSE/strings.xml
index 04daa6e..9e6ae92 100644
--- a/res/values-sv-rSE/strings.xml
+++ b/res/values-sv-rSE/strings.xml
@@ -43,4 +43,5 @@
"Viktig avisering"
"Pausad i bakgrunden"
"Samtal pågår…"
+ "Inte angett"
diff --git a/res/values-ta-rIN/strings.xml b/res/values-ta-rIN/strings.xml
index 73189d0..409dfc8 100644
--- a/res/values-ta-rIN/strings.xml
+++ b/res/values-ta-rIN/strings.xml
@@ -43,4 +43,5 @@
"அதிக முக்கியத்துவம்"
"பின்புலத்தில் இடைநிறுத்தப்பட்டது"
"அழைப்பில்…"
+ "அமைக்கப்படவில்லை"
diff --git a/res/values-tr-rTR/strings.xml b/res/values-tr-rTR/strings.xml
index 7d0ccba..395b9c3 100644
--- a/res/values-tr-rTR/strings.xml
+++ b/res/values-tr-rTR/strings.xml
@@ -43,4 +43,5 @@
"Önem düzeyi yüksek"
"Arka planda duraklatıldı"
"Çağrı sürüyor…"
+ "Ayarlanmadı"
diff --git a/res/values-uk-rUA/strings.xml b/res/values-uk-rUA/strings.xml
index 0915608..ebc4345 100644
--- a/res/values-uk-rUA/strings.xml
+++ b/res/values-uk-rUA/strings.xml
@@ -43,4 +43,5 @@
"Високий пріоритет"
"Призупинено у фонов.реж"
"Виконується телефонний дзвінок…"
+ "Не налаштовано"
diff --git a/res/values-ur-rPK/strings.xml b/res/values-ur-rPK/strings.xml
index 8465443..5d6d589 100644
--- a/res/values-ur-rPK/strings.xml
+++ b/res/values-ur-rPK/strings.xml
@@ -43,4 +43,5 @@
"زیادہ اہمیت"
"پس منظر میں موقوف ہوگیا"
"کال کی جا رہی ہے…"
+ "سیٹ نہیں ہے"
diff --git a/res/values-vi-rVN/strings.xml b/res/values-vi-rVN/strings.xml
index 4dc169b..dd25eba 100644
--- a/res/values-vi-rVN/strings.xml
+++ b/res/values-vi-rVN/strings.xml
@@ -43,4 +43,5 @@
"Tầm quan trọng cao"
"Đã tạm dừng trong nền"
"Cuộc gọi đang diễn ra…"
+ "Chưa đặt"
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml
index 5c32a01..e399975 100644
--- a/res/values-zh-rCN/strings.xml
+++ b/res/values-zh-rCN/strings.xml
@@ -43,4 +43,5 @@
"重要性:高"
"已在后台暂停"
"正在通话…"
+ "未设置"
diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml
index 70209c7..fff29f2 100644
--- a/res/values-zh-rTW/strings.xml
+++ b/res/values-zh-rTW/strings.xml
@@ -43,4 +43,5 @@
"高重要性"
"在背景中暫停"
"通話中…"
+ "未設定"
diff --git a/res/values/strings.xml b/res/values/strings.xml
index fcbcd94..b6a0270 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -7,6 +7,7 @@
"SIM request failed (code %1$d)"
"You have to restart the application to apply changes"
"SIM card missing"
+ Not set
"Download 7SIM exclusively from the official GitHub page. Files from unknown sources can be malicious!"
diff --git a/settings.gradle b/settings.gradle
index e4eb3aa..430f371 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -20,11 +20,15 @@ dependencyResolutionManagement {
rootProject.name = '7SIM'
-include ':SettingsLib'
+include ':SettingsLib:BannerMessagePreference'
+include ':SettingsLib:CollapsingToolbarBaseActivity'
+include ':SettingsLib:MainSwitchPreference'
+include ':SettingsLib:SettingsTheme'
+include ':SettingsLib:TwoTargetPreference'
include ':SettingsLib:Utils'
android {
- compileSdk 33
+ compileSdk 34
minSdk 29
// TODO: b/317358817 com.android.settings plugin doesn't recognize targetSdk
// targetSdk 33
diff --git a/src/com/github/iusmac/sevensim/ApplicationInfo.java b/src/com/github/iusmac/sevensim/ApplicationInfo.java
index b451cd3..f65271d 100644
--- a/src/com/github/iusmac/sevensim/ApplicationInfo.java
+++ b/src/com/github/iusmac/sevensim/ApplicationInfo.java
@@ -4,14 +4,12 @@
import android.content.Intent;
import android.content.res.Resources;
import android.net.Uri;
-import android.os.Build;
import android.provider.Settings;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.Signature;
import androidx.annotation.NonNull;
-import androidx.annotation.RequiresApi;
import dagger.hilt.android.qualifiers.ApplicationContext;
@@ -57,7 +55,7 @@ public boolean hasAospPlatformSignature() {
*/
public @NonNull String getPackageVersionName() {
try {
- final PackageInfo packageInfo = getPackageInfo(0);
+ final PackageInfo packageInfo = mPackageManager.getPackageInfo(mPackageName, 0);
return packageInfo.versionName;
} catch (PackageManager.NameNotFoundException e) {
return "";
@@ -70,7 +68,8 @@ public boolean hasAospPlatformSignature() {
*/
public boolean isSystemApplication() {
try {
- final android.content.pm.ApplicationInfo appInfo = getApplicationInfo(0);
+ final android.content.pm.ApplicationInfo appInfo =
+ mPackageManager.getApplicationInfo(mPackageName, 0);
// Note that, an application is considered as a system application when it's either
// pre-installed in the device's system partition as part of the ROM, or be deliberately
// placed by the user under the system{_ext}/priv-app folder. Additionally, the system
@@ -102,77 +101,10 @@ public Intent getAppDetailsSettingsActivityIntent() {
private Signature[] getPackageSigners() {
try {
final int flags = PackageManager.GET_SIGNING_CERTIFICATES;
- final PackageInfo packageInfo = getPackageInfo(flags);
+ final PackageInfo packageInfo = mPackageManager.getPackageInfo(mPackageName, flags);
return packageInfo.signingInfo.getApkContentsSigners();
} catch (PackageManager.NameNotFoundException e) {
return new Signature[0];
}
}
-
- /**
- * @param flags The combination of flag bits for {@link PackageInfo}.
- * @return A {@link PackageInfo} containing info about this package.
- */
- private PackageInfo getPackageInfo(final int flags)
- throws PackageManager.NameNotFoundException {
-
- if (Utils.IS_AT_LEAST_T) {
- return Api33Impl.getPackageInfo(mPackageManager, mPackageName, flags);
- } else {
- return ApiDeprecated.getPackageInfo(mPackageManager, mPackageName, flags);
- }
- }
-
- /**
- * @param flags The combination of flag bits for {@link ApplicationInfo}.
- * @return A {@link ApplicationInfo} containing info about this application.
- */
- private android.content.pm.ApplicationInfo getApplicationInfo(final int flags)
- throws PackageManager.NameNotFoundException {
-
- if (Utils.IS_AT_LEAST_T) {
- return Api33Impl.getApplicationInfo(mPackageManager, mPackageName, flags);
- } else {
- return ApiDeprecated.getApplicationInfo(mPackageManager, mPackageName, flags);
- }
- }
-
- /**
- * Nested class to avoid verification errors for methods introduced in Android 13 (API 33).
- */
- @RequiresApi(Build.VERSION_CODES.TIRAMISU)
- private static class Api33Impl {
- private static PackageInfo getPackageInfo(final PackageManager pm, final String packageName,
- final int flags) throws PackageManager.NameNotFoundException {
-
- return pm.getPackageInfo(packageName, PackageManager.PackageInfoFlags.of(flags));
- }
-
- private static android.content.pm.ApplicationInfo getApplicationInfo(
- final PackageManager pm, final String packageName, final int flags)
- throws PackageManager.NameNotFoundException {
-
- return pm.getApplicationInfo(packageName,
- PackageManager.ApplicationInfoFlags.of(flags));
- }
- }
-
- /**
- * Nested class to suppress warnings only for API methods annotated as Deprecated.
- */
- @SuppressWarnings("deprecation")
- private static class ApiDeprecated {
- private static PackageInfo getPackageInfo(final PackageManager pm, final String packageName,
- final int flags) throws PackageManager.NameNotFoundException {
-
- return pm.getPackageInfo(packageName, flags);
- }
-
- private static android.content.pm.ApplicationInfo getApplicationInfo(
- final PackageManager pm, final String packageName, final int flags)
- throws PackageManager.NameNotFoundException {
-
- return pm.getApplicationInfo(packageName, flags);
- }
- }
}
diff --git a/src/com/github/iusmac/sevensim/NotificationManager.java b/src/com/github/iusmac/sevensim/NotificationManager.java
index 9b03f6c..c29773f 100644
--- a/src/com/github/iusmac/sevensim/NotificationManager.java
+++ b/src/com/github/iusmac/sevensim/NotificationManager.java
@@ -84,7 +84,9 @@ void showBackgroundRestrictedNotification() {
.setAutoCancel(true)
.build();
- mNotificationManagerCompat.notify(BACKGROUND_RESTRICTED_NOTIFICATION_ID, notification);
+ try {
+ mNotificationManagerCompat.notify(BACKGROUND_RESTRICTED_NOTIFICATION_ID, notification);
+ } catch (SecurityException ignored) {}
}
/**
diff --git a/src/com/github/iusmac/sevensim/Utils.java b/src/com/github/iusmac/sevensim/Utils.java
index 5855075..f1f888e 100644
--- a/src/com/github/iusmac/sevensim/Utils.java
+++ b/src/com/github/iusmac/sevensim/Utils.java
@@ -4,12 +4,8 @@
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Build;
-import android.os.Bundle;
import android.widget.Toast;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.annotation.RequiresApi;
import androidx.core.content.ContextCompat;
public final class Utils {
@@ -18,25 +14,8 @@ public final class Utils {
public static final boolean IS_AT_LEAST_S = Build.VERSION.SDK_INT >= Build.VERSION_CODES.S;
public static final boolean IS_AT_LEAST_T =
Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU;
-
- /**
- * This a backport of the {@code #BundleCompat.getParcelable} from AndroidX Core v1.10.0
- * library to support SDK 33+ APIs.
- * @see https://issuetracker.google.com/issues/242048899
- */
- @Nullable
- @SuppressWarnings({"deprecation"})
- public static T getParcelable(final @NonNull Bundle in, final @Nullable String key,
- final @NonNull Class clazz) {
-
- // Even though API was introduced in 33, we use 34 as 33 is bugged in some scenarios.
- if (Build.VERSION.SDK_INT >= 34) {
- return Api33Impl.getParcelable(in, key, clazz);
- } else {
- final T parcelable = in.getParcelable(key);
- return clazz.isInstance(parcelable) ? parcelable : null;
- }
- }
+ public static final boolean IS_AT_LEAST_U = Build.VERSION.SDK_INT >=
+ Build.VERSION_CODES.UPSIDE_DOWN_CAKE;
/**
* @param context The application context.
@@ -105,17 +84,6 @@ public static float lerp(final float startValue, final float endValue, final flo
return startValue + (fraction * (endValue - startValue));
}
- /**
- * Nested class to avoid verification errors for methods introduced in Android 13 (API 33).
- */
- @RequiresApi(Build.VERSION_CODES.TIRAMISU)
- private static class Api33Impl {
- private static T getParcelable(final Bundle in, final String key,
- final Class clazz) {
- return in.getParcelable(key, clazz);
- }
- }
-
/** Do not initialize. */
private Utils() {}
}
diff --git a/src/com/github/iusmac/sevensim/launcher/QsAppLauncherTileService.java b/src/com/github/iusmac/sevensim/launcher/QsAppLauncherTileService.java
index 69fe8ad..f9b0098 100644
--- a/src/com/github/iusmac/sevensim/launcher/QsAppLauncherTileService.java
+++ b/src/com/github/iusmac/sevensim/launcher/QsAppLauncherTileService.java
@@ -1,11 +1,14 @@
package com.github.iusmac.sevensim.launcher;
+import android.app.PendingIntent;
import android.content.Intent;
+import android.os.UserHandle;
import android.service.quicksettings.Tile;
import android.service.quicksettings.TileService;
import android.text.TextUtils;
import com.github.iusmac.sevensim.R;
+import com.github.iusmac.sevensim.Utils;
import com.github.iusmac.sevensim.ui.MainActivity;
public final class QsAppLauncherTileService extends TileService {
@@ -27,7 +30,13 @@ public void onStartListening() {
public void onClick() {
final Intent aIntent = new Intent(this, MainActivity.class);
aIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
- startActivityAndCollapse(aIntent);
+ if (Utils.IS_AT_LEAST_U) {
+ startActivityAndCollapse(PendingIntent.getActivityAsUser(this, /*requestCode=*/ 0,
+ aIntent, PendingIntent.FLAG_IMMUTABLE, /*bundle=*/ null,
+ UserHandle.CURRENT));
+ } else {
+ ApiDeprecated.startActivityAndCollapse(this, aIntent);
+ }
}
private void updateTileStrings() {
@@ -39,4 +48,12 @@ private void updateTileStrings() {
tile.updateTile();
}
}
+
+ /** Nested class to suppress warning only for API methods annotated as Deprecated. */
+ @SuppressWarnings("deprecation")
+ private static class ApiDeprecated {
+ static void startActivityAndCollapse(final TileService service, final Intent intent) {
+ service.startActivityAndCollapse(intent);
+ }
+ }
}
diff --git a/src/com/github/iusmac/sevensim/telephony/Subscriptions.java b/src/com/github/iusmac/sevensim/telephony/Subscriptions.java
index 4063d25..b349a08 100644
--- a/src/com/github/iusmac/sevensim/telephony/Subscriptions.java
+++ b/src/com/github/iusmac/sevensim/telephony/Subscriptions.java
@@ -216,7 +216,7 @@ protected void persistSubscription(final Subscription sub) {
// alterations from outside
persistSubscriptionState(sub.getId(), sub.getSimState());
- mSubscriptionsDao.insertOrUpdate(sub);
+ mSubscriptionsDao.upsert(sub);
}
/**
diff --git a/src/com/github/iusmac/sevensim/telephony/SubscriptionsDao.java b/src/com/github/iusmac/sevensim/telephony/SubscriptionsDao.java
index d7d9aa0..3587c11 100644
--- a/src/com/github/iusmac/sevensim/telephony/SubscriptionsDao.java
+++ b/src/com/github/iusmac/sevensim/telephony/SubscriptionsDao.java
@@ -3,33 +3,26 @@
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
-import androidx.room.OnConflictStrategy;
import androidx.room.Query;
-import androidx.room.Transaction;
import androidx.room.Update;
+import androidx.room.Upsert;
import java.util.Optional;
@Dao
-public abstract class SubscriptionsDao {
- @Insert(onConflict = OnConflictStrategy.IGNORE)
- public abstract long insert(Subscription subscription);
+public interface SubscriptionsDao {
+ @Insert
+ long insert(Subscription subscription);
@Update
- public abstract int update(Subscription subscription);
+ int update(Subscription subscription);
- @Transaction
- // TODO: switch to @Upsert added in Room v2.5.0-alpha03; also drop onConflict from insert()
- public void insertOrUpdate(final Subscription subscription) {
- final long id = insert(subscription);
- if (id == -1L) {
- update(subscription);
- }
- }
+ @Upsert
+ void upsert(final Subscription subscription);
@Delete
- public abstract void delete(Subscription subscription);
+ void delete(Subscription subscription);
@Query("SELECT * FROM subscriptions WHERE id = :subId")
- public abstract Optional findBySubscriptionId(int subId);
+ Optional findBySubscriptionId(int subId);
}
diff --git a/src/com/github/iusmac/sevensim/telephony/TelephonyController.java b/src/com/github/iusmac/sevensim/telephony/TelephonyController.java
index 5ccf186..4a6c440 100644
--- a/src/com/github/iusmac/sevensim/telephony/TelephonyController.java
+++ b/src/com/github/iusmac/sevensim/telephony/TelephonyController.java
@@ -6,6 +6,7 @@
import androidx.annotation.GuardedBy;
import androidx.annotation.WorkerThread;
+import androidx.core.os.BundleCompat;
import com.github.iusmac.sevensim.Logger;
import com.github.iusmac.sevensim.R;
@@ -270,7 +271,7 @@ private void handleOnSetSimPowerStateForSlotFinished(final int resCode) {
}
}
- final Subscription sub = Utils.getParcelable(mRequestMetadata, KEY_SUBSCRIPTION,
+ final Subscription sub = BundleCompat.getParcelable(mRequestMetadata, KEY_SUBSCRIPTION,
Subscription.class);
final boolean expectedEnabled = sub.isSimEnabled();
@@ -365,7 +366,7 @@ public void onSimStatusChanged(final int slotIndex,
default: return;
}
- final Subscription sub = Utils.getParcelable(mRequestMetadata, KEY_SUBSCRIPTION,
+ final Subscription sub = BundleCompat.getParcelable(mRequestMetadata, KEY_SUBSCRIPTION,
Subscription.class);
if (sub.getSlotIndex() != slotIndex) {
diff --git a/src/com/github/iusmac/sevensim/ui/components/CollapsingToolbarBaseActivity.java b/src/com/github/iusmac/sevensim/ui/components/CollapsingToolbarBaseActivity.java
index 0a0ce14..d6e1300 100644
--- a/src/com/github/iusmac/sevensim/ui/components/CollapsingToolbarBaseActivity.java
+++ b/src/com/github/iusmac/sevensim/ui/components/CollapsingToolbarBaseActivity.java
@@ -57,7 +57,7 @@ protected void onCreate(final @Nullable Bundle savedInstanceState) {
// content view background as we display a subtitle text that may fuse visually with
// other text
getCollapsingToolbarLayout()
- .setContentScrimResource(com.android.settingslib.widget.R.color.settingslib_colorSurfaceHeader);
+ .setContentScrimResource(com.android.settingslib.widget.theme.R.color.settingslib_colorSurfaceHeader);
} else {
// For better UX (e.g. l10n), apply the marquee effect on the title for non-collapsing
// Toolbar
diff --git a/src/com/github/iusmac/sevensim/ui/components/TimePickerPreference.java b/src/com/github/iusmac/sevensim/ui/components/TimePickerPreference.java
index dc1b4a5..10679d3 100644
--- a/src/com/github/iusmac/sevensim/ui/components/TimePickerPreference.java
+++ b/src/com/github/iusmac/sevensim/ui/components/TimePickerPreference.java
@@ -16,6 +16,8 @@
import androidx.preference.DialogPreference;
import androidx.preference.Preference;
+import com.github.iusmac.sevensim.R;
+
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
@@ -223,7 +225,7 @@ private SimpleSummaryProvider() {}
public @Nullable CharSequence provideSummary(final @NonNull TimePickerPreference preference) {
final CharSequence time = preference.getTime();
return time != null ? time :
- preference.getContext().getString(androidx.preference.R.string.not_set);
+ preference.getContext().getString(R.string.preference_not_set);
}
}
}
diff --git a/src/com/github/iusmac/sevensim/ui/license/LicenseActivity.java b/src/com/github/iusmac/sevensim/ui/license/LicenseActivity.java
index afa5809..6c80b00 100644
--- a/src/com/github/iusmac/sevensim/ui/license/LicenseActivity.java
+++ b/src/com/github/iusmac/sevensim/ui/license/LicenseActivity.java
@@ -5,8 +5,6 @@
import androidx.lifecycle.ViewModel;
-import com.android.settingslib.widget.R;
-
import com.github.iusmac.sevensim.ui.components.CollapsingToolbarBaseActivity;
public final class LicenseActivity extends CollapsingToolbarBaseActivity {
@@ -22,7 +20,8 @@ protected void onCreate(final Bundle savedInstanceState) {
}
if (savedInstanceState == null) {
- getSupportFragmentManager().beginTransaction().add(R.id.content_frame,
+ getSupportFragmentManager().beginTransaction().add(
+ com.android.settingslib.collapsingtoolbar.R.id.content_frame,
new LicenseFragment()).commit();
}
}
diff --git a/src/com/github/iusmac/sevensim/ui/preferences/PreferenceListActivity.java b/src/com/github/iusmac/sevensim/ui/preferences/PreferenceListActivity.java
index 3d87a43..f759067 100644
--- a/src/com/github/iusmac/sevensim/ui/preferences/PreferenceListActivity.java
+++ b/src/com/github/iusmac/sevensim/ui/preferences/PreferenceListActivity.java
@@ -5,8 +5,6 @@
import androidx.lifecycle.ViewModel;
-import com.android.settingslib.widget.R;
-
import com.github.iusmac.sevensim.Logger;
import com.github.iusmac.sevensim.ui.components.CollapsingToolbarBaseActivity;
@@ -30,7 +28,8 @@ protected void onCreate(final Bundle savedInstanceState) {
mLogger.d("onCreate().");
if (savedInstanceState == null) {
- getSupportFragmentManager().beginTransaction().replace(R.id.content_frame,
+ getSupportFragmentManager().beginTransaction().replace(
+ com.android.settingslib.collapsingtoolbar.R.id.content_frame,
new PreferenceListFragment()).commit();
}
}
diff --git a/src/com/github/iusmac/sevensim/ui/scheduler/SchedulerActivity.java b/src/com/github/iusmac/sevensim/ui/scheduler/SchedulerActivity.java
index 103fabc..f2e9b55 100644
--- a/src/com/github/iusmac/sevensim/ui/scheduler/SchedulerActivity.java
+++ b/src/com/github/iusmac/sevensim/ui/scheduler/SchedulerActivity.java
@@ -10,12 +10,12 @@
import android.view.MenuItem;
import android.view.View;
+import androidx.core.os.BundleCompat;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;
import com.github.iusmac.sevensim.Logger;
import com.github.iusmac.sevensim.R;
-import com.github.iusmac.sevensim.Utils;
import com.github.iusmac.sevensim.scheduler.SubscriptionScheduler;
import com.github.iusmac.sevensim.telephony.Subscription;
import com.github.iusmac.sevensim.telephony.Subscriptions;
@@ -98,7 +98,7 @@ public ViewModel onCreateViewModel() {
throw new IllegalArgumentException("Extra Bundle is NULL!");
}
- mSubscription = Utils.getParcelable(extras, EXTRA_SUBSCRIPTION, Subscription.class);
+ mSubscription = BundleCompat.getParcelable(extras, EXTRA_SUBSCRIPTION, Subscription.class);
final ViewModelProvider.Factory vmpFactory =
SchedulerViewModel.getFactory(mViewModelFactory, mSubscription.getId(),
@@ -136,7 +136,7 @@ protected void onCreate(final Bundle savedInstanceState) {
}
private void commitFragment() {
- final int containerViewId = com.android.settingslib.widget.R.id.content_frame;
+ final int containerViewId = com.android.settingslib.collapsingtoolbar.R.id.content_frame;
getSupportFragmentManager().beginTransaction().add(containerViewId,
new SchedulerFragment()).commit();
}
diff --git a/src/com/github/iusmac/sevensim/ui/sim/SimListActivity.java b/src/com/github/iusmac/sevensim/ui/sim/SimListActivity.java
index e937d9e..a991293 100644
--- a/src/com/github/iusmac/sevensim/ui/sim/SimListActivity.java
+++ b/src/com/github/iusmac/sevensim/ui/sim/SimListActivity.java
@@ -96,7 +96,7 @@ protected void onCreate(final Bundle savedInstanceState) {
private void commitFragment() {
mLogger.d("commitFragment().");
- final int containerViewId = com.android.settingslib.widget.R.id.content_frame;
+ final int containerViewId = com.android.settingslib.collapsingtoolbar.R.id.content_frame;
getSupportFragmentManager().beginTransaction().add(containerViewId,
new SimListFragment()).commit();
}
diff --git a/src/com/github/iusmac/sevensim/ui/sim/SimListFragment.java b/src/com/github/iusmac/sevensim/ui/sim/SimListFragment.java
index f46a37a..ea590d1 100644
--- a/src/com/github/iusmac/sevensim/ui/sim/SimListFragment.java
+++ b/src/com/github/iusmac/sevensim/ui/sim/SimListFragment.java
@@ -94,7 +94,7 @@ private void setupDisclaimerBanner() {
disclaimerBanner
.setAttentionLevel(BannerMessagePreference.AttentionLevel.MEDIUM)
.setPositiveButtonText(
- com.android.settingslib.widget.R.string.accessibility_banner_message_dismiss)
+ com.android.settingslib.widget.preference.banner.R.string.accessibility_banner_message_dismiss)
.setPositiveButtonOnClickListener((view) -> {
disclaimerBanner.setVisible(false);
mSharedPrefs.edit().putBoolean(disclaimerBanner.getKey(), false).apply();