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

Need a way to disable the Quick Action Sheet for visual metrics performance tests #5048

Closed
acreskeyMoz opened this issue Aug 30, 2019 · 12 comments
Labels
feature request 🌟 New functionality and improvements

Comments

@acreskeyMoz
Copy link
Collaborator

acreskeyMoz commented Aug 30, 2019

Why/User Benefit/User Problem

The Quick Action Sheet menu, with the Share / Bookmark items appears automatically during a pageload.
Related to #4308
This will cause problems for visual metrics performance tests since they effectively measure the time for the rendering to settle.

What/Requirements

Some mechanism to disable the auto display of the Quick Action Sheet (intent argument?) for performance testing.

Acceptance Criteria (how do I know when I’m done?)

When Fenix can be launched in a to-be-determined manner and no Quick Action Sheet will appear unless the user has clicked on it.

┆Issue is synchronized with this Jira Task

@acreskeyMoz acreskeyMoz added the feature request 🌟 New functionality and improvements label Aug 30, 2019
@colintheshots
Copy link
Contributor

colintheshots commented Aug 30, 2019

One may set a shared preference to prevent the Quick Action Sheet from bouncing automatically, as it does on the first few runs.

One should be able to do this:

appContext.getSharedPreferences("fenix_preferences", MODE_PRIVATE).edit().putInt(
            appContext.getPreferenceKey(R.string.pref_key_bounce_quick_action),
            100 // or any large number really
        ).commit()

@ncalexan
Copy link
Contributor

@colintheshots how would you feel about GV learning how to set arbitrary Shared Preferences from its debug config file? Would Gecko-startup time be early enough to impact the shared pref above?

This might provide a decent way forward for parts of Bug 1547717. It's an abstraction breaking thing, but the GV mechanism is principled and believed to be secure. Thoughts?

@colintheshots
Copy link
Contributor

colintheshots commented Aug 30, 2019

It's just a flat XML file key-value store. Alternatively, you can simply create a file before first run with these contents at this location /data/data/${app_id}/shared_prefs/fenix_preferences.xml:

<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
    <int name="pref_key_bounce_quick_action" value="100" />
</map>

@colintheshots
Copy link
Contributor

Yes, GV startup is likely early enough unless perhaps the first thing the user does is hit an external link from cold startup. Then there's a possibility of a race.

@ncalexan
Copy link
Contributor

It's just a flat XML file key-value store. Alternatively, you can simply create a file before first run with these contents at this location /data/data/${app_id}/shared_prefs/fenix_preferences.xml:

<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
    <int name="pref_key_bounce_quick_action" value="100" />
</map>

It's not reasonable to achieve this without an android:debuggable="true" APK. The GV mechanism will work, with appropriate limitations, even for release APKs.

Thanks for confirming that GV startup might achieve this, though!

@acreskeyMoz
Copy link
Collaborator Author

I put a shared_pref in /data/data/org.mozilla.fenix.performancetest/shared_prefs/fenix_preferences.xml with the bounce quick action set to 100.
But I'm still seeing the Quick Action sheet pop up when running this with browsertime.
Does creation of a new profile clear this file?
It's getting reset to this on first run:

<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
    <boolean name="pref_key_fxa_has_synced_items" value="true" />
    <boolean name="pref_key_follow_device_theme" value="true" />
    <int name="pref_key_bounce_quick_action" value="2" />
</map>

Normally we do clear app data with shell pm clear $appId before browsertime runs, but I'm not doing that for Fenix.

@acreskeyMoz
Copy link
Collaborator Author

So I've disabled the Quick Action Sheet in code for the tests that I'm running.

But here's an idea: what if we disable it automatically for the forPerformanceTest build target?

@acreskeyMoz
Copy link
Collaborator Author

That Quick Action Sheet is persistent though!
Even with a high value set for pref_key_bounce_quick_action it can independently auto bounce via this codepath (notifyReaderModeButton():

I think we'll need an automation-friendly way of turning off all these routes.

@acreskeyMoz
Copy link
Collaborator Author

@colintheshots @ncalexan
In doing some work with Fenix I noticed another feature that needs to be disabled for visual metrics -- the ETP blocking pop-up on the navigation bar.

Using the forPerformanceTest build variant this is automatically hidden by feature flag:

val etpCategories = nightly or debug

So that gave me an idea for the QuickActionSheet:

What if I put it behind a FeatureFlag and disable it for the forPerformanceTest builds?

If other visual features come along, they can be similarly disabled.

@acreskeyMoz
Copy link
Collaborator Author

@colintheshots What do you think about the above -- disable the QuickActionSheet in forPerformanceTest builds?

@mcomella
Copy link
Contributor

mcomella commented Nov 7, 2019

@acreskeyMoz The QuickActionSheet (or QuickActionBar) is in the process of being removed: #4281 I'm going to pre-emptively close this bug – feel free to reopen if that doesn't fit your needs. :)

@mcomella mcomella closed this as completed Nov 7, 2019
@acreskeyMoz
Copy link
Collaborator Author

That's great, thanks @mcomella

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature request 🌟 New functionality and improvements
Projects
None yet
Development

No branches or pull requests

4 participants