Skip to content

Commit

Permalink
Keep compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
ale5000-git committed Mar 22, 2024
1 parent fba05ee commit ec5e3f4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ buildscript {
ext.biometricVersion = '1.1.0'
ext.coreVersion = '1.12.0'
ext.fragmentVersion = '1.6.2'
ext.lifecycleVersion = '2.7.0'
ext.lifecycleVersion = '2.6.2'
ext.loaderVersion = '1.1.0'
ext.materialVersion = '1.11.0'
ext.mediarouterVersion = '1.6.0'
ext.multidexVersion = '2.0.1'
ext.navigationVersion = '2.7.7'
ext.preferenceVersion = '1.2.0'
ext.recyclerviewVersion = '1.3.2'
ext.webkitVersion = '1.10.0'
ext.webkitVersion = '1.8.0'

ext.slf4jVersion = '1.7.36'
ext.volleyVersion = '1.2.1'
Expand All @@ -33,7 +33,7 @@ buildscript {

ext.androidBuildVersionTools = '34.0.0'

ext.androidMinSdk = 19
ext.androidMinSdk = 14
ext.androidTargetSdk = 29
ext.androidCompileSdk = 34

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ public Bundle call(String method, String arg, Bundle extras) {
Account[] accounts = null;
if (arg != null && (arg.equals(DEFAULT_ACCOUNT_TYPE) || arg.startsWith(DEFAULT_ACCOUNT_TYPE + "."))) {
AccountManager am = AccountManager.get(getContext());
if (SDK_INT >= 18) {
accounts = am.getAccountsByTypeForPackage(arg, packageName);
} else {
accounts = am.getAccountsByType(arg);
}
if (SDK_INT >= 26 && accounts != null && arg.equals(DEFAULT_ACCOUNT_TYPE)) {
for (Account account : accounts) {
if (am.getAccountVisibility(account, packageName) == AccountManager.VISIBILITY_UNDEFINED &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fun Context.getDetailedLocationSettingsStates(): DetailedLocationSettingsStates
val bluetoothLeSystemFeature = packageManager.hasSystemFeature(FEATURE_BLUETOOTH_LE)
val locationManager = getSystemService<LocationManager>()
val bluetoothManager = if (bluetoothLeSystemFeature) getSystemService<BluetoothManager>() else null
val bleAdapter = bluetoothManager?.adapter
val bleAdapter = if (SDK_INT >= 18) bluetoothManager?.adapter else null

return DetailedLocationSettingsStates(
gpsSystemFeature = packageManager.hasSystemFeature(FEATURE_LOCATION_GPS),
Expand All @@ -66,7 +66,7 @@ fun Context.getDetailedLocationSettingsStates(): DetailedLocationSettingsStates
packageManager.checkPermission(ACCESS_BACKGROUND_LOCATION, packageName) == PERMISSION_GRANTED,
blePresent = bleAdapter != null,
bleEnabled = bleAdapter?.isEnabled == true,
bleScanAlways = Settings.Global.getInt(contentResolver, "ble_scan_always_enabled", 0) == 1,
airplaneMode = Settings.Global.getInt(contentResolver, Settings.Global.AIRPLANE_MODE_ON, 0) != 0
bleScanAlways = if (SDK_INT >= 17) Settings.Global.getInt(contentResolver, "ble_scan_always_enabled", 0) == 1 else false,
airplaneMode = if (SDK_INT >= 17) Settings.Global.getInt(contentResolver, Settings.Global.AIRPLANE_MODE_ON, 0) != 0 else Settings.System.getInt(contentResolver, Settings.System.AIRPLANE_MODE_ON, 0) != 0
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="8dp"
android:layout_marginLeft="30dp"
android:layout_marginStart="30dp"
android:text="@string/location_settings_dialog_message_location_services_gps_and_nlp"
android:textColor="#e4e1e5"
Expand All @@ -44,6 +45,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="8dp"
android:layout_marginLeft="30dp"
android:layout_marginStart="30dp"
android:text="@string/location_settings_dialog_message_gls_consent"
android:textColor="#e4e1e5"
Expand All @@ -67,6 +69,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginRight="10dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="24dp"
android:gravity="right"
Expand Down

0 comments on commit ec5e3f4

Please sign in to comment.