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

Commit 1b586ec8 authored by Yifan Hong's avatar Yifan Hong
Browse files

IAdbManager.getPairDevices returns FingerprintAndPairDevice[].

Map is not supported in C++ backend. To compile IAdbManager in C++,
Map is translated into a list of key, value tuples.

Test: pass
Bug: 190867939
Change-Id: I1a057306161a4f8eaef33e3c40b1db9494aea3e5
parent d6175099
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.debug.AdbManager;
import android.debug.FingerprintAndPairDevice;
import android.debug.IAdbManager;
import android.debug.PairDevice;
import android.os.Build;
@@ -310,8 +311,12 @@ public class WirelessDebuggingFragment extends DashboardFragment
            mAdbManager = IAdbManager.Stub.asInterface(ServiceManager.getService(
                    Context.ADB_SERVICE));
            try {
                Map<String, PairDevice> newList = mAdbManager.getPairedDevices();
                updatePairedDevicePreferences(newList);
                FingerprintAndPairDevice[] newList = mAdbManager.getPairedDevices();
                Map<String, PairDevice> newMap = new HashMap<>();
                for (FingerprintAndPairDevice pair : newList) {
                    newMap.put(pair.keyFingerprint, pair.device);
                }
                updatePairedDevicePreferences(newMap);
                mConnectionPort = mAdbManager.getAdbWirelessPort();
                if (mConnectionPort > 0) {
                    Log.i(TAG, "onEnabled(): connect_port=" + mConnectionPort);