Android Q compatibility

pull/156/head
M66B 5 years ago
parent effd64955f
commit 382f57d6ca

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

@ -1898,8 +1898,11 @@ class Core {
} }
if (notify_reply && message.content) { if (notify_reply && message.content) {
Intent reply = new Intent(context, ServiceUI.class).setAction("reply:" + message.id); Intent reply = new Intent(context, ActivityCompose.class)
PendingIntent piReply = PendingIntent.getService(context, ServiceUI.PI_REPLY, reply, PendingIntent.FLAG_UPDATE_CURRENT); .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( NotificationCompat.Action.Builder actionReply = new NotificationCompat.Action.Builder(
R.drawable.baseline_reply_24, R.drawable.baseline_reply_24,
context.getString(R.string.title_advanced_notify_action_reply), context.getString(R.string.title_advanced_notify_action_reply),

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

@ -32,11 +32,10 @@ public class ServiceUI extends IntentService {
static final int PI_CLEAR = 1; static final int PI_CLEAR = 1;
static final int PI_TRASH = 2; static final int PI_TRASH = 2;
static final int PI_ARCHIVE = 3; static final int PI_ARCHIVE = 3;
static final int PI_REPLY = 4; static final int PI_FLAG = 4;
static final int PI_FLAG = 6; static final int PI_SEEN = 5;
static final int PI_SEEN = 6; static final int PI_IGNORED = 6;
static final int PI_IGNORED = 7; static final int PI_SNOOZED = 7;
static final int PI_SNOOZED = 8;
public ServiceUI() { public ServiceUI() {
this(ServiceUI.class.getName()); this(ServiceUI.class.getName());
@ -85,9 +84,6 @@ public class ServiceUI extends IntentService {
case "archive": case "archive":
onArchive(id); onArchive(id);
break; break;
case "reply":
onReply(id);
break;
case "flag": case "flag":
onFlag(id); onFlag(id);
break; 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) { private void onFlag(long id) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
boolean threading = prefs.getBoolean("threading", true); boolean threading = prefs.getBoolean("threading", true);

Loading…
Cancel
Save