diff --git a/CHANGELOG.md b/CHANGELOG.md index b4954125e..b169869c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### 1.7.1 (2019-07-31) + +* fix crashes from ACRA report emails + ### 1.7 (2019-07-06) * fix crash in Panic Settings diff --git a/app/src/full/java/org/fdroid/fdroid/nearby/StartSwapView.java b/app/src/full/java/org/fdroid/fdroid/nearby/StartSwapView.java index 177da7ee9..fe04772da 100644 --- a/app/src/full/java/org/fdroid/fdroid/nearby/StartSwapView.java +++ b/app/src/full/java/org/fdroid/fdroid/nearby/StartSwapView.java @@ -223,7 +223,13 @@ public class StartSwapView extends SwapView { if (textWifiVisible != null) { textWifiVisible.setText(R.string.swap_visible_hotspot); } - viewWifiNetwork.setText(getContext().getString(R.string.swap_active_hotspot, config.SSID)); + Context context = getContext(); + if (config == null) { + viewWifiNetwork.setText(context.getString(R.string.swap_active_hotspot, + context.getString(R.string.swap_blank_wifi_ssid))); + } else { + viewWifiNetwork.setText(context.getString(R.string.swap_active_hotspot, config.SSID)); + } } else if (TextUtils.isEmpty(FDroidApp.ssid)) { // not connected to or setup with any wifi network viewWifiNetwork.setText(R.string.swap_no_wifi_network); diff --git a/app/src/full/java/org/fdroid/fdroid/nearby/SwapView.java b/app/src/full/java/org/fdroid/fdroid/nearby/SwapView.java index 864bc980c..f400d1ef6 100644 --- a/app/src/full/java/org/fdroid/fdroid/nearby/SwapView.java +++ b/app/src/full/java/org/fdroid/fdroid/nearby/SwapView.java @@ -32,8 +32,19 @@ public class SwapView extends RelativeLayout { this(context, attrs, 0); } + /** + * In order to support Android < 21, this calls {@code super} rather than + * {@code this}. {@link RelativeLayout}'s methods just use a 0 for the + * fourth argument, just like this used to. + */ public SwapView(Context context, AttributeSet attrs, int defStyleAttr) { - this(context, attrs, defStyleAttr, 0); + super(context, attrs, defStyleAttr); + final TypedArray a = context.obtainStyledAttributes( + attrs, R.styleable.SwapView, 0, 0); + toolbarColor = a.getColor(R.styleable.SwapView_toolbarColor, + getResources().getColor(R.color.swap_blue)); + toolbarTitle = a.getString(R.styleable.SwapView_toolbarTitle); + a.recycle(); } @TargetApi(21) diff --git a/app/src/full/java/org/fdroid/fdroid/nearby/TreeUriScannerIntentService.java b/app/src/full/java/org/fdroid/fdroid/nearby/TreeUriScannerIntentService.java index 11b18a468..3f4023c7b 100644 --- a/app/src/full/java/org/fdroid/fdroid/nearby/TreeUriScannerIntentService.java +++ b/app/src/full/java/org/fdroid/fdroid/nearby/TreeUriScannerIntentService.java @@ -96,6 +96,9 @@ public class TreeUriScannerIntentService extends IntentService { * like an SD Card that can be directly accessed via the file system. */ public static void onActivityResult(Activity activity, Intent intent) { + if (intent == null) { + return; + } Uri uri = intent.getData(); if (uri != null) { if (Build.VERSION.SDK_INT >= 19) { diff --git a/app/src/full/java/org/fdroid/fdroid/nearby/WifiStateChangeService.java b/app/src/full/java/org/fdroid/fdroid/nearby/WifiStateChangeService.java index cf255d93a..e1f185d61 100644 --- a/app/src/full/java/org/fdroid/fdroid/nearby/WifiStateChangeService.java +++ b/app/src/full/java/org/fdroid/fdroid/nearby/WifiStateChangeService.java @@ -257,7 +257,11 @@ public class WifiStateChangeService extends IntentService { Utils.debugLog(TAG, "WifiConfiguration: " + wifiConfiguration); if (wifiConfiguration == null) { FDroidApp.ssid = getString(R.string.swap_active_hotspot, ""); - } else if (wifiConfiguration.hiddenSSID) { + FDroidApp.bssid = ""; + return; + } + + if (wifiConfiguration.hiddenSSID) { FDroidApp.ssid = getString(R.string.swap_hidden_wifi_ssid); } else { FDroidApp.ssid = wifiConfiguration.SSID;