Bug 1404311 - [1.1] Enable remote USB debugging of custom tabs and PWAs through Fennec settings. r=snorp

This commit is contained in:
Eugen Sawin 2017-10-02 23:33:41 +02:00
Родитель 503ba2711d
Коммит bb9e1eadc9
3 изменённых файлов: 14 добавлений и 2 удалений

Просмотреть файл

@ -38,8 +38,10 @@ import org.mozilla.gecko.BrowserApp;
import org.mozilla.gecko.DoorHangerPopup;
import org.mozilla.gecko.EventDispatcher;
import org.mozilla.gecko.FormAssistPopup;
import org.mozilla.gecko.GeckoSharedPrefs;
import org.mozilla.gecko.GeckoView;
import org.mozilla.gecko.GeckoViewSettings;
import org.mozilla.gecko.preferences.GeckoPreferences;
import org.mozilla.gecko.R;
import org.mozilla.gecko.SnackbarBuilder;
import org.mozilla.gecko.Telemetry;
@ -137,6 +139,10 @@ public class CustomTabsActivity extends AppCompatActivity
final GeckoViewSettings settings = mGeckoView.getSettings();
settings.setBoolean(GeckoViewSettings.USE_MULTIPROCESS, false);
settings.setBoolean(
GeckoViewSettings.USE_REMOTE_DEBUGGER,
GeckoSharedPrefs.forApp(this).getBoolean(
GeckoPreferences.PREFS_DEVTOOLS_REMOTE_USB_ENABLED, false));
if (intent != null && !TextUtils.isEmpty(intent.getDataString())) {
mGeckoView.loadUri(intent.getDataString());

Просмотреть файл

@ -130,8 +130,8 @@ public class GeckoPreferences
private static final String PREFS_GEO_REPORTING = NON_PREF_PREFIX + "app.geo.reportdata";
private static final String PREFS_GEO_LEARN_MORE = NON_PREF_PREFIX + "geo.learn_more";
private static final String PREFS_HEALTHREPORT_LINK = NON_PREF_PREFIX + "healthreport.link";
private static final String PREFS_DEVTOOLS_REMOTE_USB_ENABLED = "devtools.remote.usb.enabled";
private static final String PREFS_DEVTOOLS_REMOTE_WIFI_ENABLED = "devtools.remote.wifi.enabled";
public static final String PREFS_DEVTOOLS_REMOTE_USB_ENABLED = "devtools.remote.usb.enabled";
public static final String PREFS_DEVTOOLS_REMOTE_WIFI_ENABLED = "devtools.remote.wifi.enabled";
private static final String PREFS_DEVTOOLS_REMOTE_LINK = NON_PREF_PREFIX + "remote_debugging.link";
public static final String PREFS_VOICE_INPUT_ENABLED = NON_PREF_PREFIX + "voice_input_enabled";
public static final String PREFS_QRCODE_ENABLED = NON_PREF_PREFIX + "qrcode_enabled";

Просмотреть файл

@ -32,8 +32,10 @@ import org.mozilla.gecko.ActivityHandlerHelper;
import org.mozilla.gecko.AppConstants;
import org.mozilla.gecko.DoorHangerPopup;
import org.mozilla.gecko.GeckoScreenOrientation;
import org.mozilla.gecko.GeckoSharedPrefs;
import org.mozilla.gecko.GeckoView;
import org.mozilla.gecko.GeckoViewSettings;
import org.mozilla.gecko.preferences.GeckoPreferences;
import org.mozilla.gecko.R;
import org.mozilla.gecko.customtabs.CustomTabsActivity;
import org.mozilla.gecko.permissions.Permissions;
@ -105,6 +107,10 @@ public class WebAppActivity extends AppCompatActivity
final GeckoViewSettings settings = mGeckoView.getSettings();
settings.setBoolean(GeckoViewSettings.USE_MULTIPROCESS, false);
settings.setBoolean(
GeckoViewSettings.USE_REMOTE_DEBUGGER,
GeckoSharedPrefs.forApp(this).getBoolean(
GeckoPreferences.PREFS_DEVTOOLS_REMOTE_USB_ENABLED, false));
mManifest = WebAppManifest.fromFile(getIntent().getStringExtra(MANIFEST_URL),
getIntent().getStringExtra(MANIFEST_PATH));