Skip to content

Commit bdd61b3

Browse files
authored
feat: Various cleanups on Android (#509)
* feat: Various cleanups on Android * changelog merge
1 parent 8901f29 commit bdd61b3

File tree

7 files changed

+12
-30
lines changed

7 files changed

+12
-30
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# next
2+
3+
* Android: Removed jetifier
4+
* Android: Removed V1 plugin APIs - this is now a Android V2 plugin only
5+
16
# 0.5.2
27

38
* Android: Bump to workmanager 2.8.1

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ android {
3636
defaultConfig {
3737
compileSdk 33
3838
minSdkVersion 19
39-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
39+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
4040
}
4141
lintOptions {
4242
disable 'InvalidPackage'

android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
org.gradle.jvmargs=-Xmx1536M
22

33
android.useAndroidX=true
4-
android.enableJetifier=true
4+
android.enableJetifier=false

android/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="dev.fluttercommunity.workmanager">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
23
</manifest>

android/src/main/kotlin/dev/fluttercommunity/workmanager/BackgroundWorker.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,6 @@ class BackgroundWorker(
9494
)
9595
}
9696

97-
// Backwards compatibility with v1. We register all the user's plugins.
98-
WorkmanagerPlugin.pluginRegistryCallback?.registerWith(ShimPluginRegistry(engine!!))
99-
10097
engine?.let { engine ->
10198
backgroundChannel = MethodChannel(engine.dartExecutor, BACKGROUND_CHANNEL_NAME)
10299
backgroundChannel.setMethodCallHandler(this@BackgroundWorker)

android/src/main/kotlin/dev/fluttercommunity/workmanager/WorkmanagerPlugin.kt

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import android.content.Context
44
import io.flutter.embedding.engine.plugins.FlutterPlugin
55
import io.flutter.plugin.common.BinaryMessenger
66
import io.flutter.plugin.common.MethodChannel
7-
import io.flutter.plugin.common.PluginRegistry
87

98
class WorkmanagerPlugin : FlutterPlugin {
109

@@ -30,24 +29,4 @@ class WorkmanagerPlugin : FlutterPlugin {
3029
methodChannel = null
3130
workmanagerCallHandler = null
3231
}
33-
34-
companion object {
35-
var pluginRegistryCallback: PluginRegistry.PluginRegistrantCallback? = null
36-
37-
@JvmStatic
38-
fun registerWith(registrar: PluginRegistry.Registrar) {
39-
val plugin = WorkmanagerPlugin()
40-
plugin.onAttachedToEngine(registrar.context(), registrar.messenger())
41-
registrar.addViewDestroyListener {
42-
plugin.onDetachedFromEngine()
43-
false
44-
}
45-
}
46-
47-
@Deprecated(message = "Use the Android v2 embedding method.")
48-
@JvmStatic
49-
fun setPluginRegistrantCallback(pluginRegistryCallback: PluginRegistry.PluginRegistrantCallback) {
50-
Companion.pluginRegistryCallback = pluginRegistryCallback
51-
}
52-
}
5332
}

example/android/app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ android {
4242
targetSdkVersion 33
4343
versionCode flutterVersionCode.toInteger()
4444
versionName flutterVersionName
45-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
45+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
4646
}
4747

4848
buildTypes {
@@ -76,6 +76,6 @@ flutter {
7676
dependencies {
7777
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
7878
testImplementation 'junit:junit:4.13.2'
79-
androidTestImplementation 'androidx.test:runner:1.5.2'
80-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
79+
androidTestImplementation 'androidx.test:runner:1.2.0'
80+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
8181
}

0 commit comments

Comments
 (0)