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

Commit 1af21b8c authored by Danesh Mondegarian's avatar Danesh Mondegarian Committed by Gerrit Code Review
Browse files

LockscreenShortcuts : Fix minor bugs

Fixes :

      - Inability to have contacts/direct dials..etc on lockscreen (http://goo.gl/BKEJs)
      - Multiple activities of same type on stack.

Change-Id: I6c2c3e1c87239267601d78eb38778d0388f4a41c
parent 6ef004e0
Loading
Loading
Loading
Loading
+8 −17
Original line number Diff line number Diff line
@@ -422,12 +422,12 @@ class LockScreen extends LinearLayout implements KeyguardScreen {
                                    }
                                }
                                TargetDrawable nDrawable = new TargetDrawable(res, getLayeredDrawable(back,front, tmpInset, frontBlank));
                                boolean isCamera = in.getComponent().getClassName().equals("com.android.camera.CameraLauncher");
                                if (isCamera) {
                                ComponentName compName = in.getComponent();
                                if (compName != null) {
                                    String cls = compName.getClassName();
                                    if (cls.equals("com.android.camera.CameraLauncher")) {
                                        nDrawable.setEnabled(!mCameraDisabled);
                                } else {
                                    boolean isSearch = in.getComponent().getClassName().equals("SearchActivity");
                                    if (isSearch) {
                                    } else if (cls.equals("SearchActivity")) {
                                        nDrawable.setEnabled(!mSearchDisabled);
                                    }
                                }
@@ -491,13 +491,8 @@ class LockScreen extends LinearLayout implements KeyguardScreen {
                    target -= 1 + mTargetOffset;
                    if (target < mStoredTargets.length && mStoredTargets[target] != null) {
                        try {
                            Intent tIntent = Intent.parseUri(mStoredTargets[target], 0);
                            tIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                            mContext.startActivity(tIntent);
                            mCallback.goToUnlockScreen();
                            return;
                            launchActivity(Intent.parseUri(mStoredTargets[target], 0));
                        } catch (URISyntaxException e) {
                        } catch (ActivityNotFoundException e) {
                        }
                    }
                }
@@ -509,13 +504,9 @@ class LockScreen extends LinearLayout implements KeyguardScreen {
                    Intent.FLAG_ACTIVITY_NEW_TASK
                    | Intent.FLAG_ACTIVITY_SINGLE_TOP
                    | Intent.FLAG_ACTIVITY_CLEAR_TOP);
            try {
                ActivityManagerNative.getDefault().dismissKeyguardOnNextActivity();
            } catch (RemoteException e) {
                Log.w(TAG, "can't dismiss keyguard on launch");
            }
            try {
                mContext.startActivity(intent);
                mCallback.goToUnlockScreen();
            } catch (ActivityNotFoundException e) {
                Log.w(TAG, "Activity not found for intent + " + intent.getAction());
            }