2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-28 12:47:43 +00:00

Small reconnection bug

Branding
This commit is contained in:
Albert Vaca 2013-08-05 01:11:28 +02:00
parent 603cc62ef0
commit 0c7cedc7aa
8 changed files with 9 additions and 16 deletions

View File

@ -9,14 +9,13 @@
<application <application
android:allowBackup="true" android:allowBackup="true"
android:icon="@drawable/ic_launcher" android:icon="@drawable/icon"
android:label="KdeConnect " android:label="KDE Connect"
android:theme="@style/AppTheme" > android:theme="@style/AppTheme" >
<activity <activity
android:name="org.kde.connect.MainActivity" android:name="org.kde.connect.MainActivity"
android:label="KdeConnect " > android:label="KDE Connect" >
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
@ -26,12 +25,12 @@
<activity <activity
android:name="org.kde.connect.MprisActivity" android:name="org.kde.connect.MprisActivity"
android:label="KdeConnect Mpris controls" android:label="MPRIS controls"
/> />
<activity <activity
android:name="org.kde.connect.SettingsActivity" android:name="org.kde.connect.SettingsActivity"
android:label="KdeConnect Settings" android:label="KDE Connect Settings"
/> />
<service <service
@ -39,7 +38,6 @@
android:name="org.kde.connect.BackgroundService"> android:name="org.kde.connect.BackgroundService">
</service> </service>
<receiver android:name="org.kde.connect.ServiceLauncher"> <receiver android:name="org.kde.connect.ServiceLauncher">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.PACKAGE_REPLACED"></action> <action android:name="android.intent.action.PACKAGE_REPLACED"></action>

View File

@ -221,12 +221,6 @@ public class BackgroundService extends Service {
} }
public void restart() {
devices.clear();
stopDiscovery();
startDiscovery();
}
@Override @Override
public void onDestroy() { public void onDestroy() {
Log.i("BackgroundService", "Destroying"); Log.i("BackgroundService", "Destroying");

View File

@ -67,7 +67,8 @@ public class AvahiTcpLinkProvider extends BaseLinkProvider {
link.setDeviceId(id); link.setDeviceId(id);
link.sendPackage(NetworkPackage.createIdentityPackage(context)); link.sendPackage(NetworkPackage.createIdentityPackage(context));
if (visibleComputers.containsKey(serviceInfo.toString())) { if (visibleComputers.containsKey(serviceInfo.getServiceName())) {
Log.e("AvahiTcpLinkProvider","Removing old connection to same device");
//Remove old connection to same host, probably down //Remove old connection to same host, probably down
connectionLost(visibleComputers.get(serviceInfo.getServiceName())); connectionLost(visibleComputers.get(serviceInfo.getServiceName()));
} }
@ -145,7 +146,6 @@ public class AvahiTcpLinkProvider extends BaseLinkProvider {
if (oldListener != null) mNsdManager.stopServiceDiscovery(oldListener); if (oldListener != null) mNsdManager.stopServiceDiscovery(oldListener);
oldListener = null; oldListener = null;
visibleComputers.clear();
} }

View File

@ -36,7 +36,8 @@ public class MainActivity extends Activity {
BackgroundService.RunCommand(MainActivity.this, new BackgroundService.InstanceCallback() { BackgroundService.RunCommand(MainActivity.this, new BackgroundService.InstanceCallback() {
@Override @Override
public void onServiceStart(BackgroundService service) { public void onServiceStart(BackgroundService service) {
service.restart(); service.stopDiscovery();
service.startDiscovery();
} }
}); });
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB