mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-20 22:26:54 +01:00
remove separate marking of permissions as banned
It's enough to check manifest for their presence
This commit is contained in:
parent
e2b7aceea7
commit
603daa447f
2 changed files with 5 additions and 15 deletions
|
@ -85,7 +85,6 @@ android {
|
|||
buildConfigField "boolean", "RELAYINVITE_SUPPORTED", "false"
|
||||
buildConfigField "String", "VARIANT_NAME", "\"Google Play Store\""
|
||||
buildConfigField "int", "VARIANT_CODE", "1"
|
||||
buildConfigField "boolean", "SMS_BANNED", "true"
|
||||
}
|
||||
|
||||
xw4fdroid {
|
||||
|
@ -98,7 +97,6 @@ android {
|
|||
buildConfigField "boolean", "RELAYINVITE_SUPPORTED", "false"
|
||||
buildConfigField "String", "VARIANT_NAME", "\"F-Droid\""
|
||||
buildConfigField "int", "VARIANT_CODE", "2"
|
||||
buildConfigField "boolean", "SMS_BANNED", "false"
|
||||
}
|
||||
xw4d {
|
||||
dimension "variant"
|
||||
|
@ -111,7 +109,6 @@ android {
|
|||
buildConfigField "String", "VARIANT_NAME", "\"Dev/Debug\""
|
||||
buildConfigField "int", "VARIANT_CODE", "3"
|
||||
buildConfigField "boolean", "REPORT_LOCKS", "true"
|
||||
buildConfigField "boolean", "SMS_BANNED", "false"
|
||||
}
|
||||
|
||||
xw4dNoSMS {
|
||||
|
@ -124,7 +121,6 @@ android {
|
|||
buildConfigField "boolean", "RELAYINVITE_SUPPORTED", "true"
|
||||
buildConfigField "String", "VARIANT_NAME", "\"Dev/Debug NoSMS\""
|
||||
buildConfigField "int", "VARIANT_CODE", "4"
|
||||
buildConfigField "boolean", "SMS_BANNED", "true"
|
||||
buildConfigField "boolean", "REPORT_LOCKS", "true"
|
||||
}
|
||||
|
||||
|
@ -138,7 +134,6 @@ android {
|
|||
buildConfigField "boolean", "RELAYINVITE_SUPPORTED", "false"
|
||||
buildConfigField "String", "VARIANT_NAME", "\"FOSS\""
|
||||
buildConfigField "int", "VARIANT_CODE", "5"
|
||||
buildConfigField "boolean", "SMS_BANNED", "false"
|
||||
}
|
||||
|
||||
// WARNING: "all" breaks things. Seems to be a keyword. Need
|
||||
|
|
|
@ -52,17 +52,12 @@ public class Perms23 {
|
|||
public static enum Perm {
|
||||
READ_PHONE_STATE(Manifest.permission.READ_PHONE_STATE),
|
||||
STORAGE(Manifest.permission.WRITE_EXTERNAL_STORAGE),
|
||||
SEND_SMS(Manifest.permission.SEND_SMS, BuildConfig.SMS_BANNED),
|
||||
RECEIVE_SMS(Manifest.permission.RECEIVE_SMS, BuildConfig.SMS_BANNED),
|
||||
SEND_SMS(Manifest.permission.SEND_SMS),
|
||||
RECEIVE_SMS(Manifest.permission.RECEIVE_SMS),
|
||||
READ_CONTACTS(Manifest.permission.READ_CONTACTS);
|
||||
|
||||
private String m_str;
|
||||
private boolean m_banned;
|
||||
private Perm(String str) { this(str, false); }
|
||||
private Perm( String str, boolean banned ) {
|
||||
m_str = str;
|
||||
m_banned = banned;
|
||||
}
|
||||
private Perm(String str) { m_str = str; }
|
||||
|
||||
public String getString() { return m_str; }
|
||||
public boolean isBanned( Context context )
|
||||
|
@ -71,8 +66,8 @@ public class Perms23 {
|
|||
// SMS_BANNED. That way absence of the permission from a variant's
|
||||
// manifest is the only way being banned is expressed. It sucks
|
||||
// keeping two things in sync.
|
||||
Assert.assertFalse( m_banned == permInManifest( context, this ) );
|
||||
return m_banned;
|
||||
// Assert.assertFalse( m_banned == permInManifest( context, this ) );
|
||||
return !permInManifest( context, this );
|
||||
}
|
||||
public static Perm getFor( String str ) {
|
||||
Perm result = null;
|
||||
|
|
Loading…
Reference in a new issue