Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d0361407 authored by Nancy Chen's avatar Nancy Chen
Browse files

Fix runtime error when clicking "call back" from secondary user.

Switch startActivity to startActivityAsUser for calling back
from missed call notification. Also add user for missed call dismissing
and starting the dialer recents tab.

Bug: 21500617
Change-Id: I162c0b2b34539a32facc3cd8f9c44348aefbd5f0
parent 0f39c557
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ public final class TelecomBroadcastIntentProcessor {

            Intent callIntent = new Intent(Intent.ACTION_SENDTO, intent.getData());
            callIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            mContext.startActivity(callIntent);
            mContext.startActivityAsUser(callIntent, UserHandle.CURRENT);

        // Call back recent caller from the missed call notification.
        } else if (ACTION_CALL_BACK_FROM_NOTIFICATION.equals(action)) {
@@ -67,7 +67,7 @@ public final class TelecomBroadcastIntentProcessor {
            Intent callIntent = new Intent(Intent.ACTION_CALL_PRIVILEGED, intent.getData());
            callIntent.setFlags(
                    Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
            mContext.startActivity(callIntent);
            mContext.startActivityAsUser(callIntent, UserHandle.CURRENT);

        // Clear the missed call notification and call log entries.
        } else if (ACTION_CLEAR_MISSED_CALLS.equals(action)) {
+3 −2
Original line number Diff line number Diff line
@@ -220,7 +220,8 @@ public class MissedCallNotifierImpl extends CallsManagerListenerBase implements
        mMissedCallCount = 0;
        long token = Binder.clearCallingIdentity();
        try {
            mNotificationManager.cancel(MISSED_CALL_NOTIFICATION_ID);
            mNotificationManager.cancelAsUser(null, MISSED_CALL_NOTIFICATION_ID,
                    UserHandle.CURRENT);
        } finally {
            Binder.restoreCallingIdentity(token);
        }
@@ -259,7 +260,7 @@ public class MissedCallNotifierImpl extends CallsManagerListenerBase implements
        TaskStackBuilder taskStackBuilder = TaskStackBuilder.create(mContext);
        taskStackBuilder.addNextIntent(intent);

        return taskStackBuilder.getPendingIntent(0, 0);
        return taskStackBuilder.getPendingIntent(0, 0, null, UserHandle.CURRENT);
    }

    /**