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

Commit 32c36ff2 authored by Julia Reynolds's avatar Julia Reynolds Committed by Android (Google) Code Review
Browse files

Merge "Manage/History buttons should be multiuser aware" into rvc-dev

parents a9f4e2d2 1f94a9dd
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ import android.graphics.Rect;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.ServiceManager;
import android.os.UserHandle;
import android.provider.Settings;
import android.service.notification.NotificationListenerService;
import android.service.notification.StatusBarNotification;
@@ -756,8 +757,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
        boolean showFooterView = (showDismissView || hasActiveNotifications())
                && mStatusBarState != StatusBarState.KEYGUARD
                && !mRemoteInputManager.getController().isRemoteInputActive();
        boolean showHistory = Settings.Secure.getInt(mContext.getContentResolver(),
                Settings.Secure.NOTIFICATION_HISTORY_ENABLED, 0) == 1;
        boolean showHistory = Settings.Secure.getIntForUser(mContext.getContentResolver(),
                Settings.Secure.NOTIFICATION_HISTORY_ENABLED, 0, UserHandle.USER_CURRENT) == 1;

        updateFooterView(showFooterView, showDismissView, showHistory);
    }
@@ -5730,8 +5731,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
                R.layout.status_bar_no_notifications, this, false);
        view.setText(R.string.empty_shade_text);
        view.setOnClickListener(v -> {
            final boolean showHistory = Settings.Secure.getInt(mContext.getContentResolver(),
                    Settings.Secure.NOTIFICATION_HISTORY_ENABLED, 0) == 1;
            final boolean showHistory = Settings.Secure.getIntForUser(mContext.getContentResolver(),
                    Settings.Secure.NOTIFICATION_HISTORY_ENABLED, 0, UserHandle.USER_CURRENT) == 1;
            Intent intent = showHistory ? new Intent(
                    Settings.ACTION_NOTIFICATION_HISTORY) : new Intent(
                    Settings.ACTION_NOTIFICATION_SETTINGS);
+1 −1
Original line number Diff line number Diff line
@@ -483,7 +483,7 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
                if (showHistory) {
                    tsb.addNextIntent(intent);
                }
                tsb.startActivities();
                tsb.startActivities(null, UserHandle.CURRENT);
                if (shouldCollapse()) {
                    // Putting it back on the main thread, since we're touching views
                    mMainThreadHandler.post(() -> mCommandQueue.animateCollapsePanels(
+3 −1
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import android.metrics.LogMaker;
import android.os.UserHandle;
import android.provider.Settings;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
@@ -152,7 +153,8 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase {
                NOTIFICATION_NEW_INTERRUPTION_MODEL, 0);
        Settings.Secure.putInt(mContext.getContentResolver(),
                NOTIFICATION_NEW_INTERRUPTION_MODEL, 1);
        Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_HISTORY_ENABLED, 1);
        Settings.Secure.putIntForUser(mContext.getContentResolver(), NOTIFICATION_HISTORY_ENABLED,
                1, UserHandle.USER_CURRENT);

        // Inject dependencies before initializing the layout
        mDependency.injectMockDependency(VisualStabilityManager.class);