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

Commit 902f9888 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Keyguard: Enhancement for missed call lockscreen target"

parents de8b1740 3b69250d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@
    <uses-permission android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE" />
    <uses-permission android:name="android.permission.MEDIA_CONTENT_CONTROL" />
    <uses-permission android:name="android.permission.ACCESS_KEYGUARD_SECURE_STORAGE" />
    <uses-permission android:name="android.permission.READ_CALL_LOG" />

    <application android:label="@string/app_name"
        android:process="com.android.systemui"
+13 −1
Original line number Diff line number Diff line
@@ -33,6 +33,8 @@ import android.os.Handler;
import android.os.RemoteException;
import android.os.SystemClock;
import android.os.UserHandle;
import android.provider.CallLog;
import android.provider.CallLog.Calls;
import android.provider.MediaStore;
import android.util.Log;
import android.view.WindowManager;
@@ -51,6 +53,7 @@ public abstract class KeyguardActivityLauncher {
    private static final Intent INSECURE_CAMERA_INTENT =
            new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA);
    private static final Intent CALL_INTENT = new Intent(Intent.ACTION_DIAL);
    private static final Intent CALL_LOG_LIST_INTENT = new Intent(Intent.ACTION_VIEW);
    private static final Intent SMS_INTENT = new Intent(Intent.ACTION_MAIN);

    abstract Context getContext();
@@ -124,8 +127,17 @@ public abstract class KeyguardActivityLauncher {
    }

    public void launchCall() {
        KeyguardUpdateMonitor monitor = KeyguardUpdateMonitor.getInstance(getContext());
        final int missedCount = monitor.getUnreadCallCount();
        if (missedCount > 0) {
            // Go to call log list
            CALL_LOG_LIST_INTENT.setType(CallLog.Calls.CONTENT_TYPE);
            launchActivity(CALL_LOG_LIST_INTENT, false, false, null, null);
        } else {
            // Go to dialer by default
            launchActivity(CALL_INTENT, false, false, null, null);
        }
    }

    public void launchMessage() {
        SMS_INTENT.setType("vnd.android-dir/mms-sms");
+7 −0
Original line number Diff line number Diff line
@@ -161,6 +161,13 @@ public class KeyguardUpdateMonitor {
    private ComponentName []mComponentName;
    private boolean mShowLockscreenCustomTargets;

    public int getUnreadCallCount() {
        if (mShowLockscreenCustomTargets) {
            return mUnreadNum[DIALER_UNREAD];
        }
        return -1;
    }

    private final Handler mHandler = new Handler() {
        @Override
        public void handleMessage(Message msg) {