mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-24 09:35:50 +01:00
Commit old weather experiment - might be worth continuing
This commit is contained in:
parent
55989c426c
commit
483c435aa5
@ -196,6 +196,13 @@
|
|||||||
</service>
|
</service>
|
||||||
<service android:name=".service.DeviceCommunicationService" />
|
<service android:name=".service.DeviceCommunicationService" />
|
||||||
|
|
||||||
|
<receiver
|
||||||
|
android:name=".externalevents.WeatherNotificationReceiver"
|
||||||
|
android:enabled="true">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="ru.gelin.android.weather.notification.ACTION_WEATHER_UPDATE_2" />
|
||||||
|
</intent-filter>
|
||||||
|
</receiver>
|
||||||
<receiver
|
<receiver
|
||||||
android:name=".externalevents.BluetoothStateChangeReceiver"
|
android:name=".externalevents.BluetoothStateChangeReceiver"
|
||||||
android:exported="false">
|
android:exported="false">
|
||||||
|
@ -0,0 +1,33 @@
|
|||||||
|
package nodomain.freeyourgadget.gadgetbridge.externalevents;
|
||||||
|
|
||||||
|
import android.content.BroadcastReceiver;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
public class WeatherNotificationReceiver extends BroadcastReceiver {
|
||||||
|
|
||||||
|
private static final Logger LOG = LoggerFactory.getLogger(WeatherNotificationReceiver.class);
|
||||||
|
private static final int VERSION = 2;
|
||||||
|
private final String TAG = this.getClass().getSimpleName();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onReceive(Context context, Intent intent) {
|
||||||
|
if (!intent.getAction().contains("WEATHER_UPDATE_2")) {
|
||||||
|
LOG.info("Wrong action");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int f = intent.getParcelableExtra("ru.gelin.android.weather.notification.EXTRA_WEATHER");
|
||||||
|
// int version = parcel.readInt();
|
||||||
|
// if (version != VERSION) {
|
||||||
|
// LOG.info("Wrong version");
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
//Bundle bundle = parcel.readBundle(this.getClass().getClassLoader());
|
||||||
|
// String location = bundle.getString("weather_location");
|
||||||
|
// LOG.info("got location: " + location);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user