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

Commit a2a3c2fd authored by Romain Hunault's avatar Romain Hunault 💻
Browse files

Merge remote-tracking branch 'origin/cm-14.1' into v1-nougat

parents f8ddb94d eda562c9
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -106,9 +106,11 @@ public class ScreenPinningSettings extends SettingsPreferenceFragment
    }

    private boolean isScreenLockUsed() {
        int def = getCurrentSecurityTitle() != R.string.screen_pinning_unlock_none ? 1 : 0;
        // This functionality should be kept consistent with
        // com.android.server.am.ActivityStackSupervisor (see b/127605586)
        int defaultValueIfSettingNull = mLockPatternUtils.isSecure(UserHandle.myUserId()) ? 1 : 0;
        return Settings.Secure.getInt(getContentResolver(),
                Settings.Secure.LOCK_TO_APP_EXIT_LOCKED, def) != 0;
                Settings.Secure.LOCK_TO_APP_EXIT_LOCKED, defaultValueIfSettingNull) != 0;
    }

    private boolean setScreenLockUsed(boolean isEnabled) {
+22 −5
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.settings.notification;

import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;

import android.app.Notification;
import android.app.NotificationManager;
import android.content.Intent;
@@ -28,15 +30,14 @@ import android.os.UserHandle;
import android.service.notification.NotificationListenerService.Ranking;
import android.util.ArrayMap;
import android.util.Log;

import android.view.Window;
import android.view.WindowManager;
import com.android.internal.logging.MetricsProto.MetricsEvent;
import com.android.internal.widget.LockPatternUtils;
import com.android.settings.AppHeader;
import com.android.settings.R;
import com.android.settings.notification.NotificationBackend.AppRow;
import com.android.settingslib.RestrictedSwitchPreference;


import java.util.List;

/** These settings are per app, so should not be returned in global search results. */
@@ -85,7 +86,8 @@ public class AppNotificationSettings extends NotificationSettingsBase {

            NotificationManager.Policy policy =
                    NotificationManager.from(mContext).getNotificationPolicy();
            mDndVisualEffectsSuppressed = policy == null ? false : policy.suppressedVisualEffects != 0;
            mDndVisualEffectsSuppressed =
                    policy == null ? false : policy.suppressedVisualEffects != 0;

            // load settings intent
            ArrayMap<String, AppRow> rows = new ArrayMap<String, AppRow>();
@@ -101,6 +103,21 @@ public class AppNotificationSettings extends NotificationSettingsBase {
        }
    }

    @Override
    public void onResume() {
        super.onResume();
        getActivity().getWindow().addPrivateFlags(PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
        android.util.EventLog.writeEvent(0x534e4554, "119115683", -1, "");
    }

    public void onPause() {
        super.onPause();
        final Window window = getActivity().getWindow();
        final WindowManager.LayoutParams attrs = window.getAttributes();
        attrs.privateFlags &= ~PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
        window.setAttributes(attrs);
    }

    @Override
    protected void updateDependents(int importance) {
        LockPatternUtils utils = new LockPatternUtils(getActivity());