Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Log device brand and model

ashilknc4880fd07e91
diff --git a/mobile/lib/core/error-reporting/super_logging.dart b/mobile/lib/core/error-reporting/super_logging.dart
index 4f5e21cfc9..7c0bef58be 100644
--- a/mobile/lib/core/error-reporting/super_logging.dart
+++ b/mobile/lib/core/error-reporting/super_logging.dart
@@ -17,6 +17,7 @@ import 'package:path_provider/path_provider.dart';
import 'package:photos/core/error-reporting/tunneled_transport.dart';
import "package:photos/core/errors.dart";
import 'package:photos/models/typedefs.dart';
+import "package:photos/utils/device_info.dart";
import 'package:sentry_flutter/sentry_flutter.dart';
import 'package:shared_preferences/shared_preferences.dart';
@@ -198,6 +199,12 @@ class SuperLogging {
$.info("sentry uploader started");
}
+ unawaited(
+ getDeviceName().then((name) {
+ $.info("Device name: $name");
+ }),
+ );
+
if (appConfig.body == null) return;
if (enable && sentryIsEnabled) {
diff --git a/mobile/lib/utils/device_info.dart b/mobile/lib/utils/device_info.dart
index 70aae5d55a..4925a0b144 100644
--- a/mobile/lib/utils/device_info.dart
+++ b/mobile/lib/utils/device_info.dart
@@ -50,3 +50,21 @@ Future<bool> isAndroidSDKVersionLowerThan(int inputSDK) async {
return false;
}
}
+
+Future<String?> getDeviceName() async {
+ try {
+ if (Platform.isIOS) {
+ final IosDeviceInfo iosInfo = await deviceInfoPlugin.iosInfo;
+ return iosInfo.utsname.machine;
+ } else if (Platform.isAndroid) {
+ final AndroidDeviceInfo androidInfo = await deviceInfoPlugin.androidInfo;
+
+ return "${androidInfo.brand} ${androidInfo.model}";
+ } else {
+ return "Not iOS or Android";
+ }
+ } catch (e) {
+ Logger("device_info").severe("deviceSpec check failed", e);
+ return null;
+ }
+}