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

Commit

Permalink
Make VR User Agent the default. Fixes #478 (#704)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluemarvin authored and MortimerGoro committed Nov 2, 2018
1 parent 7686578 commit 4efd107
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;

import org.mozilla.geckoview.GeckoSessionSettings;
import org.mozilla.telemetry.TelemetryHolder;
import org.mozilla.vrbrowser.R;
import org.mozilla.vrbrowser.telemetry.TelemetryWrapper;
Expand Down Expand Up @@ -37,7 +38,7 @@ SettingsStore getInstance(final @NonNull Context aContext) {
public final static boolean ENV_OVERRIDE_DEFAULT = false;
public final static boolean MULTIPROCESS_DEFAULT = false;
public final static boolean SERVO_DEFAULT = false;
public final static int UA_MODE_DEFAULT = 0;
public final static int UA_MODE_DEFAULT = GeckoSessionSettings.USER_AGENT_MODE_VR;
public final static int INPUT_MODE_DEFAULT = 1;
public final static float DISPLAY_DENSITY_DEFAULT = 1.0f;
public final static int WINDOW_WIDTH_DEFAULT = 800;
Expand Down Expand Up @@ -162,12 +163,12 @@ public void setServoEnabled(boolean isEnabled) {

public int getUaMode() {
return mPrefs.getInt(
mContext.getString(R.string.settings_key_desktop_version), UA_MODE_DEFAULT);
mContext.getString(R.string.settings_key_user_agent_version), UA_MODE_DEFAULT);
}

public void setUaMode(int mode) {
SharedPreferences.Editor editor = mPrefs.edit();
editor.putInt(mContext.getString(R.string.settings_key_desktop_version), mode);
editor.putInt(mContext.getString(R.string.settings_key_user_agent_version), mode);
editor.commit();
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/non_L10n.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<string name="settings_key_environment_override" translatable="false">settings_environment_override</string>
<string name="settings_key_multiprocess" translatable="false">settings_environment_multiprocess</string>
<string name="settings_key_servo">settings_environment_servo</string>
<string name="settings_key_desktop_version" translatable="false">settings_desktop_version</string>
<string name="settings_key_user_agent_version" translatable="false">settings_user_agent_version</string>
<string name="settings_key_input_mode" translatable="false">settings_touch_mode</string>
<string name="settings_key_display_density" translatable="false">settings_display_density</string>
<string name="settings_key_window_width" translatable="false">settings_window_width</string>
Expand Down

0 comments on commit 4efd107

Please sign in to comment.