|
14 | 14 | import android.content.ServiceConnection;
|
15 | 15 |
|
16 | 16 | import android.content.SharedPreferences;
|
| 17 | +import android.os.Bundle; |
17 | 18 | import android.os.IBinder;
|
18 | 19 | import android.os.RemoteException;
|
19 | 20 | import android.preference.PreferenceManager;
|
|
30 | 31 | import com.atakmap.android.meshtastic.plugin.R;
|
31 | 32 | import com.atakmap.android.util.NotificationUtil;
|
32 | 33 | import com.atakmap.app.preferences.ToolsPreferenceFragment;
|
| 34 | +import com.atakmap.comms.CotServiceRemote; |
33 | 35 | import com.atakmap.coremap.filesystem.FileSystemUtils;
|
34 | 36 | import com.atakmap.coremap.log.Log;
|
35 | 37 | import com.atakmap.coremap.cot.event.CotEvent;
|
|
68 | 70 |
|
69 | 71 | public class MeshtasticMapComponent extends DropDownMapComponent
|
70 | 72 | implements CommsMapComponent.PreSendProcessor,
|
71 |
| - SharedPreferences.OnSharedPreferenceChangeListener { |
| 73 | + SharedPreferences.OnSharedPreferenceChangeListener, |
| 74 | + CotServiceRemote.ConnectionListener { |
72 | 75 | private static final String TAG = "MeshtasticMapComponent";
|
73 | 76 | private Context pluginContext;
|
74 | 77 | public static CotShrinkerFactory cotShrinkerFactory = new CotShrinkerFactory();
|
75 | 78 | public static CotShrinker cotShrinker = cotShrinkerFactory.createCotShrinker();
|
| 79 | + |
| 80 | + @Override |
| 81 | + public void onCotServiceConnected(Bundle bundle) { |
| 82 | + |
| 83 | + } |
| 84 | + |
| 85 | + @Override |
| 86 | + public void onCotServiceDisconnected() { |
| 87 | + |
| 88 | + } |
| 89 | + |
76 | 90 | public enum ServiceConnectionState {
|
77 | 91 | DISCONNECTED,
|
78 | 92 | CONNECTED
|
@@ -687,7 +701,10 @@ public void onCreate(final Context context, Intent intent, MapView view) {
|
687 | 701 | CommsMapComponent.getInstance().registerPreSendProcessor(this);
|
688 | 702 | context.setTheme(R.style.ATAKPluginTheme);
|
689 | 703 | pluginContext = context;
|
690 |
| - |
| 704 | + |
| 705 | + |
| 706 | + |
| 707 | + |
691 | 708 | mNotifyManager =
|
692 | 709 | (NotificationManager) view.getContext()
|
693 | 710 | .getSystemService(NOTIFICATION_SERVICE);
|
@@ -742,6 +759,10 @@ public void onCreate(final Context context, Intent intent, MapView view) {
|
742 | 759 |
|
743 | 760 | view.getContext().registerReceiver(mr, intentFilter, Context.RECEIVER_EXPORTED);
|
744 | 761 |
|
| 762 | + CotServiceRemote cotService = new CotServiceRemote(); |
| 763 | + cotService.setCotEventListener(mr); |
| 764 | + cotService.connect(this); |
| 765 | + |
745 | 766 | mServiceIntent = new Intent();
|
746 | 767 | mServiceIntent.setClassName(PACKAGE_NAME, CLASS_NAME);
|
747 | 768 |
|
|
0 commit comments