Skip to content

Commit 727da9d

Browse files
authored
Merge pull request #38 from SimpleAppProjects/develop
v1.14.0
2 parents 679ed40 + 0ad08dd commit 727da9d

File tree

181 files changed

+10788
-9837
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+10788
-9837
lines changed

build.gradle

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,48 @@ buildscript {
66
minSdkVersion = 24
77
targetSdkVersion = 33
88

9-
kotlin_version = '1.9.0'
10-
kotlinx_version = '1.7.3'
9+
kotlin_version = '1.9.23'
10+
kotlinx_version = '1.8.1'
1111

12-
desugar_version = '2.0.3'
12+
desugar_version = '2.0.4'
1313

14-
firebase_version = '32.3.1'
14+
firebase_version = '32.8.1'
1515

16+
activity_version = '1.9.0'
1617
appcompat_version = '1.6.1'
1718
constraintlayout_version = '2.1.4'
18-
core_version = '1.12.0'
19-
fragment_version = '1.6.1'
20-
lifecycle_version = '2.6.2'
19+
core_version = '1.13.1'
20+
fragment_version = '1.7.1'
21+
lifecycle_version = '2.8.0'
2122
preference_version = '1.2.1'
22-
recyclerview_version = '1.3.1'
23-
coresplash_version = '1.0.0'
24-
work_version = '2.8.1'
23+
recyclerview_version = '1.3.2'
24+
coresplash_version = '1.0.1'
25+
work_version = '2.9.0'
26+
navigation_version = '2.7.7'
2527

2628
test_core_version = '1.5.0'
2729
test_runner_version = '1.5.2'
2830
test_rules_version = '1.5.0'
2931
junit_version = '1.1.5'
3032
androidx_truth_version = '1.5.0'
31-
google_truth_version = '1.1.5'
33+
google_truth_version = '1.4.2'
3234

33-
material_version = '1.9.0'
35+
material_version = '1.12.0'
3436

35-
compose_compiler_version = '1.5.2'
36-
compose_version = '1.5.1'
37-
wear_compose_version = '1.2.0'
38-
horologist_version = '0.4.12'
39-
accompanist_version = '0.30.1'
37+
compose_bom_version = '2024.05.00'
38+
compose_compiler_version = '1.5.13'
39+
wear_compose_version = '1.3.1'
40+
wear_tiles_version = '1.3.0'
41+
wear_watchface_version = '1.2.1'
42+
horologist_version = '0.5.27'
43+
accompanist_version = '0.34.0'
4044

4145
gson_version = '2.10.1'
4246
timber_version = '5.0.1'
4347

4448
// Shizuku
4549
shizuku_version = '13.1.5'
46-
refine_version = '4.3.0'
50+
refine_version = '4.4.0'
4751
}
4852

4953
repositories {
@@ -52,8 +56,8 @@ buildscript {
5256
}
5357

5458
dependencies {
55-
classpath 'com.android.tools.build:gradle:8.1.1'
56-
classpath 'com.google.gms:google-services:4.3.15'
59+
classpath 'com.android.tools.build:gradle:8.4.0'
60+
classpath 'com.google.gms:google-services:4.4.1'
5761
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.9'
5862
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
5963
// NOTE: Do not place your application dependencies here; they belong
@@ -69,6 +73,6 @@ allprojects {
6973
}
7074
}
7175

72-
task clean(type: Delete) {
76+
tasks.register('clean', Delete) {
7377
delete rootProject.buildDir
7478
}

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip

hidden-api/build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ android {
1919
minifyEnabled false
2020
}
2121
release {
22-
minifyEnabled true
22+
// Let the app module take care of this
23+
minifyEnabled false
2324
}
2425
}
2526

@@ -37,7 +38,7 @@ android {
3738
}
3839

3940
dependencies {
40-
annotationProcessor 'dev.rikka.tools.refine:annotation-processor:4.3.0'
41-
compileOnly 'dev.rikka.tools.refine:annotation:4.3.0'
42-
implementation 'androidx.annotation:annotation:1.7.0'
41+
annotationProcessor 'dev.rikka.tools.refine:annotation-processor:4.4.0'
42+
compileOnly 'dev.rikka.tools.refine:annotation:4.4.0'
43+
implementation 'androidx.annotation:annotation:1.8.0'
4344
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package android.content.pm;
2+
3+
import android.os.Binder;
4+
import android.os.Build;
5+
import android.os.IBinder;
6+
import android.os.IInterface;
7+
8+
import androidx.annotation.DeprecatedSinceApi;
9+
10+
public interface IPackageManager extends IInterface {
11+
12+
void grantRuntimePermission(String packageName, String permissionName, int userId);
13+
14+
@DeprecatedSinceApi(api = Build.VERSION_CODES.R)
15+
void revokeRuntimePermission(String packageName, String permissionName, int userId);
16+
17+
abstract class Stub extends Binder implements IPackageManager {
18+
public static IPackageManager asInterface(IBinder obj) {
19+
throw new RuntimeException("Stub!");
20+
}
21+
}
22+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package android.location;
2+
3+
import android.os.Binder;
4+
import android.os.Build;
5+
import android.os.IBinder;
6+
import android.os.IInterface;
7+
8+
import androidx.annotation.RequiresApi;
9+
10+
public interface ILocationManager extends IInterface {
11+
12+
@RequiresApi(api = Build.VERSION_CODES.P)
13+
void setLocationEnabledForUser(boolean enabled, int userId);
14+
15+
abstract class Stub extends Binder implements ILocationManager {
16+
public static ILocationManager asInterface(IBinder obj) {
17+
throw new RuntimeException("Stub!");
18+
}
19+
}
20+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package android.net;
2+
3+
import android.os.Binder;
4+
import android.os.Build;
5+
import android.os.IBinder;
6+
import android.os.IInterface;
7+
import android.os.ResultReceiver;
8+
9+
import androidx.annotation.DeprecatedSinceApi;
10+
11+
public interface IConnectivityManager extends IInterface {
12+
@DeprecatedSinceApi(api = Build.VERSION_CODES.R)
13+
void startTethering(int type, ResultReceiver receiver, boolean showProvisioningUi);
14+
15+
@DeprecatedSinceApi(api = Build.VERSION_CODES.R)
16+
void stopTethering(int type);
17+
18+
abstract class Stub extends Binder implements IConnectivityManager {
19+
public static IConnectivityManager asInterface(IBinder obj) {
20+
throw new RuntimeException("Stub!");
21+
}
22+
}
23+
}

mobile/build.gradle

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ android {
2121
minSdkVersion rootProject.minSdkVersion
2222
targetSdkVersion rootProject.targetSdkVersion
2323
// NOTE: Version Code Format [TargetSDK, Version Name, Build Number, Variant Code (Android: 00, WearOS: 01)]
24-
versionCode 331913100
25-
versionName "1.13.1"
24+
versionCode 331914040
25+
versionName "1.14.0"
2626

2727
vectorDrawables.useSupportLibrary = true
2828
}
@@ -90,14 +90,16 @@ dependencies {
9090
implementation "androidx.core:core-splashscreen:$coresplash_version"
9191

9292
implementation 'com.google.android.gms:play-services-wearable:18.1.0'
93+
implementation 'com.google.android.play:app-update-ktx:2.1.0'
9394

9495
implementation platform("com.google.firebase:firebase-bom:$firebase_version")
9596
implementation 'com.google.firebase:firebase-analytics'
9697
implementation 'com.google.firebase:firebase-crashlytics'
98+
implementation 'com.google.firebase:firebase-config'
9799

98100
implementation "androidx.appcompat:appcompat:$appcompat_version"
99101
implementation "androidx.constraintlayout:constraintlayout:$constraintlayout_version"
100-
implementation 'androidx.media:media:1.6.0'
102+
implementation 'androidx.media:media:1.7.0'
101103

102104
implementation "com.google.android.material:material:$material_version"
103105

mobile/src/main/AndroidManifest.xml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434
<!-- InCallController permissions -->
3535
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
3636
<uses-permission android:name="android.permission.READ_CONTACTS" />
37-
<uses-permission android:name="android.permission.MANAGE_ONGOING_CALLS" />
37+
<uses-permission
38+
android:name="android.permission.MANAGE_ONGOING_CALLS"
39+
tools:ignore="ProtectedPermissions" />
3840
<uses-permission android:name="android.permission.REQUEST_COMPANION_PROFILE_WATCH" />
3941
<uses-permission android:name="android.permission.REQUEST_COMPANION_START_FOREGROUND_SERVICES_FROM_BACKGROUND" />
4042

@@ -52,6 +54,8 @@
5254
<queries>
5355
<package android:name="com.thewizrd.simplesleeptimer" />
5456
<package android:name="com.thewizrd.simplesleeptimer.debug" />
57+
<package android:name="com.thewizrd.wearsettings" />
58+
<package android:name="com.thewizrd.wearsettings.debug" />
5559

5660
<intent>
5761
<action android:name="android.intent.action.MAIN" />
@@ -174,6 +178,18 @@
174178
</intent-filter>
175179
</receiver>
176180

181+
<provider
182+
android:name="androidx.startup.InitializationProvider"
183+
android:authorities="${applicationId}.androidx-startup"
184+
android:exported="false"
185+
tools:node="merge">
186+
<!-- If you are using androidx.startup to initialize other components -->
187+
<meta-data
188+
android:name="androidx.work.WorkManagerInitializer"
189+
android:value="androidx.startup"
190+
tools:node="remove" />
191+
</provider>
192+
177193
</application>
178194

179195
</manifest>

mobile/src/main/java/com/thewizrd/simplewear/App.kt

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import com.thewizrd.shared_resources.helpers.AppState
3434
import com.thewizrd.shared_resources.utils.CrashlyticsLoggingTree
3535
import com.thewizrd.shared_resources.utils.JSONParser
3636
import com.thewizrd.shared_resources.utils.Logger
37+
import com.thewizrd.simplewear.camera.TorchListener
3738
import com.thewizrd.simplewear.media.MediaControllerService
3839
import com.thewizrd.simplewear.services.CallControllerService
3940
import com.thewizrd.simplewear.telephony.SubscriptionListener
@@ -183,6 +184,13 @@ class App : Application(), ApplicationLib, ActivityLifecycleCallbacks, Configura
183184
}
184185
}
185186

187+
runCatching {
188+
if (appContext.packageManager.hasSystemFeature(PackageManager.FEATURE_CAMERA_FLASH)) {
189+
// Register listener for camera flash
190+
TorchListener.registerListener(appContext)
191+
}
192+
}
193+
186194
val oldHandler = Thread.getDefaultUncaughtExceptionHandler()
187195
Thread.setDefaultUncaughtExceptionHandler { t, e ->
188196
Logger.writeLine(Log.ERROR, e, "Uncaught exception!")
@@ -214,6 +222,8 @@ class App : Application(), ApplicationLib, ActivityLifecycleCallbacks, Configura
214222
}
215223

216224
override fun onTerminate() {
225+
SubscriptionListener.unregisterListener(appContext)
226+
TorchListener.unregisterListener(appContext)
217227
contentResolver.unregisterContentObserver(mContentObserver)
218228
appContext.unregisterReceiver(mActionsReceiver)
219229
// Shutdown logger
@@ -245,9 +255,8 @@ class App : Application(), ApplicationLib, ActivityLifecycleCallbacks, Configura
245255
}
246256
}
247257

248-
override fun getWorkManagerConfiguration(): Configuration {
249-
return Configuration.Builder()
258+
override val workManagerConfiguration: Configuration
259+
get() = Configuration.Builder()
250260
.setMinimumLoggingLevel(if (BuildConfig.DEBUG) Log.DEBUG else Log.INFO)
251261
.build()
252-
}
253262
}
Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,34 @@
11
package com.thewizrd.simplewear
22

3+
import android.content.Intent
34
import android.os.Bundle
45
import android.view.View
56
import android.view.ViewTreeObserver
67
import androidx.appcompat.app.AppCompatActivity
78
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
9+
import androidx.lifecycle.lifecycleScope
810
import com.google.android.material.appbar.AppBarLayout
911
import com.google.android.material.color.DynamicColors
12+
import com.thewizrd.simplewear.updates.InAppUpdateManager
13+
import kotlinx.coroutines.launch
1014

1115
class MainActivity : AppCompatActivity() {
16+
companion object {
17+
private const val INSTALL_REQUESTCODE = 168
18+
}
19+
20+
private lateinit var inAppUpdateManager: InAppUpdateManager
1221
private var isReadyToView = false
1322

1423
override fun onCreate(savedInstanceState: Bundle?) {
24+
installSplashScreen()
1525
super.onCreate(savedInstanceState)
1626

17-
val splashScreen = installSplashScreen()
18-
1927
// Note: needed due to splash screen theme
2028
DynamicColors.applyIfAvailable(this)
2129

30+
inAppUpdateManager = InAppUpdateManager.create(applicationContext)
31+
2232
// Stop activity from rendering until next activity or if immediate update available
2333
val content = findViewById<View>(android.R.id.content)
2434
content.viewTreeObserver.addOnPreDrawListener(object : ViewTreeObserver.OnPreDrawListener {
@@ -34,18 +44,45 @@ class MainActivity : AppCompatActivity() {
3444

3545
setContentView(R.layout.activity_main)
3646

37-
// Check if fragment exists
38-
if (supportFragmentManager.findFragmentById(R.id.fragment_container) == null) {
39-
supportFragmentManager.beginTransaction()
40-
.replace(R.id.fragment_container, PermissionCheckFragment())
41-
.runOnCommit {
42-
isReadyToView = true
47+
lifecycleScope.launch {
48+
if (inAppUpdateManager.shouldStartImmediateUpdateFlow()) {
49+
inAppUpdateManager.startImmediateUpdateFlow(this@MainActivity, INSTALL_REQUESTCODE)
50+
} else {
51+
// Check if fragment exists
52+
if (supportFragmentManager.findFragmentById(R.id.fragment_container) == null) {
53+
supportFragmentManager.beginTransaction()
54+
.replace(R.id.fragment_container, PermissionCheckFragment())
55+
.runOnCommit {
56+
isReadyToView = true
57+
}
58+
.commit()
4359
}
44-
.commit()
60+
}
4561
}
4662

4763
val appBarLayout = findViewById<AppBarLayout>(R.id.app_bar)
4864
appBarLayout.liftOnScrollTargetViewId = R.id.scrollView
4965
appBarLayout.isLiftOnScroll = true
5066
}
67+
68+
override fun onResume() {
69+
super.onResume()
70+
71+
// Checks that the update is not stalled during 'onResume()'.
72+
// However, you should execute this check at all entry points into the app.
73+
inAppUpdateManager.resumeUpdateIfStarted(this, INSTALL_REQUESTCODE)
74+
isReadyToView = true
75+
}
76+
77+
@Deprecated("Deprecated in Java")
78+
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
79+
if (requestCode == INSTALL_REQUESTCODE) {
80+
if (resultCode != RESULT_OK) {
81+
// Update flow failed; exit
82+
finishAffinity()
83+
}
84+
} else {
85+
super.onActivityResult(requestCode, resultCode, data)
86+
}
87+
}
5188
}

0 commit comments

Comments
 (0)