mirror of
https://github.com/ProtonVPN/android-app.git
synced 2026-03-13 09:02:15 +08:00
Fix logging WebView version in tests.
This commit is contained in:
@@ -23,6 +23,7 @@ import android.app.ApplicationExitInfo
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import android.os.SystemClock
|
||||
import android.webkit.WebView
|
||||
import com.protonvpn.android.api.DohEnabled
|
||||
import com.protonvpn.android.app.AppExitObservability
|
||||
import com.protonvpn.android.app.AppStartExitLogger
|
||||
@@ -34,6 +35,7 @@ import com.protonvpn.android.logging.CurrentStateLogger
|
||||
import com.protonvpn.android.logging.CurrentStateLoggerGlobal
|
||||
import com.protonvpn.android.logging.FileLogWriter
|
||||
import com.protonvpn.android.logging.GlobalSentryLogWriter
|
||||
import com.protonvpn.android.logging.LogCategory
|
||||
import com.protonvpn.android.logging.LogWriter
|
||||
import com.protonvpn.android.logging.LogcatLogWriter
|
||||
import com.protonvpn.android.logging.PowerStateLogger
|
||||
@@ -46,10 +48,12 @@ import com.protonvpn.android.notifications.NotificationPermissionManager
|
||||
import com.protonvpn.android.profiles.usecases.PopulateInitialProfiles
|
||||
import com.protonvpn.android.profiles.usecases.ProfileAutoOpenHandler
|
||||
import com.protonvpn.android.profiles.usecases.UpdateProfileLastConnected
|
||||
import com.protonvpn.android.promooffers.usecase.OneTimePopupNotificationTrigger
|
||||
import com.protonvpn.android.quicktile.QuickTileDataStoreUpdater
|
||||
import com.protonvpn.android.redesign.recents.usecases.ConnectingUpdatesRecents
|
||||
import com.protonvpn.android.redesign.recents.usecases.RecentsListValidator
|
||||
import com.protonvpn.android.redesign.upgrade.usecase.PurchasesEnabledUpdater
|
||||
import com.protonvpn.android.servers.StreamingServicesUpdater
|
||||
import com.protonvpn.android.servers.UpdateServerTranslations
|
||||
import com.protonvpn.android.telemetry.VpnConnectionTelemetry
|
||||
import com.protonvpn.android.theme.UpdateAndroidAppTheme
|
||||
@@ -57,8 +61,6 @@ import com.protonvpn.android.tv.IsTvCheck
|
||||
import com.protonvpn.android.ui.home.ServerListUpdater
|
||||
import com.protonvpn.android.ui.onboarding.ReviewTracker
|
||||
import com.protonvpn.android.ui.planupgrade.ShowUpgradeSuccess
|
||||
import com.protonvpn.android.promooffers.usecase.OneTimePopupNotificationTrigger
|
||||
import com.protonvpn.android.servers.StreamingServicesUpdater
|
||||
import com.protonvpn.android.utils.SentryIntegration.initSentry
|
||||
import com.protonvpn.android.utils.Storage
|
||||
import com.protonvpn.android.utils.VpnCoreLogger
|
||||
@@ -170,6 +172,12 @@ open class ProtonApplication : Application() {
|
||||
val uptimeS = SystemClock.elapsedRealtime() / 1000
|
||||
ProtonLogger.log(AppProcessStart, "version: ${BuildConfig.VERSION_NAME}")
|
||||
ProtonLogger.log(AppProcessStart,"system: build ${Build.DISPLAY} uptime ${uptimeS}s")
|
||||
if (BuildConfig.DEBUG && Build.VERSION.SDK_INT >= 26) {
|
||||
val webViewApp = WebView.getCurrentWebViewPackage()
|
||||
val webViewAppString =
|
||||
if (webViewApp != null) with(webViewApp) { "$packageName $versionName" } else "null"
|
||||
ProtonLogger.logCustom(LogCategory.HV, "WebView package: $webViewAppString")
|
||||
}
|
||||
|
||||
initNotificationChannel(this)
|
||||
|
||||
|
||||
@@ -19,14 +19,11 @@
|
||||
|
||||
package com.protonvpn.android
|
||||
|
||||
import android.os.Build
|
||||
import android.webkit.WebView
|
||||
import androidx.hilt.work.HiltWorkerFactory
|
||||
import androidx.startup.AppInitializer
|
||||
import androidx.work.Configuration
|
||||
import com.protonvpn.android.logging.LogCategory
|
||||
import com.protonvpn.android.logging.MemoryMonitor
|
||||
import com.protonvpn.android.logging.ProtonLogger
|
||||
import com.protonvpn.android.promooffers.data.TestNotificationLoader
|
||||
import com.protonvpn.android.ui.onboarding.OnboardingTelemetry
|
||||
import com.protonvpn.android.utils.SentryIntegration
|
||||
@@ -62,12 +59,6 @@ class ProtonApplicationHilt : ProtonApplication(), Configuration.Provider {
|
||||
if (BuildConfig.DEBUG) {
|
||||
// nosemgrep: gitlab.mobsf.kotlin-webview-rule-android_kotlin_webview_debug
|
||||
WebView.setWebContentsDebuggingEnabled(true)
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
val webViewApp = WebView.getCurrentWebViewPackage()
|
||||
val webViewAppString =
|
||||
if (webViewApp != null) with(webViewApp) { "$packageName $versionName" } else "null"
|
||||
ProtonLogger.logCustom(LogCategory.HV, "WebView package: $webViewAppString")
|
||||
}
|
||||
|
||||
testNotificationLoader.get().loadTestFile()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user