diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 2951c74..c7a9fa9 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,15 +1,18 @@ - + - + + + + diff --git a/assets/ic_launcher_wifisync.svg b/assets/ic_launcher_wifisync.svg new file mode 100644 index 0000000..4b3a990 --- /dev/null +++ b/assets/ic_launcher_wifisync.svg @@ -0,0 +1,3944 @@ + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/drawable-hdpi/ic_launcher_wifisync.png b/res/drawable-hdpi/ic_launcher_wifisync.png new file mode 100644 index 0000000..1aae482 Binary files /dev/null and b/res/drawable-hdpi/ic_launcher_wifisync.png differ diff --git a/src/net/skweez/wifisync/SyncOnWifiStateReceiver.java b/src/net/skweez/wifisync/SyncOnWifiStateReceiver.java index bd220ea..6d5ce4f 100644 --- a/src/net/skweez/wifisync/SyncOnWifiStateReceiver.java +++ b/src/net/skweez/wifisync/SyncOnWifiStateReceiver.java @@ -7,20 +7,22 @@ import android.net.NetworkInfo; import android.net.NetworkInfo.State; import android.net.wifi.WifiManager; +import android.os.Bundle; import android.util.Log; public class SyncOnWifiStateReceiver extends BroadcastReceiver { + /** The log tag. */ private static String TAG = "WifiSync"; @Override - public void onReceive(Context context, Intent intent) { + public void onReceive(final Context context, final Intent intent) { final String action = intent.getAction(); if (action.equals(WifiManager.NETWORK_STATE_CHANGED_ACTION)) { - NetworkInfo networkInfo = (NetworkInfo) intent + final NetworkInfo networkInfo = (NetworkInfo) intent .getParcelableExtra(WifiManager.EXTRA_NETWORK_INFO); if (networkInfo.getState().equals(State.CONNECTED)) { @@ -31,13 +33,29 @@ public void onReceive(Context context, Intent intent) { } else if (action .equals(WifiManager.SUPPLICANT_CONNECTION_CHANGE_ACTION)) { - boolean connected = intent.getBooleanExtra( + final boolean connected = intent.getBooleanExtra( WifiManager.EXTRA_SUPPLICANT_CONNECTED, true); if (connected == false) { ContentResolver.setMasterSyncAutomatically(false); Log.d(TAG, "Auto sync disabled."); } + + } else { + + Log.d(TAG, "action: " + action); + debugExtras(intent); + + } + } + + /** + * @param intent + */ + private void debugExtras(final Intent intent) { + Bundle extras = intent.getExtras(); + for (String key : extras.keySet()) { + Log.d(TAG, key + "=" + extras.get(key)); } } }