Skip to content

Commit

Permalink
[camera] Switch to internal method channels (flutter#5943)
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartmorgan authored and yutaaraki-toydium committed Aug 12, 2022
1 parent c6150e2 commit b42bbd9
Show file tree
Hide file tree
Showing 28 changed files with 3,898 additions and 76 deletions.
4 changes: 2 additions & 2 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ packages/webview_flutter/** @bparrishMines
packages/**/*_web/** @ditman

# - Android
packages/camera/camera/android/** @camsim99
packages/camera/camera_android/** @camsim99
packages/espresso/** @blasten
packages/flutter_plugin_android_lifecycle/** @blasten
packages/google_maps_flutter/google_maps_flutter/android/** @GaryQian
Expand All @@ -40,7 +40,7 @@ packages/url_launcher/url_launcher_android/** @GaryQian
packages/video_player/video_player_android/** @blasten

# - iOS
packages/camera/camera/ios/** @hellohuanlin
packages/camera/camera_avfoundation/** @hellohuanlin
packages/google_maps_flutter/google_maps_flutter/ios/** @cyanglaz
packages/google_sign_in/google_sign_in_ios/** @jmagman
packages/image_picker/image_picker_ios/** @cyanglaz
Expand Down
4 changes: 4 additions & 0 deletions packages/camera/camera_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.9.8

* Switches to internal method channel implementation.

## 0.9.7+1

* Splits from `camera` as a federated implementation.
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ enum CameraEventType {
* the main thread. The handler is mainly supplied so it will be easier test this class.
*/
DartMessenger(BinaryMessenger messenger, long cameraId, @NonNull Handler handler) {
cameraChannel = new MethodChannel(messenger, "flutter.io/cameraPlugin/camera" + cameraId);
deviceChannel = new MethodChannel(messenger, "flutter.io/cameraPlugin/device");
cameraChannel =
new MethodChannel(messenger, "plugins.flutter.io/camera_android/camera" + cameraId);
deviceChannel = new MethodChannel(messenger, "plugins.flutter.io/camera_android/fromPlatform");
this.handler = handler;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ final class MethodCallHandlerImpl implements MethodChannel.MethodCallHandler {
this.permissionsRegistry = permissionsAdder;
this.textureRegistry = textureRegistry;

methodChannel = new MethodChannel(messenger, "plugins.flutter.io/camera");
imageStreamChannel = new EventChannel(messenger, "plugins.flutter.io/camera/imageStream");
methodChannel = new MethodChannel(messenger, "plugins.flutter.io/camera_android");
imageStreamChannel =
new EventChannel(messenger, "plugins.flutter.io/camera_android/imageStream");
methodChannel.setMethodCallHandler(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import 'dart:io';
import 'dart:ui';

import 'package:camera_android/camera_android.dart';
import 'package:camera_example/camera_controller.dart';
import 'package:camera_platform_interface/camera_platform_interface.dart';
import 'package:flutter/painting.dart';
Expand All @@ -19,6 +20,7 @@ void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

setUpAll(() async {
CameraPlatform.instance = AndroidCamera();
final Directory extDir = await getTemporaryDirectory();
testDir = await Directory('${extDir.path}/test').create(recursive: true);
});
Expand Down
5 changes: 5 additions & 0 deletions packages/camera/camera_android/lib/camera_android.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

export 'src/android_camera.dart';
Loading

0 comments on commit b42bbd9

Please sign in to comment.