mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-07 05:24:46 +01:00
add a case for Signal as default SMS app
This commit is contained in:
parent
a093dae712
commit
6bc65476d0
1 changed files with 17 additions and 8 deletions
|
@ -741,15 +741,17 @@ public class GameUtils {
|
|||
R.string.invite_sms_fmt );
|
||||
if ( null != message ) {
|
||||
boolean succeeded = false;
|
||||
String defaultSmsPkg = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT
|
||||
? Telephony.Sms.getDefaultSmsPackage(activity)
|
||||
: Settings.Secure.getString(activity.getContentResolver(),
|
||||
"sms_default_application");
|
||||
Log.d( TAG, "launchSMSInviteActivity(): default app: %s", defaultSmsPkg );
|
||||
|
||||
outer:
|
||||
for ( int ii = 0; !succeeded; ++ii ) {
|
||||
Intent intent;
|
||||
switch ( ii ) {
|
||||
case 0:
|
||||
String defaultSmsPkg = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT
|
||||
? Telephony.Sms.getDefaultSmsPackage(activity)
|
||||
: Settings.Secure.getString(activity.getContentResolver(),
|
||||
"sms_default_application");
|
||||
case 0: // test case: QKSMS
|
||||
intent = new Intent( Intent.ACTION_SEND )
|
||||
.setPackage( defaultSmsPkg )
|
||||
.setType( "text/plain" )
|
||||
|
@ -760,7 +762,14 @@ public class GameUtils {
|
|||
.setData(Uri.parse("smsto:" + phone))
|
||||
;
|
||||
break;
|
||||
case 1:
|
||||
case 1: // test case: Signal
|
||||
intent = new Intent( Intent.ACTION_SENDTO,
|
||||
Uri.parse("smsto:" + phone) )
|
||||
.putExtra("sms_body", message)
|
||||
.setPackage( defaultSmsPkg )
|
||||
;
|
||||
break;
|
||||
case 2:
|
||||
intent = new Intent( Intent.ACTION_VIEW )
|
||||
.setData( Uri.parse("sms:" + phone) )
|
||||
.putExtra( "sms_body", message )
|
||||
|
@ -1350,8 +1359,8 @@ public class GameUtils {
|
|||
if ( null != gamePtr ) {
|
||||
int nSent = XwJNI.comms_resendAll( gamePtr, true,
|
||||
m_filter, false );
|
||||
Log.d( TAG, "Resender.doInBackground(): sent %d "
|
||||
+ "messages for rowid %d", nSent, rowid );
|
||||
// Log.d( TAG, "Resender.doInBackground(): sent %d "
|
||||
// + "messages for rowid %d", nSent, rowid );
|
||||
nSentTotal += sink.numSent();
|
||||
} else {
|
||||
Log.d( TAG, "Resender.doInBackground(): loadMakeGame()"
|
||||
|
|
Loading…
Reference in a new issue