mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-18 14:31:23 +02:00
fixed Android 12 installation errors and crashes
This commit is contained in:
@@ -33,23 +33,24 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".gui.MainActivity"
|
android:name=".gui.MainActivity"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/AppTheme.NoActionBar">
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity android:name=".gui.slides.AppIntroActivity" android:theme="@style/AppTheme.NoActionBar"/>
|
<activity android:name=".gui.slides.AppIntroActivity" android:theme="@style/AppTheme.NoActionBar" android:exported="true"/>
|
||||||
<activity android:name=".gui.slides.SlideToNavigationAdapter" android:theme="@style/AppTheme.NoActionBar"/>
|
<activity android:name=".gui.slides.SlideToNavigationAdapter" android:theme="@style/AppTheme.NoActionBar" android:exported="true"/>
|
||||||
|
|
||||||
<receiver android:name=".core.alarm.ReminderBootReceiver" android:enabled="false">
|
<receiver android:name=".core.alarm.ReminderBootReceiver" android:enabled="false" android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.BOOT_COMPLETED"/>
|
<action android:name="android.intent.action.BOOT_COMPLETED"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
<receiver android:name=".gui.widget.WidgetProvider">
|
<receiver android:name=".gui.widget.WidgetProvider" android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
@@ -57,7 +58,7 @@
|
|||||||
android:resource="@xml/widget_info" />
|
android:resource="@xml/widget_info" />
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
<activity android:name=".gui.widget.WidgetConfigure">
|
<activity android:name=".gui.widget.WidgetConfigure" android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE"/>
|
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
@@ -102,6 +102,7 @@ public class BluetoothSettingsFragment extends Fragment {
|
|||||||
if (PermissionHelper.requestBluetoothPermission(this)) {
|
if (PermissionHelper.requestBluetoothPermission(this)) {
|
||||||
startBluetoothDiscovery();
|
startBluetoothDiscovery();
|
||||||
}
|
}
|
||||||
|
|
||||||
super.onResume();
|
super.onResume();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -404,6 +405,13 @@ public class BluetoothSettingsFragment extends Fragment {
|
|||||||
} else {
|
} else {
|
||||||
Timber.d("At least one Bluetooth permission was not granted");
|
Timber.d("At least one Bluetooth permission was not granted");
|
||||||
Toast.makeText(requireContext(), R.string.permission_not_granted, Toast.LENGTH_SHORT).show();
|
Toast.makeText(requireContext(), R.string.permission_not_granted, Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
|
if (getActivity().findViewById(R.id.nav_host_fragment) != null){
|
||||||
|
Navigation.findNavController(requireActivity(), R.id.nav_host_fragment).getPreviousBackStackEntry().getSavedStateHandle().set("update", true);
|
||||||
|
Navigation.findNavController(requireActivity(), R.id.nav_host_fragment).navigateUp();
|
||||||
|
} else {
|
||||||
|
getActivity().finish();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -72,6 +72,7 @@ public class PermissionHelper {
|
|||||||
Timber.d("SDK >= 31 request for Bluetooth Scan and Bluetooth connect permissions");
|
Timber.d("SDK >= 31 request for Bluetooth Scan and Bluetooth connect permissions");
|
||||||
requiredPermissions = new String[]{Manifest.permission.BLUETOOTH_SCAN, Manifest.permission.BLUETOOTH_CONNECT};
|
requiredPermissions = new String[]{Manifest.permission.BLUETOOTH_SCAN, Manifest.permission.BLUETOOTH_CONNECT};
|
||||||
fragment.requestPermissions(requiredPermissions, PERMISSIONS_REQUEST_ACCESS_BLUETOOTH);
|
fragment.requestPermissions(requiredPermissions, PERMISSIONS_REQUEST_ACCESS_BLUETOOTH);
|
||||||
|
return false;
|
||||||
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && targetSdkVersion >= Build.VERSION_CODES.Q) {
|
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && targetSdkVersion >= Build.VERSION_CODES.Q) {
|
||||||
Timber.d("SDK >= 29 request for Access fine location permission");
|
Timber.d("SDK >= 29 request for Access fine location permission");
|
||||||
return requestLocationPermission(fragment, new String[]{Manifest.permission.ACCESS_FINE_LOCATION});
|
return requestLocationPermission(fragment, new String[]{Manifest.permission.ACCESS_FINE_LOCATION});
|
||||||
@@ -79,8 +80,6 @@ public class PermissionHelper {
|
|||||||
Timber.d("SDK < 29 request for coarse location permission");
|
Timber.d("SDK < 29 request for coarse location permission");
|
||||||
return requestLocationPermission(fragment, new String[]{Manifest.permission.ACCESS_COARSE_LOCATION});
|
return requestLocationPermission(fragment, new String[]{Manifest.permission.ACCESS_COARSE_LOCATION});
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean requestLocationPermission(final Fragment fragment, String[] requiredPermissions) {
|
private static boolean requestLocationPermission(final Fragment fragment, String[] requiredPermissions) {
|
||||||
|
Reference in New Issue
Block a user