Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/connectivity/ios/Classes/ConnectivityPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ - (NSString*)convertCLAuthorizationStatusToString:(CLAuthorizationStatus)status
case kCLAuthorizationStatusAuthorizedWhenInUse: {
return @"authorizedWhenInUse";
}
default: { return @"unknown"; }
default: {
return @"unknown";
}
}
}

Expand Down
7 changes: 3 additions & 4 deletions packages/sensors/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,9 @@ afterEvaluate {
android {
dependencies {
def lifecycle_version = "2.1.0"

compileOnly "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
compileOnly "androidx.lifecycle:lifecycle-runtime:$lifecycle_version"
api "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
api "androidx.lifecycle:lifecycle-runtime:$lifecycle_version"
}
}
}
}
}
3 changes: 0 additions & 3 deletions packages/sensors/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,13 @@ public static void registerWith(Registrar registrar) {

@Override
public void onAttachedToEngine(FlutterPluginBinding binding) {
Context context = binding.getApplicationContext();
final Context context = binding.getApplicationContext();
setupEventChannels(context, binding.getFlutterEngine().getDartExecutor());
}

@Override
public void onDetachedFromEngine(FlutterPluginBinding binding) {
accelerometerChannel.setStreamHandler(null);
userAccelChannel.setStreamHandler(null);
gyroscopeChannel.setStreamHandler(null);
teardownEventChannels();
}

private void setupEventChannels(Context context, BinaryMessenger messenger) {
Expand All @@ -65,4 +63,10 @@ private void setupEventChannels(Context context, BinaryMessenger messenger) {
Sensor.TYPE_GYROSCOPE);
gyroscopeChannel.setStreamHandler(gyroScopeStreamHandler);
}

private void teardownEventChannels() {
accelerometerChannel.setStreamHandler(null);
userAccelChannel.setStreamHandler(null);
gyroscopeChannel.setStreamHandler(null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
android:windowSoftInputMode="adjustResize">
</activity>
<activity android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@android:style/Theme.Black.NoTitleBar"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection"
android:hardwareAccelerated="true"
Expand Down