Changeset View
Changeset View
Standalone View
Standalone View
src/org/kde/kdeconnect/Backends/LanBackend/LanPairingHandler.java
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 54 | private NetworkPacket createPairPacket() { | |||
---|---|---|---|---|---|
56 | np.set("pair", true); | 56 | np.set("pair", true); | ||
57 | SharedPreferences globalSettings = PreferenceManager.getDefaultSharedPreferences(mDevice.getContext()); | 57 | SharedPreferences globalSettings = PreferenceManager.getDefaultSharedPreferences(mDevice.getContext()); | ||
58 | String publicKey = "-----BEGIN PUBLIC KEY-----\n" + globalSettings.getString("publicKey", "").trim()+ "\n-----END PUBLIC KEY-----\n"; | 58 | String publicKey = "-----BEGIN PUBLIC KEY-----\n" + globalSettings.getString("publicKey", "").trim()+ "\n-----END PUBLIC KEY-----\n"; | ||
59 | np.set("publicKey", publicKey); | 59 | np.set("publicKey", publicKey); | ||
60 | return np; | 60 | return np; | ||
61 | } | 61 | } | ||
62 | 62 | | |||
63 | @Override | 63 | @Override | ||
64 | public void packageReceived(NetworkPacket np) throws Exception{ | 64 | public void packageReceived(NetworkPacket np) { | ||
65 | 65 | | |||
66 | boolean wantsPair = np.getBoolean("pair"); | 66 | boolean wantsPair = np.getBoolean("pair"); | ||
67 | 67 | | |||
68 | if (wantsPair == isPaired()) { | 68 | if (wantsPair == isPaired()) { | ||
69 | if (mPairStatus == PairStatus.Requested) { | 69 | if (mPairStatus == PairStatus.Requested) { | ||
70 | //Log.e("Device","Unpairing (pair rejected)"); | 70 | //Log.e("Device","Unpairing (pair rejected)"); | ||
71 | mPairStatus = PairStatus.NotPaired; | 71 | mPairStatus = PairStatus.NotPaired; | ||
72 | hidePairingNotification(); | 72 | hidePairingNotification(); | ||
▲ Show 20 Lines • Show All 177 Lines • Show Last 20 Lines |