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

Commit 37e1d8c9 authored by Michael Webster's avatar Michael Webster Committed by Steve Kondik
Browse files

Allow the user to specify which application to launch using the lockscreen messaging slider.

Change-Id: I56869f893573ff5b040b6343f531ee555c512c79

Allow the user to specify which application to launch using the lockscreen messaging slider.

Change-Id: Iceeec37c2cdcbb6795c98b8d745e28a1a8b8898e
parent 4a6b6129
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2082,6 +2082,12 @@ public final class Settings {
         */
        public static final String LOCKSCREEN_PHONE_MESSAGING_TAB = "lockscreen_phone_messaging_tab";

        /**
         * App to launch with the custom messaging tab
         * @hide
         */
        public static final String LOCKSCREEN_MESSAGING_TAB_APP = "lockscreen_messaging_tab_app";

        /**
         * Pulse the Trackball with Screen On.  The value is boolean (1 or 0).
         * @hide
+16 −5
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import com.android.internal.widget.LockPatternUtils;
import com.android.internal.widget.SlidingTab;
import com.android.internal.widget.SlidingTab.OnTriggerListener;

import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
@@ -42,6 +43,7 @@ import android.provider.Settings;

import java.util.Date;
import java.io.File;
import java.net.URISyntaxException;

/**
 * The screen within {@link LockPatternKeyguardView} that shows general
@@ -120,6 +122,9 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
    private boolean mLockPhoneMessagingTab = (Settings.System.getInt(mContext.getContentResolver(),
            Settings.System.LOCKSCREEN_PHONE_MESSAGING_TAB, 0) == 1);

    private String mMessagingTabApp = (Settings.System.getString(mContext.getContentResolver(),
            Settings.System.LOCKSCREEN_MESSAGING_TAB_APP));

    /**
     * The status of this lock screen.
     */
@@ -350,11 +355,17 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
                        getContext().startActivity(callIntent);
                        mCallback.goToUnlockScreen();
                    } else if (whichHandle == SlidingTab.OnTriggerListener.RIGHT_HANDLE) {
                        Intent sendIntent = new Intent(Intent.ACTION_MAIN);
                        sendIntent.setType("vnd.android-dir/mms-sms");
                        sendIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                        getContext().startActivity(sendIntent);
                        if (mMessagingTabApp != null) {
                            try {
                                Intent i = Intent.parseUri(mMessagingTabApp, 0);
                                i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
                                        | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
                                mContext.startActivity(i);
                                mCallback.goToUnlockScreen();
                            } catch (URISyntaxException e) {
                            } catch (ActivityNotFoundException e) {
                            }
                        }
                    }
                }