Review comments, fix build failure and targetActivity
This commit is contained in:
parent
b89afe7b7c
commit
261a6162af
|
@ -33,10 +33,14 @@
|
||||||
We inherited this entry (${applicationId}.App) from Fennec. We need to keep this as our
|
We inherited this entry (${applicationId}.App) from Fennec. We need to keep this as our
|
||||||
main launcher to avoid launcher icons on the home screen disappearing for all our users
|
main launcher to avoid launcher icons on the home screen disappearing for all our users
|
||||||
on a Fennec build.
|
on a Fennec build.
|
||||||
|
|
||||||
|
!!HERE BE DRAGONS!!
|
||||||
|
We need the targetActivity to be IntentReceiverActivity so that we can check if we have
|
||||||
|
a migration in progress. If not, the HomeActivity is invoked.
|
||||||
-->
|
-->
|
||||||
<activity-alias
|
<activity-alias
|
||||||
android:name="${applicationId}.App"
|
android:name="${applicationId}.App"
|
||||||
android:targetActivity=".HomeActivity">
|
android:targetActivity=".IntentReceiverActivity">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
|
@ -96,7 +100,7 @@
|
||||||
android:taskAffinity=""
|
android:taskAffinity=""
|
||||||
android:windowSoftInputMode="adjustResize|stateAlwaysHidden" />
|
android:windowSoftInputMode="adjustResize|stateAlwaysHidden" />
|
||||||
|
|
||||||
<activity android:name=".IntentReceiverActivity">
|
<activity android:name=".IntentReceiverActivity" android:theme="@style/Theme.Transparent">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
|
@ -162,6 +166,12 @@
|
||||||
|
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".migration.MigrationProgressActivity"
|
||||||
|
android:launchMode="singleInstance"
|
||||||
|
android:exported="false">
|
||||||
|
</activity>
|
||||||
|
|
||||||
<activity android:name=".widget.VoiceSearchActivity" />
|
<activity android:name=".widget.VoiceSearchActivity" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
|
|
|
@ -7,7 +7,7 @@ package org.mozilla.fenix.components
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import mozilla.components.feature.intent.processing.IntentProcessor
|
import mozilla.components.feature.intent.processing.IntentProcessor
|
||||||
import org.mozilla.fenix.HomeActivity
|
import org.mozilla.fenix.HomeActivity
|
||||||
import org.mozilla.fenix.MigrationProgressActivity
|
import org.mozilla.fenix.migration.MigrationProgressActivity
|
||||||
import org.mozilla.fenix.customtabs.ExternalAppBrowserActivity
|
import org.mozilla.fenix.customtabs.ExternalAppBrowserActivity
|
||||||
|
|
||||||
enum class IntentProcessorType {
|
enum class IntentProcessorType {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
package org.mozilla.fenix
|
package org.mozilla.fenix.migration
|
||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
|
@ -24,6 +24,9 @@ import mozilla.components.support.migration.Migration.Settings
|
||||||
import mozilla.components.support.migration.MigrationResults
|
import mozilla.components.support.migration.MigrationResults
|
||||||
import mozilla.components.support.migration.state.MigrationProgress
|
import mozilla.components.support.migration.state.MigrationProgress
|
||||||
import mozilla.components.support.migration.state.MigrationStore
|
import mozilla.components.support.migration.state.MigrationStore
|
||||||
|
import org.mozilla.fenix.HomeActivity
|
||||||
|
import org.mozilla.fenix.IntentReceiverActivity
|
||||||
|
import org.mozilla.fenix.R
|
||||||
import org.mozilla.fenix.ext.components
|
import org.mozilla.fenix.ext.components
|
||||||
|
|
||||||
class MigrationProgressActivity : AbstractMigrationProgressActivity() {
|
class MigrationProgressActivity : AbstractMigrationProgressActivity() {
|
||||||
|
@ -31,9 +34,9 @@ class MigrationProgressActivity : AbstractMigrationProgressActivity() {
|
||||||
override val store: MigrationStore by lazy { components.migrationStore }
|
override val store: MigrationStore by lazy { components.migrationStore }
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_migration)
|
setContentView(R.layout.activity_migration)
|
||||||
init()
|
init()
|
||||||
super.onCreate(savedInstanceState)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun init() {
|
fun init() {
|
||||||
|
@ -60,16 +63,6 @@ class MigrationProgressActivity : AbstractMigrationProgressActivity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onWindowFocusChanged(hasFocus: Boolean) {
|
|
||||||
super.onWindowFocusChanged(hasFocus)
|
|
||||||
if (hasFocus) {
|
|
||||||
// Enables sticky immersive mode.
|
|
||||||
window.decorView.systemUiVisibility = (View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
|
||||||
or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
|
||||||
or View.SYSTEM_UI_FLAG_FULLSCREEN)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onMigrationCompleted() {
|
override fun onMigrationCompleted() {
|
||||||
// Enable clicking the finish button
|
// Enable clicking the finish button
|
||||||
migration_button.apply {
|
migration_button.apply {
|
|
@ -379,4 +379,12 @@
|
||||||
<item name="android:textSize">14sp</item>
|
<item name="android:textSize">14sp</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="Theme.Transparent" parent="android:Theme">
|
||||||
|
<item name="android:windowIsTranslucent">true</item>
|
||||||
|
<item name="android:windowBackground">@android:color/transparent</item>
|
||||||
|
<item name="android:windowContentOverlay">@null</item>
|
||||||
|
<item name="android:windowNoTitle">true</item>
|
||||||
|
<item name="android:windowIsFloating">true</item>
|
||||||
|
<item name="android:backgroundDimEnabled">false</item>
|
||||||
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -13,11 +13,6 @@
|
||||||
android:name="org.mozilla.fenix.MigratingFenixApplication"
|
android:name="org.mozilla.fenix.MigratingFenixApplication"
|
||||||
tools:replace="android:name">
|
tools:replace="android:name">
|
||||||
<service android:name="org.mozilla.fenix.MigrationService" />
|
<service android:name="org.mozilla.fenix.MigrationService" />
|
||||||
|
|
||||||
<activity
|
|
||||||
android:name="org.mozilla.fenix.MigrationProgressActivity"
|
|
||||||
android:exported="false">
|
|
||||||
</activity>
|
|
||||||
</application>
|
</application>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,8 @@
|
||||||
package org.mozilla.fenix
|
package org.mozilla.fenix
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
|
||||||
import kotlinx.coroutines.runBlocking
|
import kotlinx.coroutines.runBlocking
|
||||||
import mozilla.components.support.migration.FennecMigrator
|
import mozilla.components.support.migration.FennecMigrator
|
||||||
import mozilla.components.support.migration.state.MigrationStore
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An application class which knows how to migrate Fennec data.
|
* An application class which knows how to migrate Fennec data.
|
||||||
|
@ -28,13 +26,11 @@ class MigratingFenixApplication : FenixApplication() {
|
||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
val migrationStore by lazy { MigrationStore() }
|
|
||||||
|
|
||||||
val migrationPushSubscriber by lazy {
|
val migrationPushSubscriber by lazy {
|
||||||
MigrationPushSubscriber(
|
MigrationPushSubscriber(
|
||||||
this,
|
this,
|
||||||
components.backgroundServices.pushService,
|
components.backgroundServices.pushService,
|
||||||
migrationStore
|
components.migrationStore
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,11 +43,7 @@ class MigratingFenixApplication : FenixApplication() {
|
||||||
|
|
||||||
// The rest of the migrations can happen now.
|
// The rest of the migrations can happen now.
|
||||||
migrationPushSubscriber.start()
|
migrationPushSubscriber.start()
|
||||||
migrator.startMigrationIfNeeded(migrationStore, MigrationService::class.java)
|
migrator.startMigrationIfNeeded(components.migrationStore, MigrationService::class.java)
|
||||||
|
|
||||||
// Start migration UI
|
|
||||||
val intent = Intent(this, MigrationProgressActivity::class.java)
|
|
||||||
startActivity(intent)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun migrateBlocking() {
|
private fun migrateBlocking() {
|
||||||
|
@ -71,7 +63,3 @@ class MigratingFenixApplication : FenixApplication() {
|
||||||
fun Context.getMigratorFromApplication(): FennecMigrator {
|
fun Context.getMigratorFromApplication(): FennecMigrator {
|
||||||
return (applicationContext as MigratingFenixApplication).migrator
|
return (applicationContext as MigratingFenixApplication).migrator
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Context.getMigrationStoreFromApplication(): MigrationStore {
|
|
||||||
return (applicationContext as MigratingFenixApplication).migrationStore
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user