|
|
@ -7,6 +7,7 @@ package org.mozilla.fenix
|
|
|
|
import android.content.Context
|
|
|
|
import android.content.Context
|
|
|
|
import android.content.Intent
|
|
|
|
import android.content.Intent
|
|
|
|
import android.content.Intent.ACTION_MAIN
|
|
|
|
import android.content.Intent.ACTION_MAIN
|
|
|
|
|
|
|
|
import android.content.Intent.FLAG_ACTIVITY_REORDER_TO_FRONT
|
|
|
|
import android.content.res.Configuration
|
|
|
|
import android.content.res.Configuration
|
|
|
|
import android.os.Build
|
|
|
|
import android.os.Build
|
|
|
|
import android.os.Bundle
|
|
|
|
import android.os.Bundle
|
|
|
@ -188,6 +189,9 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
|
|
|
|
super.onCreate(savedInstanceState)
|
|
|
|
super.onCreate(savedInstanceState)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Checks if Activity is currently in PiP mode if launched from external intents, then exits it
|
|
|
|
|
|
|
|
checkAndExitPiP()
|
|
|
|
|
|
|
|
|
|
|
|
// Diagnostic breadcrumb for "Display already aquired" crash:
|
|
|
|
// Diagnostic breadcrumb for "Display already aquired" crash:
|
|
|
|
// https://github.com/mozilla-mobile/android-components/issues/7960
|
|
|
|
// https://github.com/mozilla-mobile/android-components/issues/7960
|
|
|
|
breadcrumb(
|
|
|
|
breadcrumb(
|
|
|
@ -266,6 +270,14 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
|
|
|
|
StartupTimeline.onActivityCreateEndHome(this) // DO NOT MOVE ANYTHING BELOW HERE.
|
|
|
|
StartupTimeline.onActivityCreateEndHome(this) // DO NOT MOVE ANYTHING BELOW HERE.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun checkAndExitPiP() {
|
|
|
|
|
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && isInPictureInPictureMode && intent != null) {
|
|
|
|
|
|
|
|
// Exit PiP mode
|
|
|
|
|
|
|
|
moveTaskToBack(false)
|
|
|
|
|
|
|
|
startActivity(Intent(this, this::class.java).setFlags(FLAG_ACTIVITY_REORDER_TO_FRONT))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private fun startupTelemetryOnCreateCalled(safeIntent: SafeIntent) {
|
|
|
|
private fun startupTelemetryOnCreateCalled(safeIntent: SafeIntent) {
|
|
|
|
// We intentionally only record this in HomeActivity and not ExternalBrowserActivity (e.g.
|
|
|
|
// We intentionally only record this in HomeActivity and not ExternalBrowserActivity (e.g.
|
|
|
|
// PWAs) so we don't include more unpredictable code paths in the results.
|
|
|
|
// PWAs) so we don't include more unpredictable code paths in the results.
|
|
|
|