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

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

Merge "Notification history updates" into rvc-dev

parents 87c0179c 8222a9a6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@
                android:layout_gravity="center_horizontal"
                android:textAlignment="center"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:text="@string/notification_history_summary" />
                android:text="@string/notification_history_off_summary" />
        </LinearLayout>

        <LinearLayout
+7 −7
Original line number Diff line number Diff line
@@ -6283,7 +6283,7 @@
    <string name="notification_log_title">Notification log</string>
    <string name="notification_history_title">Notification history</string>
    <string name="notification_history_today">Today</string>
    <string name="notification_history_today">Last 24 hours</string>
    <string name="notification_history_snooze">Snoozed</string>
    <string name="notification_history_dismiss">Recently dismissed</string>
@@ -8073,19 +8073,19 @@
    <string name="asst_capabilities_actions_replies_summary">Automatically show suggested actions &amp; replies</string>
    <!-- Configure notifications: settings summary [CHAR LIMIT=NONE] -->
    <string name="notification_history_summary">Turn on notification history to keep track of past notifications and snoozed notifications</string>
    <string name="notification_history_summary">Show recent and snoozed notifications</string>
    <!-- Configure notifications: settings title [CHAR LIMIT=100] -->
    <string name="notification_history">Notification history</string>
    <!-- Configure notifications: settings title [CHAR LIMIT=100] -->
    <string name="notification_history_turn_on">Turn on history</string>
    <string name="notification_history_toggle">Use notification history</string>
    <!-- Configure notifications: settings title [CHAR LIMIT=100] -->
    <string name="notification_history_turn_off">Turn off history</string>
    <!-- Notification history screen; title when history is off [CHAR LIMIT=200] -->
    <string name="notification_history_off_title_extended">Notification history turned off</string>
    <!-- Notification history screen; summary when history is off [CHAR LIMIT=200] -->
    <string name="notification_history_off_title_extended">Notification history is turned off</string>
    <!--  Notification history screen; summary when history is off [CHAR LIMIT=NONE] -->
   <string name="notification_history_off_summary">Turn on notification history to see recent notifications and snoozed notifications</string>
    <!-- Notification history screen; content description describing what happens when you tap on a notification history entry [CHAR LIMIT=NONE] -->
    <string name="notification_history_view_settings">view notification settings</string>
+3 −2
Original line number Diff line number Diff line
@@ -116,6 +116,7 @@ public class NotificationHistoryActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setTitle(R.string.notification_history);
        setContentView(R.layout.notification_history);
        mTodayView = findViewById(R.id.apps);
        mSnoozeView = findViewById(R.id.snoozed_list);
@@ -161,8 +162,8 @@ public class NotificationHistoryActivity extends Activity {
    private void bindSwitch() {
        SwitchBar bar = findViewById(R.id.switch_bar);
        if (bar != null) {
            bar.setSwitchBarText(R.string.notification_history_turn_off,
                    R.string.notification_history_turn_on);
            bar.setSwitchBarText(R.string.notification_history_toggle,
                    R.string.notification_history_toggle);
            bar.show();
            try {
                bar.addOnSwitchChangeListener(mOnSwitchClickListener);
+6 −1
Original line number Diff line number Diff line
@@ -23,6 +23,8 @@ import static android.os.UserHandle.USER_ALL;
import static android.os.UserHandle.USER_CURRENT;

import android.annotation.ColorInt;
import android.annotation.UserIdInt;
import android.app.ActivityManager;
import android.app.Notification;
import android.content.Context;
import android.content.pm.ApplicationInfo;
@@ -46,6 +48,7 @@ import com.android.internal.util.ContrastColorUtil;
import com.android.settings.R;

import java.util.ArrayList;
import java.util.Currency;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -60,6 +63,7 @@ public class NotificationSbnAdapter extends
    private PackageManager mPm;
    private @ColorInt int mBackgroundColor;
    private boolean mInNightMode;
    private @UserIdInt int mCurrentUser;

    public NotificationSbnAdapter(Context context, PackageManager pm) {
        mContext = context;
@@ -71,6 +75,7 @@ public class NotificationSbnAdapter extends
        Configuration currentConfig = mContext.getResources().getConfiguration();
        mInNightMode = (currentConfig.uiMode & Configuration.UI_MODE_NIGHT_MASK)
                == Configuration.UI_MODE_NIGHT_YES;
        mCurrentUser = ActivityManager.getCurrentUser();
        setHasStableIds(true);
    }

@@ -188,7 +193,7 @@ public class NotificationSbnAdapter extends
    private int normalizeUserId(StatusBarNotification sbn) {
        int userId = sbn.getUserId();
        if (userId == USER_ALL) {
            userId = USER_CURRENT;
            userId = mCurrentUser;
        }
        return userId;
    }