Merge branch 'fix-acra-crashes' into 'master'

Fix ACRA crashes

See merge request fdroid/fdroidclient!845
This commit is contained in:
Hans-Christoph Steiner 2019-10-14 14:46:42 +00:00
commit 8ee5fa75e4
5 changed files with 31 additions and 3 deletions

View File

@ -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

View File

@ -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);

View File

@ -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)

View File

@ -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) {

View File

@ -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;