Merge "No screen lock notification"

This commit is contained in:
TreeHugger Robot
2023-02-02 02:23:16 +00:00
committed by Android (Google) Code Review
2 changed files with 15 additions and 1 deletions

View File

@@ -1044,6 +1044,10 @@
<string name="no_screen_lock_issue_summary">For added security, set a PIN, pattern, or password for this device.</string> <string name="no_screen_lock_issue_summary">For added security, set a PIN, pattern, or password for this device.</string>
<!-- Action label for the issue card in Safety Center when no screen lock is set [CHAR LIMIT=50] --> <!-- Action label for the issue card in Safety Center when no screen lock is set [CHAR LIMIT=50] -->
<string name="no_screen_lock_issue_action_label">Set screen lock</string> <string name="no_screen_lock_issue_action_label">Set screen lock</string>
<!-- Title of the notification shown by Safety Center when no screen lock is set. This notification is shown in the notification shade, outside of the main Safety Center UI. [CHAR LIMIT=50] -->
<string name="no_screen_lock_issue_notification_title">Device has no screen lock</string>
<!-- Summary/body text of the notification shown by Safety Center when no screen lock is set. This notification is shown in the notification shade, outside of the main Safety Center UI. [CHAR LIMIT=NONE] -->
<string name="no_screen_lock_issue_notification_text">For added security, set a PIN, pattern, or password for this device.</string>
<!-- Unlock Picker Settings --><skip /> <!-- Unlock Picker Settings --><skip />

View File

@@ -138,6 +138,12 @@ public final class LockScreenSafetySource {
SET_SCREEN_LOCK_ACTION_ID, SET_SCREEN_LOCK_ACTION_ID,
context.getString(R.string.no_screen_lock_issue_action_label), context.getString(R.string.no_screen_lock_issue_action_label),
pendingIntent).build(); pendingIntent).build();
// Custom notification deliberately has zero actions
final SafetySourceIssue.Notification customNotification =
new SafetySourceIssue.Notification.Builder(
context.getString(R.string.no_screen_lock_issue_notification_title),
context.getString(R.string.no_screen_lock_issue_notification_text))
.build();
return new SafetySourceIssue.Builder( return new SafetySourceIssue.Builder(
NO_SCREEN_LOCK_ISSUE_ID, NO_SCREEN_LOCK_ISSUE_ID,
context.getString(R.string.no_screen_lock_issue_title), context.getString(R.string.no_screen_lock_issue_title),
@@ -145,6 +151,10 @@ public final class LockScreenSafetySource {
SafetySourceData.SEVERITY_LEVEL_RECOMMENDATION, SafetySourceData.SEVERITY_LEVEL_RECOMMENDATION,
NO_SCREEN_LOCK_ISSUE_TYPE_ID) NO_SCREEN_LOCK_ISSUE_TYPE_ID)
.setIssueCategory(SafetySourceIssue.ISSUE_CATEGORY_DEVICE) .setIssueCategory(SafetySourceIssue.ISSUE_CATEGORY_DEVICE)
.addAction(action).build(); .addAction(action)
.setIssueActionability(SafetySourceIssue.ISSUE_ACTIONABILITY_MANUAL)
.setCustomNotification(customNotification)
.setNotificationBehavior(SafetySourceIssue.NOTIFICATION_BEHAVIOR_DELAYED)
.build();
} }
} }