TF-4136 Fix DeviceInfoPlugin is instantiated on every access.
This commit is contained in:
@@ -15,8 +15,10 @@ class ApplicationManager {
|
|||||||
@visibleForTesting
|
@visibleForTesting
|
||||||
static DeviceInfoPlugin? debugDeviceInfoOverride;
|
static DeviceInfoPlugin? debugDeviceInfoOverride;
|
||||||
|
|
||||||
|
DeviceInfoPlugin? _deviceInfoCache;
|
||||||
|
|
||||||
DeviceInfoPlugin get _deviceInfo =>
|
DeviceInfoPlugin get _deviceInfo =>
|
||||||
debugDeviceInfoOverride ?? DeviceInfoPlugin();
|
debugDeviceInfoOverride ?? (_deviceInfoCache ??= DeviceInfoPlugin());
|
||||||
|
|
||||||
PackageInfo? _packageInfoCache;
|
PackageInfo? _packageInfoCache;
|
||||||
String? _versionCache;
|
String? _versionCache;
|
||||||
@@ -31,6 +33,7 @@ class ApplicationManager {
|
|||||||
_cachedWebUserAgent = null;
|
_cachedWebUserAgent = null;
|
||||||
_cachedMobileUserAgent = null;
|
_cachedMobileUserAgent = null;
|
||||||
_isMobileUserAgentInitialized = false;
|
_isMobileUserAgentInitialized = false;
|
||||||
|
_deviceInfoCache = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<PackageInfo> getPackageInfo() async {
|
Future<PackageInfo> getPackageInfo() async {
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ class SentryInitializer {
|
|||||||
'bearer',
|
'bearer',
|
||||||
'session',
|
'session',
|
||||||
'password',
|
'password',
|
||||||
|
'token',
|
||||||
];
|
];
|
||||||
|
|
||||||
static Future<bool> init(FutureOr<void> Function() appRunner) async {
|
static Future<bool> init(FutureOr<void> Function() appRunner) async {
|
||||||
|
|||||||
Reference in New Issue
Block a user