Snap for 7895410 from bf6c779caa to tm-release

Change-Id: Iee8e1edcb475790520993ec2d17de0a4ab0b6f59
This commit is contained in:
Android Build Coastguard Worker
2021-11-09 02:13:13 +00:00
7 changed files with 26 additions and 13 deletions

View File

@@ -9073,6 +9073,10 @@
<!-- Configure notifications: Title for determining which notifications appear on the lock screen [CHAR LIMIT=60] --> <!-- Configure notifications: Title for determining which notifications appear on the lock screen [CHAR LIMIT=60] -->
<string name="lock_screen_notifs_title">Notifications on lock screen</string> <string name="lock_screen_notifs_title">Notifications on lock screen</string>
<!-- Configure notifications: summary for lockscreen notifications: all notifications shown
regardless of noisiness [CHAR LIMIT=60] -->
<string name="lock_screen_notifs_show_all_summary">Show conversations, default, and silent</string>
<!-- Configure notifications: Value for lockscreen notifications: all notifications shown <!-- Configure notifications: Value for lockscreen notifications: all notifications shown
regardless of noisiness [CHAR LIMIT=60] --> regardless of noisiness [CHAR LIMIT=60] -->
<string name="lock_screen_notifs_show_all">Show conversations, default, and silent</string> <string name="lock_screen_notifs_show_all">Show conversations, default, and silent</string>
@@ -9324,11 +9328,11 @@
<!-- app summary of notification app list screen [CHAR LIMIT=100] --> <!-- app summary of notification app list screen [CHAR LIMIT=100] -->
<plurals name="notifications_sent_daily"> <plurals name="notifications_sent_daily">
<item quantity="one">~<xliff:g id="number">%d</xliff:g> notification per day</item> <item quantity="one">~<xliff:g id="number">%d</xliff:g> notification per day</item>
<item quantity="other">~<xliff:g id="number">%d</xliff:g> notifications per day</item> <item quantity="other">~<xliff:g id="number">%,d</xliff:g> notifications per day</item>
</plurals> </plurals>
<plurals name="notifications_sent_weekly"> <plurals name="notifications_sent_weekly">
<item quantity="one">~<xliff:g id="number">%d</xliff:g> notification per week</item> <item quantity="one">~<xliff:g id="number">%d</xliff:g> notification per week</item>
<item quantity="other">~<xliff:g id="number">%d</xliff:g> notifications per week</item> <item quantity="other">~<xliff:g id="number">%,d</xliff:g> notifications per week</item>
</plurals> </plurals>
<!-- app summary of notification app list screen [CHAR LIMIT=100] --> <!-- app summary of notification app list screen [CHAR LIMIT=100] -->
<string name="notifications_sent_never">Never</string> <string name="notifications_sent_never">Never</string>

View File

@@ -16,6 +16,7 @@
package com.android.settings.applications.autofill; package com.android.settings.applications.autofill;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
import static android.service.autofill.AutofillService.EXTRA_RESULT; import static android.service.autofill.AutofillService.EXTRA_RESULT;
import static androidx.lifecycle.Lifecycle.Event.ON_CREATE; import static androidx.lifecycle.Lifecycle.Event.ON_CREATE;
@@ -133,7 +134,8 @@ public class PasswordsPreferenceController extends BasePreferenceController
new Intent(Intent.ACTION_MAIN) new Intent(Intent.ACTION_MAIN)
.setClassName( .setClassName(
serviceInfo.packageName, serviceInfo.packageName,
service.getPasswordsActivity()); service.getPasswordsActivity())
.setFlags(FLAG_ACTIVITY_NEW_TASK);
prefContext.startActivityAsUser(intent, UserHandle.of(user)); prefContext.startActivityAsUser(intent, UserHandle.of(user));
return true; return true;
}); });

View File

@@ -188,7 +188,8 @@ public final class BluetoothPairingService extends Service {
} }
PendingIntent pairIntent = PendingIntent.getService(this, 0, pairingDialogIntent, PendingIntent pairIntent = PendingIntent.getService(this, 0, pairingDialogIntent,
PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_UPDATE_CURRENT
| PendingIntent.FLAG_IMMUTABLE);
Intent serviceIntent = new Intent(ACTION_DISMISS_PAIRING); Intent serviceIntent = new Intent(ACTION_DISMISS_PAIRING);
serviceIntent.setClass(this, BluetoothPairingService.class); serviceIntent.setClass(this, BluetoothPairingService.class);

View File

@@ -178,7 +178,8 @@ public class RedactNotificationPreferenceController extends TogglePreferenceCont
private boolean getAllowPrivateNotifications(int userId) { private boolean getAllowPrivateNotifications(int userId) {
return Settings.Secure.getIntForUser(mContext.getContentResolver(), return Settings.Secure.getIntForUser(mContext.getContentResolver(),
LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 1, userId) != 0; LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 1, userId) != 0
&& getEnforcedAdmin(userId) == null;
} }
private boolean getLockscreenNotificationsEnabled(int userId) { private boolean getLockscreenNotificationsEnabled(int userId) {

View File

@@ -116,7 +116,7 @@ public class ShowOnLockScreenNotificationPreferenceController extends AbstractPr
} else if (!getLockscreenSilentNotificationsEnabled()) { } else if (!getLockscreenSilentNotificationsEnabled()) {
return mContext.getString(R.string.lock_screen_notifs_show_alerting); return mContext.getString(R.string.lock_screen_notifs_show_alerting);
} else { } else {
return mContext.getString(R.string.lock_screen_notifs_show_all); return mContext.getString(R.string.lock_screen_notifs_show_all_summary);
} }
} }

View File

@@ -292,6 +292,18 @@ public class RedactNotificationPreferenceControllerTest {
assertThat(mWorkController.isChecked()).isFalse(); assertThat(mWorkController.isChecked()).isFalse();
} }
@Test
public void isChecked_admin() {
Settings.Secure.putIntForUser(mContext.getContentResolver(),
LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS,
1, 0);
ShadowRestrictedLockUtilsInternal.setKeyguardDisabledFeatures(
KEYGUARD_DISABLE_SECURE_NOTIFICATIONS);
assertThat(mController.isChecked()).isFalse();
}
@Test @Test
public void setChecked_false() throws Exception { public void setChecked_false() throws Exception {
Settings.Secure.putIntForUser(mContext.getContentResolver(), Settings.Secure.putIntForUser(mContext.getContentResolver(),

View File

@@ -40,7 +40,6 @@ import com.android.settings.notification.NotificationBackend;
import com.android.settingslib.widget.LayoutPreference; import com.android.settingslib.widget.LayoutPreference;
import org.junit.Before; import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.mockito.Mock; import org.mockito.Mock;
@@ -132,7 +131,6 @@ public class HeaderPreferenceControllerTest {
} }
@Test @Test
@Ignore
public void testGetSummary() { public void testGetSummary() {
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow(); NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
appRow.label = "bananas"; appRow.label = "bananas";
@@ -140,8 +138,6 @@ public class HeaderPreferenceControllerTest {
assertEquals("", mController.getSummary()); assertEquals("", mController.getSummary());
NotificationChannelGroup group = new NotificationChannelGroup("id", "name"); NotificationChannelGroup group = new NotificationChannelGroup("id", "name");
mController.onResume(appRow, null, group, null, null, null, null);
assertEquals(appRow.label, mController.getSummary());
NotificationChannel channel = new NotificationChannel("cid", "cname", IMPORTANCE_NONE); NotificationChannel channel = new NotificationChannel("cid", "cname", IMPORTANCE_NONE);
mController.onResume(appRow, channel, group, null, null, null, null); mController.onResume(appRow, channel, group, null, null, null, null);
@@ -159,7 +155,6 @@ public class HeaderPreferenceControllerTest {
} }
@Test @Test
@Ignore
public void testGetSecondSummary() { public void testGetSecondSummary() {
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow(); NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
appRow.label = "bananas"; appRow.label = "bananas";
@@ -167,8 +162,6 @@ public class HeaderPreferenceControllerTest {
assertEquals("", mController.getSecondSummary()); assertEquals("", mController.getSecondSummary());
NotificationChannelGroup group = new NotificationChannelGroup("id", "name"); NotificationChannelGroup group = new NotificationChannelGroup("id", "name");
mController.onResume(appRow, null, group, null, null, null, null);
assertEquals("", mController.getSecondSummary());
NotificationChannel channel = new NotificationChannel("cid", "cname", IMPORTANCE_NONE); NotificationChannel channel = new NotificationChannel("cid", "cname", IMPORTANCE_NONE);
mController.onResume(appRow, channel, group, null, null, null, null); mController.onResume(appRow, channel, group, null, null, null, null);