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

Commit be2d9d99 authored by Bill Lin's avatar Bill Lin Committed by Automerger Merge Worker
Browse files

Merge "Disable 3-Button NavBar Recents key when launch secure camera" into udc-dev am: d41919d2

parents cbd8850d d41919d2
Loading
Loading
Loading
Loading
+23 −2
Original line number Diff line number Diff line
@@ -1501,13 +1501,17 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
            notifyFinishedGoingToSleep();

            if (cameraGestureTriggered) {

                // Just to make sure, make sure the device is awake.
                mContext.getSystemService(PowerManager.class).wakeUp(SystemClock.uptimeMillis(),
                        PowerManager.WAKE_REASON_CAMERA_LAUNCH,
                        "com.android.systemui:CAMERA_GESTURE_PREVENT_LOCK");
                setPendingLock(false);
                mPendingReset = false;
                mPowerGestureIntercepted = true;
                if (DEBUG) {
                    Log.d(TAG, "cameraGestureTriggered=" + cameraGestureTriggered
                            + ",mPowerGestureIntercepted=" + mPowerGestureIntercepted);
                }
            }

            if (mPendingReset) {
@@ -1706,7 +1710,13 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
            mAnimatingScreenOff = false;
            cancelDoKeyguardLaterLocked();
            cancelDoKeyguardForChildProfilesLocked();
            if (DEBUG) Log.d(TAG, "onStartedWakingUp, seq = " + mDelayedShowingSequence);
            if (cameraGestureTriggered) {
                mPowerGestureIntercepted = true;
            }
            if (DEBUG) {
                Log.d(TAG, "onStartedWakingUp, seq = " + mDelayedShowingSequence
                        + ", mPowerGestureIntercepted = " + mPowerGestureIntercepted);
            }
            notifyStartedWakingUp();
        }
        mUiEventLogger.logWithInstanceIdAndPosition(
@@ -1933,12 +1943,19 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
                startKeyguardExitAnimation(0, 0);
            }

            mPowerGestureIntercepted = mUpdateMonitor.isSecureCameraLaunchedOverKeyguard();

            if (mOccluded != isOccluded) {
                mOccluded = isOccluded;
                mKeyguardViewControllerLazy.get().setOccluded(isOccluded, animate
                        && mDeviceInteractive);
                adjustStatusBarLocked();
            }

            if (DEBUG) {
                Log.d(TAG, "isOccluded=" + isOccluded + ",mPowerGestureIntercepted="
                        + mPowerGestureIntercepted);
            }
        }
        Trace.endSection();
    }
@@ -3056,6 +3073,10 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
                flags |= StatusBarManager.DISABLE_RECENT;
            }

            if (mPowerGestureIntercepted) {
                flags |= StatusBarManager.DISABLE_RECENT;
            }

            if (DEBUG) {
                Log.d(TAG, "adjustStatusBarLocked: mShowing=" + mShowing + " mOccluded=" + mOccluded
                        + " isSecure=" + isSecure() + " force=" + forceHideHomeRecentsButtons
+12 −1
Original line number Diff line number Diff line
@@ -34,6 +34,8 @@ import android.os.SystemProperties;
import android.os.UpdateEngine;
import android.os.UpdateEngineCallback;
import android.provider.DeviceConfig;
import android.provider.Settings;
import android.provider.Settings.SettingNotFoundException;
import android.util.Log;

import com.android.internal.R;
@@ -332,8 +334,17 @@ public final class ProfcollectForwardingService extends SystemService {
        Context context = getContext();
        BackgroundThread.get().getThreadHandler().post(() -> {
            try {
                int usageSetting = -1;
                try {
                    // Get "Usage & diagnostics" checkbox status. 1 is for enabled, 0 is for
                    // disabled.
                    usageSetting = Settings.Global.getInt(context.getContentResolver(), "multi_cb");
                } catch (SettingNotFoundException e) {
                    Log.i(LOG_TAG, "Usage setting not found: " + e.getMessage());
                }

                // Prepare profile report
                String reportName = mIProfcollect.report() + ".zip";
                String reportName = mIProfcollect.report(usageSetting) + ".zip";

                if (!context.getResources().getBoolean(
                        R.bool.config_profcollectReportUploaderEnabled)) {
+7 −3
Original line number Diff line number Diff line
@@ -2539,10 +2539,14 @@ public class UsageStatsService extends SystemService implements
        }

        @Override
        public void reportChooserSelection(String packageName, int userId, String contentType,
                                           String[] annotations, String action) {
        public void reportChooserSelection(@NonNull String packageName, int userId,
                String contentType, String[] annotations, String action) {
            if (packageName == null) {
                Slog.w(TAG, "Event report user selecting a null package");
                throw new IllegalArgumentException("Package selection must not be null.");
            }
            // Verify if this package exists before reporting an event for it.
            if (mPackageManagerInternal.getPackageUid(packageName, 0, userId) < 0) {
                Slog.w(TAG, "Event report user selecting an invalid package");
                return;
            }