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

Commit 88086cbe authored by /e/ robot's avatar /e/ robot
Browse files

Merge remote-tracking branch 'origin/lineage-20.0' into v1-t

parents fe96483e f1b360b8
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -1173,7 +1173,6 @@ public class DreamService extends Service implements Window.Callback {
        if (!flattenedString.contains("/")) {
            return new ComponentName(serviceInfo.packageName, flattenedString);
        }

        // Ensure that the component is from the same package as the dream service. If not,
        // treat the component as invalid and return null instead.
        final ComponentName cn = ComponentName.unflattenFromString(flattenedString);
+10 −3
Original line number Diff line number Diff line
@@ -78,6 +78,7 @@ import com.android.systemui.plugins.ActivityStarter;
import com.android.systemui.plugins.FalsingManager;
import com.android.systemui.shared.system.SysUiStatsLog;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.statusbar.policy.UserSwitcherController;
import com.android.systemui.util.ViewController;
@@ -364,6 +365,7 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
                    showPrimarySecurityScreen(false);
                }
            };
    private final DeviceProvisionedController mDeviceProvisionedController;

    @Inject
    public KeyguardSecurityContainerController(KeyguardSecurityContainer view,
@@ -386,7 +388,8 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
            FalsingA11yDelegate falsingA11yDelegate,
            TelephonyManager telephonyManager,
            ViewMediatorCallback viewMediatorCallback,
            AudioManager audioManager
            AudioManager audioManager,
            DeviceProvisionedController deviceProvisionedController
    ) {
        super(view);
        mLockPatternUtils = lockPatternUtils;
@@ -411,6 +414,7 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
        mTelephonyManager = telephonyManager;
        mViewMediatorCallback = viewMediatorCallback;
        mAudioManager = audioManager;
        mDeviceProvisionedController = deviceProvisionedController;
    }

    @Override
@@ -752,8 +756,11 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
                case SimPuk:
                    // Shortcut for SIM PIN/PUK to go to directly to user's security screen or home
                    SecurityMode securityMode = mSecurityModel.getSecurityMode(targetUserId);
                    if (securityMode == SecurityMode.None && mLockPatternUtils.isLockScreenDisabled(
                            KeyguardUpdateMonitor.getCurrentUser())) {
                    boolean isLockscreenDisabled = mLockPatternUtils.isLockScreenDisabled(
                            KeyguardUpdateMonitor.getCurrentUser())
                            || !mDeviceProvisionedController.isUserSetup(targetUserId);

                    if (securityMode == SecurityMode.None && isLockscreenDisabled) {
                        finish = true;
                        eventSubtype = BOUNCER_DISMISS_SIM;
                        uiEvent = BouncerUiEvent.BOUNCER_DISMISS_SIM;
+28 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ import com.android.systemui.util.time.SystemClock;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;

import javax.inject.Inject;
@@ -144,6 +145,10 @@ public class AppOpsControllerImpl extends BroadcastReceiver implements AppOpsCon
    protected void setListening(boolean listening) {
        mListening = listening;
        if (listening) {
            // System UI could be restarted while ops are active, so fetch the currently active ops
            // once System UI starts listening again.
            fetchCurrentActiveOps();

            mAppOps.startWatchingActive(OPS, this);
            mAppOps.startWatchingNoted(OPS, this);
            mAudioManager.registerAudioRecordingCallback(mAudioRecordingCallback, mBGHandler);
@@ -176,6 +181,29 @@ public class AppOpsControllerImpl extends BroadcastReceiver implements AppOpsCon
        }
    }

    private void fetchCurrentActiveOps() {
        List<AppOpsManager.PackageOps> packageOps = mAppOps.getPackagesForOps(OPS);
        for (AppOpsManager.PackageOps op : packageOps) {
            for (AppOpsManager.OpEntry entry : op.getOps()) {
                for (Map.Entry<String, AppOpsManager.AttributedOpEntry> attributedOpEntry :
                        entry.getAttributedOpEntries().entrySet()) {
                    if (attributedOpEntry.getValue().isRunning()) {
                        onOpActiveChanged(
                                entry.getOpStr(),
                                op.getUid(),
                                op.getPackageName(),
                                /* attributionTag= */ attributedOpEntry.getKey(),
                                /* active= */ true,
                                // AppOpsManager doesn't have a way to fetch attribution flags or
                                // chain ID given an op entry, so default them to none.
                                AppOpsManager.ATTRIBUTION_FLAGS_NONE,
                                AppOpsManager.ATTRIBUTION_CHAIN_ID_NONE);
                    }
                }
            }
        }
    }

    /**
     * Adds a callback that will get notifified when an AppOp of the type the controller tracks
     * changes
+3 −2
Original line number Diff line number Diff line
@@ -128,8 +128,9 @@ constructor(
    override fun onStatusEvent(event: StatusEvent) {
        Assert.isMainThread()

        // Ignore any updates until the system is up and running
        if (isTooEarly() || !isImmersiveIndicatorEnabled()) {
        // Ignore any updates until the system is up and running. However, for important events that
        // request to be force visible (like privacy), ignore whether it's too early.
        if ((isTooEarly() && !event.forceVisible) || !isImmersiveIndicatorEnabled()) {
            return
        }

+3 −2
Original line number Diff line number Diff line
@@ -93,8 +93,9 @@ constructor(
    @SystemAnimationState override fun getAnimationState() = animationState

    override fun onStatusEvent(event: StatusEvent) {
        // Ignore any updates until the system is up and running
        if (isTooEarly() || !isImmersiveIndicatorEnabled()) {
        // Ignore any updates until the system is up and running. However, for important events that
        // request to be force visible (like privacy), ignore whether it's too early.
        if ((isTooEarly() && !event.forceVisible) || !isImmersiveIndicatorEnabled()) {
            return
        }

Loading