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

Commit 3868cee0 authored by Jim Miller's avatar Jim Miller
Browse files

Fix 5907237: dismiss keyguard after the camera app launches.

This fixes a bug where either the home screen or the last app run shows
briefly while we wait for the camera app to launch.  Instead, we have
ActivityManager dismiss keyguard once the camera app is up and running.

Change-Id: I1c2986ad84024dce675216a76c19c937c3e2828d
parent 2ca25cd6
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -23,6 +23,8 @@ import com.android.internal.widget.WaveView;
import com.android.internal.widget.multiwaveview.MultiWaveView;

import android.app.ActivityManager;
import android.app.ActivityManagerNative;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
@@ -34,6 +36,7 @@ import android.view.ViewGroup;
import android.widget.*;
import android.util.Log;
import android.media.AudioManager;
import android.os.RemoteException;
import android.provider.MediaStore;
import android.provider.Settings;

@@ -229,8 +232,16 @@ class LockScreen extends LinearLayout implements KeyguardScreen {
                    // Start the Camera
                    Intent intent = new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA);
                    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                    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, "Camera application not found");
                    }
                } else {
                    toggleRingMode();
                    mUnlockWidgetMethods.updateResources();