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

Commit c49da051 authored by Jim Miller's avatar Jim Miller Committed by Android (Google) Code Review
Browse files

Merge "Fix 5907237: dismiss keyguard after the camera app launches."

parents 3ad77466 3868cee0
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();