Android Q compatibility

This commit is contained in:
M66B 2019-05-08 13:15:02 +02:00
parent effd64955f
commit 382f57d6ca
4 changed files with 13 additions and 21 deletions

View File

@ -48,6 +48,8 @@ public class ActivityCompose extends ActivityBilling implements FragmentManager.
static final int REQUEST_ATTACHMENT = 5;
static final int REQUEST_ENCRYPT = 6;
static final int PI_REPLY = 1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

View File

@ -1898,8 +1898,11 @@ class Core {
}
if (notify_reply && message.content) {
Intent reply = new Intent(context, ServiceUI.class).setAction("reply:" + message.id);
PendingIntent piReply = PendingIntent.getService(context, ServiceUI.PI_REPLY, reply, PendingIntent.FLAG_UPDATE_CURRENT);
Intent reply = new Intent(context, ActivityCompose.class)
.putExtra("action", args.getString("action"))
.putExtra("reference", message.id);
reply.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent piReply = PendingIntent.getActivity(context, ActivityCompose.PI_REPLY, reply, PendingIntent.FLAG_UPDATE_CURRENT);
NotificationCompat.Action.Builder actionReply = new NotificationCompat.Action.Builder(
R.drawable.baseline_reply_24,
context.getString(R.string.title_advanced_notify_action_reply),

View File

@ -2074,6 +2074,8 @@ public class FragmentCompose extends FragmentBase {
draft.plain_only = ref.plain_only;
if (answer > 0)
body = EntityAnswer.getAnswerText(db, answer, draft.to) + body;
EntityOperation.queue(context, db, ref, EntityOperation.SEEN, true);
}
// Select identity matching from address

View File

@ -32,11 +32,10 @@ public class ServiceUI extends IntentService {
static final int PI_CLEAR = 1;
static final int PI_TRASH = 2;
static final int PI_ARCHIVE = 3;
static final int PI_REPLY = 4;
static final int PI_FLAG = 6;
static final int PI_SEEN = 6;
static final int PI_IGNORED = 7;
static final int PI_SNOOZED = 8;
static final int PI_FLAG = 4;
static final int PI_SEEN = 5;
static final int PI_IGNORED = 6;
static final int PI_SNOOZED = 7;
public ServiceUI() {
this(ServiceUI.class.getName());
@ -85,9 +84,6 @@ public class ServiceUI extends IntentService {
case "archive":
onArchive(id);
break;
case "reply":
onReply(id);
break;
case "flag":
onFlag(id);
break;
@ -151,17 +147,6 @@ public class ServiceUI extends IntentService {
}
}
private void onReply(long id) {
onSeen(id);
// No check for attachments
Intent reply = new Intent(this, ActivityCompose.class)
.putExtra("action", "reply")
.putExtra("reference", id);
reply.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(reply);
}
private void onFlag(long id) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
boolean threading = prefs.getBoolean("threading", true);