Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Only allow prefs to be set by extras in debug builds (#3353)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluemarvin committed May 8, 2020
1 parent 7233172 commit e84d3c9
Showing 1 changed file with 11 additions and 11 deletions.
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

0 comments on commit e84d3c9

Please sign in to comment.