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 all 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: 4 additions & 0 deletions packages/android_alarm_manager/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## NEXT

* Remove support for the V1 Android embedding.

## 2.0.2

* Update README to point to Plus Plugins version.
Expand Down
49 changes: 0 additions & 49 deletions packages/android_alarm_manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,55 +74,6 @@ will not run in the same isolate as the main application. Unlike threads, isolat
memory and communication between isolates must be done via message passing (see more documentation on
isolates [here](https://api.dart.dev/stable/2.0.0/dart-isolate/dart-isolate-library.html)).


## Using other plugins in alarm callbacks

If alarm callbacks will need access to other Flutter plugins, including the
alarm manager plugin itself, it may be necessary to inform the background service how
to initialize plugins depending on which Flutter Android embedding the application is
using.

### Flutter Android Embedding V1

For the Flutter Android Embedding V1, the background service must be provided a
callback to register plugins with the background isolate. This is done by giving
the `AlarmService` a callback to call the application's `onCreate` method. See the example's
[Application overrides](https://github.com/flutter/plugins/blob/master/packages/android_alarm_manager/example/android/app/src/main/java/io/flutter/plugins/androidalarmmanagerexample/Application.java).

In particular, its `Application` class is as follows:

```java
public class Application extends FlutterApplication implements PluginRegistrantCallback {
@Override
public void onCreate() {
super.onCreate();
AlarmService.setPluginRegistrant(this);
}

@Override
public void registerWith(PluginRegistry registry) {
GeneratedPluginRegistrant.registerWith(registry);
}
}
```

Which must be reflected in the application's `AndroidManifest.xml`. E.g.:

```xml
<application
android:name=".Application"
...
```

**Note:** Not calling `AlarmService.setPluginRegistrant` will result in an exception being
thrown when an alarm eventually fires.

### Flutter Android Embedding V2

For the Flutter Android Embedding V2, plugins are registered with the background
isolate via reflection so `AlarmService.setPluginRegistrant` does not need to be
called.

For help getting started with Flutter, view our online
[documentation](https://flutter.dev/).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ public static void enqueueAlarmProcessing(Context context, Intent alarmContext)
* <ul>
* <li>The given {@code callbackHandle} must correspond to a registered Dart callback. If the
* handle does not resolve to a Dart callback then this method does nothing.
* <li>A static {@link #pluginRegistrantCallback} must exist, otherwise a {@link
* PluginRegistrantException} will be thrown.
* </ul>
*/
public static void startBackgroundIsolate(Context context, long callbackHandle) {
Expand Down Expand Up @@ -89,23 +87,6 @@ public static void setCallbackDispatcher(Context context, long callbackHandle) {
FlutterBackgroundExecutor.setCallbackDispatcher(context, callbackHandle);
}

/**
* Sets the {@link io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback} used to
* register the plugins used by an application with the newly spawned background isolate.
*
* <p>This should be invoked in {@link Application.onCreate} with {@link
* GeneratedPluginRegistrant} in applications using the V1 embedding API in order to use other
* plugins in the background isolate. For applications using the V2 embedding API, it is not
* necessary to set a {@link io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback} as
* plugins are registered automatically.
*/
@SuppressWarnings("deprecation")
public static void setPluginRegistrant(
io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback callback) {
// Indirectly set in FlutterBackgroundExecutor for backwards compatibility.
FlutterBackgroundExecutor.setPluginRegistrant(callback);
}

private static void scheduleAlarm(
Context context,
int requestCode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,6 @@ public void onMethodCall(MethodCall call, Result result) {
}
} catch (JSONException e) {
result.error("error", "JSON error: " + e.getMessage(), null);
} catch (PluginRegistrantException e) {
result.error("error", "AlarmManager error: " + e.getMessage(), null);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,6 @@ public class FlutterBackgroundExecutor implements MethodCallHandler {

private AtomicBoolean isCallbackDispatcherReady = new AtomicBoolean(false);

/**
* Sets the {@code io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback} used to
* register plugins with the newly spawned isolate.
*
* <p>Note: this is only necessary for applications using the V1 engine embedding API as plugins
* are automatically registered via reflection in the V2 engine embedding API. If not set, alarm
* callbacks will not be able to utilize functionality from other plugins.
*/
@SuppressWarnings("deprecation")
public static void setPluginRegistrant(
io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback callback) {
pluginRegistrantCallback = callback;
}

/**
* Sets the Dart callback handle for the Dart method that is responsible for initializing the
* background Dart isolate, preparing it to receive Dart callback tasks requests.
Expand All @@ -81,19 +67,15 @@ private void onInitialized() {
@Override
public void onMethodCall(MethodCall call, Result result) {
String method = call.method;
try {
if (method.equals("AlarmService.initialized")) {
// This message is sent by the background method channel as soon as the background isolate
// is running. From this point forward, the Android side of this plugin can send
// callback handles through the background method channel, and the Dart side will execute
// the Dart methods corresponding to those callback handles.
onInitialized();
result.success(true);
} else {
result.notImplemented();
}
} catch (PluginRegistrantException e) {
result.error("error", "AlarmManager error: " + e.getMessage(), null);
if (method.equals("AlarmService.initialized")) {
// This message is sent by the background method channel as soon as the background isolate
// is running. From this point forward, the Android side of this plugin can send
// callback handles through the background method channel, and the Dart side will execute
// the Dart methods corresponding to those callback handles.
onInitialized();
result.success(true);
} else {
result.notImplemented();
}
}

Expand All @@ -115,8 +97,6 @@ public void onMethodCall(MethodCall call, Result result) {
* <ul>
* <li>The given callback must correspond to a registered Dart callback. If the handle does not
* resolve to a Dart callback then this method does nothing.
* <li>A static {@link #pluginRegistrantCallback} must exist, otherwise a {@link
* PluginRegistrantException} will be thrown.
* </ul>
*/
public void startBackgroundIsolate(Context context) {
Expand All @@ -143,8 +123,6 @@ public void startBackgroundIsolate(Context context) {
* <ul>
* <li>The given {@code callbackHandle} must correspond to a registered Dart callback. If the
* handle does not resolve to a Dart callback then this method does nothing.
* <li>A static {@link #pluginRegistrantCallback} must exist, otherwise a {@link
* PluginRegistrantException} will be thrown.
* </ul>
*/
public void startBackgroundIsolate(Context context, long callbackHandle) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,8 @@
<uses-permission android:name="android.permission.INTERNET"/>

<application
android:name=".Application"
android:label="android_alarm_manager_example"
android:icon="@mipmap/ic_launcher">
<activity
android:name="io.flutter.plugins.androidalarmmanagerexample.EmbeddingV1Activity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize"
android:exported="true">
</activity>
<activity
android:name="io.flutter.embedding.android.FlutterActivity"
android:launchMode="singleTop"
Expand Down

This file was deleted.

This file was deleted.

4 changes: 4 additions & 0 deletions packages/android_intent/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## NEXT

* Remove references to the V1 Android embedding.

## 2.0.2

* Update README to point to Plus Plugins version.
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.flutter.plugins.androidintentexample">

<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:icon="@mipmap/ic_launcher"
android:label="android_intent_example"
android:name="io.flutter.app.FlutterApplication">
<activity
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale"
android:name=".EmbeddingV1Activity"
android:theme="@android:style/Theme.Black.NoTitleBar"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
</activity>

android:label="android_intent_example">
<activity android:name="io.flutter.embedding.android.FlutterActivity"
android:theme="@android:style/Theme.Black.NoTitleBar"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale"
Expand Down

This file was deleted.

6 changes: 5 additions & 1 deletion packages/camera/camera/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
## 0.8.1+6

* Remove references to the Android V1 embedding.

## 0.8.1+5

* Make sure the `setFocusPoint` and `setExposurePoint` coordinates work correctly in all orientations on iOS (instead of only in portrait mode).
* Make sure the `setFocusPoint` and `setExposurePoint` coordinates work correctly in all orientations on iOS (instead of only in portrait mode).

## 0.8.1+4

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,7 @@

<application
android:icon="@mipmap/ic_launcher"
android:label="camera_example"
android:name="io.flutter.app.FlutterApplication">
<activity
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection"
android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:exported="true"
android:name=".EmbeddingV1Activity"
android:theme="@style/LaunchTheme"
android:windowSoftInputMode="adjustResize">
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true"/>
</activity>
android:label="camera_example">
<activity
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection"
android:hardwareAccelerated="true"
Expand Down
Loading