Skip to content

Commit

Permalink
[Health] Remove references to deprecated v1 Android embeddings (#1021)
Browse files Browse the repository at this point in the history
* Remove Google Fit and imports from Android code

* Formatting

* Remove Google Fit column from readme

* Remove support for Google Fit types not supported by Health Connect

* Remove more Google Fit workout types

* Remove references to Google Fit, remove `useHealthConnectIfAvailable`

* Remove `disconect` method channel

* Remove `flowRate` from `writeBloodOxygen` as it is not supported in Health Connect

* Remove more unsupported workout types

* Add missing import

* Remove Google Fit as dependency

* Add notice in README

* Improve logging for HC permission callback

* Update some documentation

* Android: Fix `requestAuthorization` not returning a result on success

* Remove additional workout types that are not supported

* Remove another workout type

* Add missing unimplemented method

* Remove reference to v1 Android embedding
  • Loading branch information
SlimShadyIAm authored Aug 30, 2024
1 parent 4b19432 commit c41ea48
Showing 1 changed file with 0 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
import io.flutter.plugin.common.MethodChannel.Result
import io.flutter.plugin.common.PluginRegistry.ActivityResultListener
import io.flutter.plugin.common.PluginRegistry.Registrar
import java.time.*
import java.time.temporal.ChronoUnit
import java.util.*
Expand Down Expand Up @@ -119,28 +118,6 @@ class HealthPlugin(private var channel: MethodChannel? = null) :
threadPoolExecutor = null
}

// This static function is optional and equivalent to onAttachedToEngine. It supports the
// old
// pre-Flutter-1.12 Android projects. You are encouraged to continue supporting
// plugin registration via this function while apps migrate to use the new Android APIs
// post-flutter-1.12 via https://flutter.dev/go/android-project-migration.
//
// It is encouraged to share logic between onAttachedToEngine and registerWith to keep
// them functionally equivalent. Only one of onAttachedToEngine or registerWith will be
// called
// depending on the user's project. onAttachedToEngine or registerWith must both be defined
// in the same class.
companion object {
@Suppress("unused")
@JvmStatic
fun registerWith(registrar: Registrar) {
val channel = MethodChannel(registrar.messenger(), CHANNEL_NAME)
val plugin = HealthPlugin(channel)
registrar.addActivityResultListener(plugin)
channel.setMethodCallHandler(plugin)
}
}

override fun success(p0: Any?) {
handler?.post { mResult?.success(p0) }
}
Expand Down

0 comments on commit c41ea48

Please sign in to comment.