ask for SMS_RECEIVE on startup if have SMS_SEND

It's free (same group) but required on SDK_26 for invitations to work.
This commit is contained in:
Eric House 2018-12-14 19:33:03 -08:00
parent f7ef1adcb5
commit e15fb84005
2 changed files with 12 additions and 1 deletions

View file

@ -987,6 +987,16 @@ public class GamesListDelegate extends ListDelegateBase
} ); } );
updateField(); updateField();
// RECEIVE_SMS is required now (Oreo/SDK_26) but wasn't
// before. There's logic elsewhere to ask for it AND SEND_SMS, but if
// the user's already granted SEND_SMS we can get RECEIVE_SMS just by
// asking (OS will grant without user interaction) since they're in
// the same group. So just do it now. This code can be removed
// later...
if ( Perms23.havePermission( Perm.SEND_SMS ) ) {
Perms23.tryGetPerms( this, Perm.RECEIVE_SMS, 0, Action.SKIP_CALLBACK );
}
} // init } // init
@Override @Override

View file

@ -237,7 +237,8 @@ public class Perms23 {
{ {
// Log.d( TAG, "tryGetPerms(%s)", perm.toString() ); // Log.d( TAG, "tryGetPerms(%s)", perm.toString() );
Context context = XWApp.getContext(); Context context = XWApp.getContext();
String msg = LocUtils.getString( context, rationaleId ); String msg = rationaleId == 0
? null : LocUtils.getString( context, rationaleId );
tryGetPerms( delegate, perm, msg, action, params ); tryGetPerms( delegate, perm, msg, action, params );
} }