diff --git a/xwords4/android/app/build.gradle b/xwords4/android/app/build.gradle index bd5c85b7e..a6e2287ac 100644 --- a/xwords4/android/app/build.gradle +++ b/xwords4/android/app/build.gradle @@ -112,9 +112,10 @@ android { flavorDimensions "variant"//, "abi" productFlavors { all { - buildConfigField "int", "FLAG_IMMUTABLE", "0" - buildConfigField "boolean", "BLUETOOTH_CONNECT", "true" - buildConfigField "boolean", "BLUETOOTH_SCAN", "true" + android { + targetSdkVersion 31 + compileSdkVersion 31 + } buildConfigField "String", "JNI_LIB_NAME", "\"xwjni\"" buildConfigField "String", "DB_NAME", "\"xwdb\"" buildConfigField "String", "BUILD_INFO_NAME", "\"${BUILD_INFO_NAME}\"" @@ -170,14 +171,6 @@ android { xw4d { dimension "variant" - android { - targetSdkVersion 31 - compileSdkVersion 31 - } - buildConfigField "String", "BLUETOOTH_CONNECT", "android.Manifest.permission.BLUETOOTH_CONNECT" - buildConfigField "String", "BLUETOOTH_SCAN", "android.Manifest.permission.BLUETOOTH_SCAN" - buildConfigField "int", "FLAG_IMMUTABLE", "android.app.PendingIntent.FLAG_IMMUTABLE" - buildConfigField "String", "DB_NAME", "\"xwddb\"" applicationId "org.eehouse.android.xw4dbg" resValue "string", "app_name", "CrossDbg" diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DupeModeTimer.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DupeModeTimer.java index db5835be2..0da021efa 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DupeModeTimer.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DupeModeTimer.java @@ -173,7 +173,7 @@ public class DupeModeTimer extends BroadcastReceiver { sCurTimer = whenSeconds; Intent intent = new Intent( context, DupeModeTimer.class ); PendingIntent pi = PendingIntent.getBroadcast( context, 0, intent, - BuildConfig.FLAG_IMMUTABLE ); + PendingIntent.FLAG_IMMUTABLE ); long now = Utils.getCurSeconds(); long fire_millis = SystemClock.elapsedRealtime() diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/NBSProto.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/NBSProto.java index a37ed5ae0..de29f03ee 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/NBSProto.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/NBSProto.java @@ -380,7 +380,7 @@ public class NBSProto { { Intent intent = new Intent( msg ); return PendingIntent.getBroadcast( context, 0, intent, - BuildConfig.FLAG_IMMUTABLE ); + PendingIntent.FLAG_IMMUTABLE ); } private void cacheForRetry( QueueElem elem ) diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/Perms23.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/Perms23.java index d6756aa1d..ba781129c 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/Perms23.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/Perms23.java @@ -48,8 +48,8 @@ public class Perms23 { SEND_SMS(Manifest.permission.SEND_SMS), RECEIVE_SMS(Manifest.permission.RECEIVE_SMS), READ_CONTACTS(Manifest.permission.READ_CONTACTS), - BLUETOOTH_CONNECT(BuildConfig.BLUETOOTH_CONNECT), - BLUETOOTH_SCAN(BuildConfig.BLUETOOTH_SCAN); + BLUETOOTH_CONNECT(Manifest.permission.BLUETOOTH_CONNECT), + BLUETOOTH_SCAN(Manifest.permission.BLUETOOTH_SCAN); private String m_str = null; private Perm(String str) { m_str = str; } @@ -59,7 +59,6 @@ public class Perms23 { { return !permInManifest( context, this ); } - public boolean notNeeded() { return null == m_str; } public static Perm getFor( String str ) { Perm result = null; for ( Perm one : Perm.values() ) { @@ -422,9 +421,7 @@ public class Perms23 { for ( int ii = 0; result && ii < perms.length; ++ii ) { Perm perm = perms[ii]; boolean thisResult; - if ( perm.notNeeded() ) { - thisResult = true; - } else if ( perm.isBanned(context) ) { + if ( perm.isBanned(context) ) { thisResult = bannedWithWorkaround( context, perm ); } else { thisResult = PackageManager.PERMISSION_GRANTED diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/TimerReceiver.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/TimerReceiver.java index fadb11210..f2e5ac20e 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/TimerReceiver.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/TimerReceiver.java @@ -391,7 +391,7 @@ public class TimerReceiver extends BroadcastReceiver { intent.putExtra( KEY_TIMER_ID, timerID ); PendingIntent pi = PendingIntent .getBroadcast( context, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT - | BuildConfig.FLAG_IMMUTABLE ); + | PendingIntent.FLAG_IMMUTABLE ); am.set( AlarmManager.RTC_WAKEUP, firstFireTime, pi ); setJobTimerIf( context, delayMS, timerID ); diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/UpdateCheckReceiver.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/UpdateCheckReceiver.java index 16cfb4f6e..1ec40039e 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/UpdateCheckReceiver.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/UpdateCheckReceiver.java @@ -98,7 +98,7 @@ public class UpdateCheckReceiver extends BroadcastReceiver { Intent intent = new Intent( context, UpdateCheckReceiver.class ); PendingIntent pi = PendingIntent.getBroadcast( context, 0, intent, - BuildConfig.FLAG_IMMUTABLE ); + PendingIntent.FLAG_IMMUTABLE ); am.cancel( pi ); long interval_millis; diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/Utils.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/Utils.java index 25174a9e1..700643708 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/Utils.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/Utils.java @@ -379,7 +379,7 @@ public class Utils { { PendingIntent pi = PendingIntent .getActivity( context, Utils.nextRandomInt(), intent, - PendingIntent.FLAG_ONE_SHOT | BuildConfig.FLAG_IMMUTABLE ); + PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE ); return pi; }