mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-08 05:24:39 +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 );
|
R.string.invite_sms_fmt );
|
||||||
if ( null != message ) {
|
if ( null != message ) {
|
||||||
boolean succeeded = false;
|
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:
|
outer:
|
||||||
for ( int ii = 0; !succeeded; ++ii ) {
|
for ( int ii = 0; !succeeded; ++ii ) {
|
||||||
Intent intent;
|
Intent intent;
|
||||||
switch ( ii ) {
|
switch ( ii ) {
|
||||||
case 0:
|
case 0: // test case: QKSMS
|
||||||
String defaultSmsPkg = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT
|
|
||||||
? Telephony.Sms.getDefaultSmsPackage(activity)
|
|
||||||
: Settings.Secure.getString(activity.getContentResolver(),
|
|
||||||
"sms_default_application");
|
|
||||||
intent = new Intent( Intent.ACTION_SEND )
|
intent = new Intent( Intent.ACTION_SEND )
|
||||||
.setPackage( defaultSmsPkg )
|
.setPackage( defaultSmsPkg )
|
||||||
.setType( "text/plain" )
|
.setType( "text/plain" )
|
||||||
|
@ -760,7 +762,14 @@ public class GameUtils {
|
||||||
.setData(Uri.parse("smsto:" + phone))
|
.setData(Uri.parse("smsto:" + phone))
|
||||||
;
|
;
|
||||||
break;
|
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 )
|
intent = new Intent( Intent.ACTION_VIEW )
|
||||||
.setData( Uri.parse("sms:" + phone) )
|
.setData( Uri.parse("sms:" + phone) )
|
||||||
.putExtra( "sms_body", message )
|
.putExtra( "sms_body", message )
|
||||||
|
@ -1350,8 +1359,8 @@ public class GameUtils {
|
||||||
if ( null != gamePtr ) {
|
if ( null != gamePtr ) {
|
||||||
int nSent = XwJNI.comms_resendAll( gamePtr, true,
|
int nSent = XwJNI.comms_resendAll( gamePtr, true,
|
||||||
m_filter, false );
|
m_filter, false );
|
||||||
Log.d( TAG, "Resender.doInBackground(): sent %d "
|
// Log.d( TAG, "Resender.doInBackground(): sent %d "
|
||||||
+ "messages for rowid %d", nSent, rowid );
|
// + "messages for rowid %d", nSent, rowid );
|
||||||
nSentTotal += sink.numSent();
|
nSentTotal += sink.numSent();
|
||||||
} else {
|
} else {
|
||||||
Log.d( TAG, "Resender.doInBackground(): loadMakeGame()"
|
Log.d( TAG, "Resender.doInBackground(): loadMakeGame()"
|
||||||
|
|
Loading…
Reference in a new issue