Finish KitKat compatibility details.
1) The system does actually enforce having a BROADCAST_SMS permission on the SMS receiver. Break out the "delivered" parts of this into a separate Receiver, so the permission won't trip up GB devices. 2) The system does actually enforce having "quick response" intents. Add a no-op for now. 3) Add a "make default" prompt. 4) Update settings to reflect what's going on in KitKat.pull/1/head
parent
e81756f443
commit
b0216e1494
@ -0,0 +1,31 @@
|
|||||||
|
package org.thoughtcrime.securesms.service;
|
||||||
|
|
||||||
|
import android.app.Service;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.IBinder;
|
||||||
|
import android.telephony.TelephonyManager;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import org.thoughtcrime.securesms.R;
|
||||||
|
|
||||||
|
public class QuickResponseService extends Service {
|
||||||
|
|
||||||
|
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||||
|
if (!TelephonyManager.ACTION_RESPOND_VIA_MESSAGE.equals(intent.getAction())) {
|
||||||
|
Log.w("QuickResponseService", "Received unknown intent: " + intent.getAction());
|
||||||
|
return START_NOT_STICKY;
|
||||||
|
}
|
||||||
|
|
||||||
|
Toast.makeText(this,
|
||||||
|
getString(R.string.QuickResponseService_sorry_quick_response_is_not_yet_supported_by_textsecure),
|
||||||
|
Toast.LENGTH_LONG).show();
|
||||||
|
|
||||||
|
return START_NOT_STICKY;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IBinder onBind(Intent intent) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package org.thoughtcrime.securesms.service;
|
||||||
|
|
||||||
|
import android.content.BroadcastReceiver;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
|
||||||
|
public class SmsDeliveryListener extends BroadcastReceiver {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onReceive(Context context, Intent intent) {
|
||||||
|
if (SendReceiveService.SENT_SMS_ACTION.equals(intent.getAction())) {
|
||||||
|
intent.putExtra("ResultCode", this.getResultCode());
|
||||||
|
intent.setClass(context, SendReceiveService.class);
|
||||||
|
context.startService(intent);
|
||||||
|
} else if (SendReceiveService.DELIVERED_SMS_ACTION.equals(intent.getAction())) {
|
||||||
|
intent.putExtra("ResultCode", this.getResultCode());
|
||||||
|
intent.setClass(context, SendReceiveService.class);
|
||||||
|
context.startService(intent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue