Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
Fixes comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sblatz committed Oct 3, 2019
1 parent ae9e2ec commit 0a74773
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
13 changes: 6 additions & 7 deletions app/src/main/java/org/mozilla/fenix/HomeActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,12 @@ open class HomeActivity : AppCompatActivity() {
// We do this on a separate thread to alleviate performance issues
val weakReferenceContext = WeakReference(this)
lifecycleScope.launch {
weakReferenceContext.get()?.let {
if (!Browsers.all(it).isDefaultBrowser) {
it.settings().preferences
.edit()
.putBoolean(it.getString(R.string.pref_key_open_links_in_a_private_tab), false)
.apply()
}
val context = weakReferenceContext.get() ?: return@launch
if (!Browsers.all(context).isDefaultBrowser) {
context.settings().preferences
.edit()
.putBoolean(context.getString(R.string.pref_key_open_links_in_a_private_tab), false)
.apply()
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/org/mozilla/fenix/IntentReceiverActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ class IntentReceiverActivity : Activity() {
}

companion object {
// This constant must match the metadata from the private activity-alias
const val LAUNCH_PRIVATE_LINK = "org.mozilla.fenix.LAUNCH_PRIVATE_LINK"

const val ACTION_OPEN_TAB = "org.mozilla.fenix.OPEN_TAB"
const val ACTION_OPEN_PRIVATE_TAB = "org.mozilla.fenix.OPEN_PRIVATE_TAB"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import org.mozilla.fenix.ext.getPreferenceKey
import org.mozilla.fenix.ext.settings

/**
* Lets the user toggle telemetry on/off.
* Lets the user control their default browser preferences
*/
class DefaultBrowserFragment : PreferenceFragmentCompat() {
class DefaultBrowserSettingsFragment : PreferenceFragmentCompat() {

private val preferenceChangeListener =
SharedPreferences.OnSharedPreferenceChangeListener { sharedPreferences, key ->
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/navigation/nav_graph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,6 @@
android:label="AddNewDeviceFragment" />
<fragment
android:id="@+id/defaultBrowserFragment"
android:name="org.mozilla.fenix.settings.DefaultBrowserFragment"
android:name="org.mozilla.fenix.settings.DefaultBrowserSettingsFragment"
android:label="DefaultBrowserFragment" />
</navigation>

0 comments on commit 0a74773

Please sign in to comment.