Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f6f2e58a authored by Ricardo Cerqueira's avatar Ricardo Cerqueira Committed by Gerrit Code Review
Browse files

Merge "ADB Over Network, integration of the adb-host mode (already present)" into jellybean

parents 74f773e8 3a5ae11a
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1079,9 +1079,9 @@
    <string name="extmedia_format_message" product="nosdcard" msgid="3934016853425761078">"Tous les fichiers stockés sur la mémoire de stockage USB vont être effacés. Cette action est irréversible."</string>
    <string name="extmedia_format_message" product="default" msgid="14131895027543830">"Toutes les données stockées sur votre carte seront perdues."</string>
    <string name="extmedia_format_button_format" msgid="4131064560127478695">"Format"</string>
    <string name="adb_active_notification_title" msgid="6729044778949189918">"Débogage USB activé"</string>
    <string name="adb_active_notification_message" msgid="1016654627626476142">"Appuyez pour désactiver le débogage USB."</string>
    <string name="select_input_method" msgid="4653387336791222978">"Sélectionnez le mode de saisie"</string>
    <string name="adb_active_notification_title">Débogage android activé</string>
    <string name="adb_active_notification_message">Désactiver le débogage android (adb).</string>
    <string name="select_input_method">"Sélectionner le mode de saisie"</string>
    <string name="configure_input_methods" msgid="9091652157722495116">"Configurer les modes de saisie"</string>
    <string name="use_physical_keyboard" msgid="6203112478095117625">"Clavier physique"</string>
    <string name="hardware" msgid="7517821086888990278">"Matériel"</string>
+2 −2
Original line number Diff line number Diff line
@@ -3089,9 +3089,9 @@
    <string name="extmedia_format_button_format">Format</string>

    <!-- Title of notification shown when ADB is actively connected to the phone. -->
    <string name="adb_active_notification_title">USB debugging connected</string>
    <string name="adb_active_notification_title">Android debugging enabled</string>
    <!-- Message of notification shown when ADB is actively connected to the phone. -->
    <string name="adb_active_notification_message">Touch to disable USB debugging.</string>
    <string name="adb_active_notification_message">Select to disable debugging.</string>

    <!-- Used to replace %s in urls retreived from the signin server with locales.  For Some        -->
    <!-- devices we don't support all the locales we ship to and need to replace the '%s' with a    -->
+24 −0
Original line number Diff line number Diff line
@@ -26,6 +26,8 @@ import android.content.Context;
import android.content.Intent;
import android.content.pm.IPackageManager;
import android.content.res.Configuration;
import android.database.ContentObserver;
import android.database.Cursor;
import android.media.AudioService;
import android.net.wifi.p2p.WifiP2pService;
import android.os.Looper;
@@ -78,6 +80,19 @@ class ServerThread extends Thread {
        Log.wtf(TAG, "BOOT FAILURE " + msg, e);
    }

    private class AdbPortObserver extends ContentObserver {
        public AdbPortObserver() {
            super(null);
        }
        @Override
        public void onChange(boolean selfChange) {
            int adbPort = Settings.Secure.getInt(mContentResolver,
                Settings.Secure.ADB_PORT, 0);
            // setting this will control whether ADB runs on TCP/IP or USB
            SystemProperties.set("service.adb.tcp.port", Integer.toString(adbPort));
        }
    }

    @Override
    public void run() {
        EventLog.writeEvent(EventLogTags.BOOT_PROGRESS_SYSTEM_RUN,
@@ -664,6 +679,15 @@ class ServerThread extends Thread {
            }
        }

        // make sure the ADB_ENABLED setting value matches the secure property value
        Settings.Secure.putInt(mContentResolver, Settings.Secure.ADB_PORT,
                Integer.parseInt(SystemProperties.get("service.adb.tcp.port", "-1")));

        // register observer to listen for settings changes
        mContentResolver.registerContentObserver(
            Settings.Secure.getUriFor(Settings.Secure.ADB_PORT),
            false, new AdbPortObserver());

        // Before things start rolling, be sure we have decided whether
        // we are in safe mode.
        final boolean safeMode = wm.detectSafeMode();
+4 −0
Original line number Diff line number Diff line
@@ -348,6 +348,10 @@ public class UsbDeviceManager {
                        Settings.Secure.getUriFor(Settings.Secure.ADB_ENABLED),
                                false, new AdbSettingsObserver());

                mContentResolver.registerContentObserver(
                        Settings.Secure.getUriFor(Settings.Secure.ADB_PORT),
                                false, new AdbSettingsObserver());

                // Watch for USB configuration changes
                mUEventObserver.startObserving(USB_STATE_MATCH);
                mUEventObserver.startObserving(ACCESSORY_START_MATCH);