Further ABS/Android 2 related compatibility fixes.
Change-Id: I1689cb26253581ba595e67df47b3d6220d751dad
This commit is contained in:
@@ -25,7 +25,6 @@ import android.content.IntentFilter;
|
|||||||
import android.content.ServiceConnection;
|
import android.content.ServiceConnection;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.support.v4.content.LocalBroadcastManager;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
@@ -49,8 +48,7 @@ public class SelectorActivity extends Activity {
|
|||||||
|
|
||||||
IntentFilter aFilter = new IntentFilter(
|
IntentFilter aFilter = new IntentFilter(
|
||||||
CommunicationService.MSG_SERVERLIST_CHANGED);
|
CommunicationService.MSG_SERVERLIST_CHANGED);
|
||||||
LocalBroadcastManager.getInstance(this).registerReceiver(mListener,
|
registerReceiver(mListener, aFilter);
|
||||||
aFilter);
|
|
||||||
|
|
||||||
mBluetoothContainer = findViewById(R.id.selector_container_bluetooth);
|
mBluetoothContainer = findViewById(R.id.selector_container_bluetooth);
|
||||||
mBluetoothList = (LinearLayout) findViewById(R.id.selector_list_bluetooth);
|
mBluetoothList = (LinearLayout) findViewById(R.id.selector_list_bluetooth);
|
||||||
@@ -64,7 +62,7 @@ public class SelectorActivity extends Activity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
LocalBroadcastManager.getInstance(this).unregisterReceiver(mListener);
|
unregisterReceiver(mListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -168,7 +166,7 @@ public class SelectorActivity extends Activity {
|
|||||||
aText.setOnClickListener(mClickListener);
|
aText.setOnClickListener(mClickListener);
|
||||||
aText.setText(aServer.getName());
|
aText.setText(aServer.getName());
|
||||||
aLayout.addView(aView);
|
aLayout.addView(aView);
|
||||||
aMap.put(aServer, aText);
|
aMap.put(aServer, aView);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -8,8 +8,6 @@ import java.net.InetAddress;
|
|||||||
import java.net.SocketException;
|
import java.net.SocketException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import org.libreoffice.impressremote.communication.Server.Protocol;
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.support.v4.content.LocalBroadcastManager;
|
import android.support.v4.content.LocalBroadcastManager;
|
||||||
@@ -77,8 +75,7 @@ public class ServerFinder {
|
|||||||
|
|
||||||
Intent aIntent = new Intent(
|
Intent aIntent = new Intent(
|
||||||
CommunicationService.MSG_SERVERLIST_CHANGED);
|
CommunicationService.MSG_SERVERLIST_CHANGED);
|
||||||
LocalBroadcastManager.getInstance(mContext).sendBroadcast(aIntent);
|
mContext.sendBroadcast(aIntent);
|
||||||
|
|
||||||
} catch (java.net.SocketTimeoutException e) {
|
} catch (java.net.SocketTimeoutException e) {
|
||||||
// Ignore -- we want to timeout to enable checking whether we
|
// Ignore -- we want to timeout to enable checking whether we
|
||||||
// should stop listening periodically
|
// should stop listening periodically
|
||||||
@@ -95,11 +92,6 @@ public class ServerFinder {
|
|||||||
|
|
||||||
mFinishRequested = false;
|
mFinishRequested = false;
|
||||||
|
|
||||||
// TODO: Remove for production
|
|
||||||
mServerList.put("10.0.2.2",
|
|
||||||
new Server(Protocol.NETWORK, "10.0.2.2",
|
|
||||||
"Android Emulator Localhost", System
|
|
||||||
.currentTimeMillis()));
|
|
||||||
Intent aIntent = new Intent(CommunicationService.MSG_SERVERLIST_CHANGED);
|
Intent aIntent = new Intent(CommunicationService.MSG_SERVERLIST_CHANGED);
|
||||||
LocalBroadcastManager.getInstance(mContext).sendBroadcast(aIntent);
|
LocalBroadcastManager.getInstance(mContext).sendBroadcast(aIntent);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user