Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only allow prefs to be set by extras in debug builds #3353

Merged
merged 1 commit into from
May 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ public static void vrPrefsWorkAround(Context aContext, Bundle aExtras) {
out.write("user_pref(\"signon.rememberSignons\", false);\n".getBytes());
// Disable web extension process until it is able to restart.
out.write("user_pref(\"extensions.webextensions.remote\", false);\n".getBytes());
if (BuildConfig.DEBUG) {
int processCount = SettingsStore.getInstance(aContext).isMultiE10s() ? 3 : 1;
out.write(("user_pref(\"dom.ipc.processCount\", " + processCount + ");\n").getBytes());
}
int msaa = SettingsStore.getInstance(aContext).getMSAALevel();
if (msaa > 0) {
int msaaLevel = msaa == 2 ? 4 : 2;
Expand All @@ -59,13 +55,17 @@ public static void vrPrefsWorkAround(Context aContext, Bundle aExtras) {
} else {
out.write("user_pref(\"webgl.msaa-force\", false);\n".getBytes());
}
addOptionalPref(out, "dom.vr.require-gesture", aExtras);
addOptionalPref(out, "privacy.reduceTimerPrecision", aExtras);
if (aExtras != null && aExtras.getBoolean("media.autoplay.enabled", false)) {
// Enable playing audios without gesture (used for gfx automated testing)
out.write("user_pref(\"media.autoplay.enabled.user-gestures-needed\", false);\n".getBytes());
out.write("user_pref(\"media.autoplay.enabled.ask-permission\", false);\n".getBytes());
out.write("user_pref(\"media.autoplay.default\", 0);\n".getBytes());
if (BuildConfig.DEBUG) {
int processCount = SettingsStore.getInstance(aContext).isMultiE10s() ? 3 : 1;
out.write(("user_pref(\"dom.ipc.processCount\", " + processCount + ");\n").getBytes());
addOptionalPref(out, "dom.vr.require-gesture", aExtras);
addOptionalPref(out, "privacy.reduceTimerPrecision", aExtras);
if (aExtras != null && aExtras.getBoolean("media.autoplay.enabled", false)) {
// Enable playing audios without gesture (used for gfx automated testing)
out.write("user_pref(\"media.autoplay.enabled.user-gestures-needed\", false);\n".getBytes());
out.write("user_pref(\"media.autoplay.enabled.ask-permission\", false);\n".getBytes());
out.write("user_pref(\"media.autoplay.default\", 0);\n".getBytes());
}
}
} catch (FileNotFoundException e) {
Log.e(LOGTAG, "Unable to create file: '" + prefFileName + "' got exception: " + e.toString());
Expand Down