Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Switch back to mediakit for grapheneOS

Neeraj Gupta00f7151a6f61
diff --git a/lib/main.dart b/lib/main.dart
index e818cfb4e0..ef1870783b 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -43,7 +43,6 @@ import 'package:photos/services/user_service.dart';
import 'package:photos/ui/tools/app_lock.dart';
import 'package:photos/ui/tools/lock_screen.dart';
import 'package:photos/utils/crypto_util.dart';
-import "package:photos/utils/device_info.dart";
import 'package:photos/utils/file_uploader.dart';
import 'package:photos/utils/local_settings.dart';
import 'package:shared_preferences/shared_preferences.dart';
@@ -162,7 +161,6 @@ Future<void> _init(bool isBackground, {String via = ''}) async {
Computer.shared().turnOn(workersCount: 4, verbose: kDebugMode);
CryptoUtil.init();
await NetworkClient.instance.init();
- initDeviceSpec().ignore();
await Configuration.instance.init();
await UserService.instance.init();
await EntityService.instance.init();
diff --git a/lib/ui/viewer/file/file_widget.dart b/lib/ui/viewer/file/file_widget.dart
index 5928c16eda..6e6dcc7f17 100644
--- a/lib/ui/viewer/file/file_widget.dart
+++ b/lib/ui/viewer/file/file_widget.dart
@@ -2,10 +2,8 @@ import 'package:flutter/material.dart';
import 'package:logging/logging.dart';
import 'package:photos/models/file/file.dart';
import 'package:photos/models/file/file_type.dart';
-import "package:photos/ui/viewer/file/video_widget.dart";
import "package:photos/ui/viewer/file/video_widget_new.dart";
import "package:photos/ui/viewer/file/zoomable_live_image_new.dart";
-import "package:photos/utils/device_info.dart";
class FileWidget extends StatelessWidget {
final EnteFile file;
@@ -40,20 +38,11 @@ class FileWidget extends StatelessWidget {
key: key ?? ValueKey(fileKey),
);
} else if (file.fileType == FileType.video) {
- if (isCompatibleWithMediaKit()) {
- return VideoWidgetNew(
- file,
- tagPrefix: tagPrefix,
- playbackCallback: playbackCallback,
- );
- } else {
- return VideoWidget(
- file,
- autoPlay: autoPlay ?? false, // Autoplay if it was opened directly
- tagPrefix: tagPrefix,
- playbackCallback: playbackCallback,
- );
- }
+ return VideoWidgetNew(
+ file,
+ tagPrefix: tagPrefix,
+ playbackCallback: playbackCallback,
+ );
} else {
Logger('FileWidget').severe('unsupported file type ${file.fileType}');
return const Icon(Icons.error);
diff --git a/lib/utils/device_info.dart b/lib/utils/device_info.dart
index 01d5256376..70aae5d55a 100644
--- a/lib/utils/device_info.dart
+++ b/lib/utils/device_info.dart
@@ -5,8 +5,6 @@ import 'package:flutter/foundation.dart';
import 'package:logging/logging.dart';
DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
-bool disableMediaKit = false;
-
// https://gist.github.com/adamawolf/3048717
final Set<String> iOSLowEndMachineCodes = <String>{
"iPhone5,1", //iPhone 5 (GSM)
@@ -31,21 +29,6 @@ final Set<String> iOSLowEndMachineCodes = <String>{
"iPhone10,5", // iPhone 8
};
-Future<void> initDeviceSpec() async {
- if (Platform.isAndroid) {
- // Note: The current version of media_kit crashes while playing video when
-// hardware malloc is enabled. Users either need to disable the hardware
-// malloc for our app or we need to disable the media_kit for these devices.
-// Currently, we have disabled the media_kit for these devices. and in the
-// future if needed we can add a setting.
- final androidInfo = await deviceInfoPlugin.androidInfo;
- disableMediaKit = androidInfo.toString().contains('graphene') ||
- androidInfo.toString().contains('divest');
- } else {
- disableMediaKit = false;
- }
-}
-
Future<bool> isLowSpecDevice() async {
try {
if (Platform.isIOS) {
@@ -67,7 +50,3 @@ Future<bool> isAndroidSDKVersionLowerThan(int inputSDK) async {
return false;
}
}
-
-bool isCompatibleWithMediaKit() {
- return disableMediaKit == false;
-}