Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
sblatz authored and ekager committed Jul 29, 2020
1 parent 8bfc493 commit bb03049
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
8 changes: 6 additions & 2 deletions app/src/main/java/org/mozilla/fenix/HomeActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,10 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {

// Launch this on a background thread so as not to affect startup performance
lifecycleScope.launch(IO) {
if (settings().wasDefaultBrowserOnLastPause != settings().isDefaultBrowser()) {
if (
settings().isDefaultBrowser() &&
settings().wasDefaultBrowserOnLastPause != settings().isDefaultBrowser()
) {
metrics.track(Event.ChangedToDefaultBrowser)
}
}
Expand All @@ -259,7 +262,8 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
window.addFlags(WindowManager.LayoutParams.FLAG_SECURE)
}

if (settings().wasDefaultBrowserOnLastPause != settings().isDefaultBrowser()) {
if (settings().wasDefaultBrowserOnLastPause != settings().isDefaultBrowser()
) {
settings().wasDefaultBrowserOnLastPause = settings().isDefaultBrowser()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import android.widget.Switch
import androidx.preference.Preference
import androidx.preference.PreferenceViewHolder
import org.mozilla.fenix.R
import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.ext.metrics
import org.mozilla.fenix.utils.BrowsersCache

class DefaultBrowserPreference @JvmOverloads constructor(
Expand Down
10 changes: 10 additions & 0 deletions docs/mma.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,16 @@ Here is the list of current Events sent, which can be found here in the code bas
<td>The user has installed an addon from the addon management page.</td>
<td><a href="https://github.com/mozilla-mobile/fenix/pull/12136#issuecomment-651922547">#12136</a></td>
</tr>
<tr>
<td>`E_Search_Widget_Added`</td>
<td>The user has installed the search widget to their homescreen.</td>
<td><a href="https://github.com/mozilla-mobile/fenix/pull/13003">#13003</a></td>
</tr>
<tr>
<td>`E_Changed_Default_To_Fenix`</td>
<td>The user has changed their default browser to Fenix while Fenix was in the background and then resumed the app</td>
<td><a href="https://github.com/mozilla-mobile/fenix/pull/13003">#13003</a></td>
</tr>
</table>

Deep links
Expand Down

0 comments on commit bb03049

Please sign in to comment.