[mob][photos] Log device brand and model
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user