Remove 'peekable' notification preference.
Bug: 22854014 Change-Id: I920185cd8c766436338d38a51663bd5480699f5d
This commit is contained in:
@@ -6099,12 +6099,6 @@
|
|||||||
<!-- [CHAR LIMIT=NONE] App notification settings: Priority option description-->
|
<!-- [CHAR LIMIT=NONE] App notification settings: Priority option description-->
|
||||||
<string name="app_notification_priority_summary">Let this app\u2019s notifications be heard when Do not disturb is set to Priority only</string>
|
<string name="app_notification_priority_summary">Let this app\u2019s notifications be heard when Do not disturb is set to Priority only</string>
|
||||||
|
|
||||||
<!-- [CHAR LIMIT=NONE] App notification settings: Peekable option title -->
|
|
||||||
<string name="app_notification_peekable_title">Allow peeking</string>
|
|
||||||
|
|
||||||
<!-- [CHAR LIMIT=NONE] App notification settings: Peekable option description-->
|
|
||||||
<string name="app_notification_peekable_summary">Let this app emphasize certain notifications by sliding them briefly into view on the current screen</string>
|
|
||||||
|
|
||||||
<!-- [CHAR LIMIT=NONE] App notification settings: Sensitive option title -->
|
<!-- [CHAR LIMIT=NONE] App notification settings: Sensitive option title -->
|
||||||
<string name="app_notification_sensitive_title">Hide sensitive content</string>
|
<string name="app_notification_sensitive_title">Hide sensitive content</string>
|
||||||
|
|
||||||
@@ -6494,8 +6488,6 @@
|
|||||||
<string name="notifications_sensitive">Sensitive content hidden</string>
|
<string name="notifications_sensitive">Sensitive content hidden</string>
|
||||||
<!-- App notification summary with notifications priority [CHAR LIMIT=40] -->
|
<!-- App notification summary with notifications priority [CHAR LIMIT=40] -->
|
||||||
<string name="notifications_priority">Priority</string>
|
<string name="notifications_priority">Priority</string>
|
||||||
<!-- App notification summary with notification peeking disabled [CHAR LIMIT=40] -->
|
|
||||||
<string name="notifications_no_peeking">No peeking</string>
|
|
||||||
<!-- App notification summary with 2 items [CHAR LIMIT=15] -->
|
<!-- App notification summary with 2 items [CHAR LIMIT=15] -->
|
||||||
<string name="notifications_two_items"><xliff:g id="notif_state" example="Priority">%1$s</xliff:g> / <xliff:g id="notif_state" example="Priority">%2$s</xliff:g></string>
|
<string name="notifications_two_items"><xliff:g id="notif_state" example="Priority">%1$s</xliff:g> / <xliff:g id="notif_state" example="Priority">%2$s</xliff:g></string>
|
||||||
<!-- App notification summary with 3 items [CHAR LIMIT=15] -->
|
<!-- App notification summary with 3 items [CHAR LIMIT=15] -->
|
||||||
@@ -6540,8 +6532,6 @@
|
|||||||
<string name="filter_notif_priority_apps">Priority</string>
|
<string name="filter_notif_priority_apps">Priority</string>
|
||||||
<!-- Label for showing apps with sensitive notifications in list [CHAR LIMIT=30] -->
|
<!-- Label for showing apps with sensitive notifications in list [CHAR LIMIT=30] -->
|
||||||
<string name="filter_notif_sensitive_apps">Sensitive content hidden</string>
|
<string name="filter_notif_sensitive_apps">Sensitive content hidden</string>
|
||||||
<!-- Label for showing apps with peeking disabled in list [CHAR LIMIT=30] -->
|
|
||||||
<string name="filter_notif_no_peeking">No peeking</string>
|
|
||||||
<!-- Label for showing apps with domain URLs (data URI with http or https) in list [CHAR LIMIT=30] -->
|
<!-- Label for showing apps with domain URLs (data URI with http or https) in list [CHAR LIMIT=30] -->
|
||||||
<string name="filter_with_domain_urls_apps">With domain URLs</string>
|
<string name="filter_with_domain_urls_apps">With domain URLs</string>
|
||||||
|
|
||||||
|
@@ -34,14 +34,6 @@
|
|||||||
android:order="2"
|
android:order="2"
|
||||||
android:persistent="false" />
|
android:persistent="false" />
|
||||||
|
|
||||||
<!-- Peekable -->
|
|
||||||
<SwitchPreference
|
|
||||||
android:key="peekable"
|
|
||||||
android:title="@string/app_notification_peekable_title"
|
|
||||||
android:summary="@string/app_notification_peekable_summary"
|
|
||||||
android:order="3"
|
|
||||||
android:persistent="false" />
|
|
||||||
|
|
||||||
<!-- Sensitive -->
|
<!-- Sensitive -->
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:key="sensitive"
|
android:key="sensitive"
|
||||||
|
@@ -88,15 +88,4 @@ public class AppStateNotificationBridge extends AppStateBaseBridge {
|
|||||||
return info.extraInfo != null && ((AppRow) info.extraInfo).sensitive;
|
return info.extraInfo != null && ((AppRow) info.extraInfo).sensitive;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public static final AppFilter FILTER_APP_NOTIFICATION_NO_PEEK = new AppFilter() {
|
|
||||||
@Override
|
|
||||||
public void init() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean filterApp(AppEntry info) {
|
|
||||||
return info.extraInfo != null && !((AppRow) info.extraInfo).peekable;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
@@ -821,9 +821,6 @@ public class InstalledAppDetails extends AppInfoBase
|
|||||||
if (appRow.sensitive) {
|
if (appRow.sensitive) {
|
||||||
notifSummary.add(context.getString(R.string.notifications_sensitive));
|
notifSummary.add(context.getString(R.string.notifications_sensitive));
|
||||||
}
|
}
|
||||||
if (!appRow.peekable) {
|
|
||||||
notifSummary.add(context.getString(R.string.notifications_no_peeking));
|
|
||||||
}
|
|
||||||
switch (notifSummary.size()) {
|
switch (notifSummary.size()) {
|
||||||
case 3:
|
case 3:
|
||||||
return context.getString(R.string.notifications_three_items,
|
return context.getString(R.string.notifications_three_items,
|
||||||
|
@@ -139,7 +139,6 @@ public class ManageApplications extends InstrumentedFragment
|
|||||||
R.string.filter_apps_disabled, // Disabled
|
R.string.filter_apps_disabled, // Disabled
|
||||||
R.string.filter_notif_blocked_apps, // Blocked Notifications
|
R.string.filter_notif_blocked_apps, // Blocked Notifications
|
||||||
R.string.filter_notif_priority_apps, // Priority Notifications
|
R.string.filter_notif_priority_apps, // Priority Notifications
|
||||||
R.string.filter_notif_no_peeking, // No peeking Notifications
|
|
||||||
R.string.filter_notif_sensitive_apps, // Sensitive Notifications
|
R.string.filter_notif_sensitive_apps, // Sensitive Notifications
|
||||||
R.string.filter_personal_apps, // Personal
|
R.string.filter_personal_apps, // Personal
|
||||||
R.string.filter_work_apps, // Work
|
R.string.filter_work_apps, // Work
|
||||||
@@ -160,7 +159,6 @@ public class ManageApplications extends InstrumentedFragment
|
|||||||
ApplicationsState.FILTER_DISABLED, // Disabled
|
ApplicationsState.FILTER_DISABLED, // Disabled
|
||||||
AppStateNotificationBridge.FILTER_APP_NOTIFICATION_BLOCKED, // Blocked Notifications
|
AppStateNotificationBridge.FILTER_APP_NOTIFICATION_BLOCKED, // Blocked Notifications
|
||||||
AppStateNotificationBridge.FILTER_APP_NOTIFICATION_PRIORITY, // Priority Notifications
|
AppStateNotificationBridge.FILTER_APP_NOTIFICATION_PRIORITY, // Priority Notifications
|
||||||
AppStateNotificationBridge.FILTER_APP_NOTIFICATION_NO_PEEK, // No peeking Notifications
|
|
||||||
AppStateNotificationBridge.FILTER_APP_NOTIFICATION_SENSITIVE, // Sensitive Notifications
|
AppStateNotificationBridge.FILTER_APP_NOTIFICATION_SENSITIVE, // Sensitive Notifications
|
||||||
ApplicationsState.FILTER_PERSONAL, // Personal
|
ApplicationsState.FILTER_PERSONAL, // Personal
|
||||||
ApplicationsState.FILTER_WORK, // Work
|
ApplicationsState.FILTER_WORK, // Work
|
||||||
|
@@ -55,7 +55,6 @@ public class AppNotificationSettings extends SettingsPreferenceFragment {
|
|||||||
|
|
||||||
private static final String KEY_BLOCK = "block";
|
private static final String KEY_BLOCK = "block";
|
||||||
private static final String KEY_PRIORITY = "priority";
|
private static final String KEY_PRIORITY = "priority";
|
||||||
private static final String KEY_PEEKABLE = "peekable";
|
|
||||||
private static final String KEY_SENSITIVE = "sensitive";
|
private static final String KEY_SENSITIVE = "sensitive";
|
||||||
private static final String KEY_APP_SETTINGS = "app_settings";
|
private static final String KEY_APP_SETTINGS = "app_settings";
|
||||||
|
|
||||||
@@ -68,7 +67,6 @@ public class AppNotificationSettings extends SettingsPreferenceFragment {
|
|||||||
private Context mContext;
|
private Context mContext;
|
||||||
private SwitchPreference mBlock;
|
private SwitchPreference mBlock;
|
||||||
private SwitchPreference mPriority;
|
private SwitchPreference mPriority;
|
||||||
private SwitchPreference mPeekable;
|
|
||||||
private SwitchPreference mSensitive;
|
private SwitchPreference mSensitive;
|
||||||
private AppRow mAppRow;
|
private AppRow mAppRow;
|
||||||
private boolean mCreated;
|
private boolean mCreated;
|
||||||
@@ -133,7 +131,6 @@ public class AppNotificationSettings extends SettingsPreferenceFragment {
|
|||||||
addPreferencesFromResource(R.xml.app_notification_settings);
|
addPreferencesFromResource(R.xml.app_notification_settings);
|
||||||
mBlock = (SwitchPreference) findPreference(KEY_BLOCK);
|
mBlock = (SwitchPreference) findPreference(KEY_BLOCK);
|
||||||
mPriority = (SwitchPreference) findPreference(KEY_PRIORITY);
|
mPriority = (SwitchPreference) findPreference(KEY_PRIORITY);
|
||||||
mPeekable = (SwitchPreference) findPreference(KEY_PEEKABLE);
|
|
||||||
mSensitive = (SwitchPreference) findPreference(KEY_SENSITIVE);
|
mSensitive = (SwitchPreference) findPreference(KEY_SENSITIVE);
|
||||||
|
|
||||||
mAppRow = mBackend.loadAppRow(pm, info.applicationInfo);
|
mAppRow = mBackend.loadAppRow(pm, info.applicationInfo);
|
||||||
@@ -146,7 +143,6 @@ public class AppNotificationSettings extends SettingsPreferenceFragment {
|
|||||||
mBlock.setChecked(mAppRow.banned);
|
mBlock.setChecked(mAppRow.banned);
|
||||||
updateDependents(mAppRow.banned);
|
updateDependents(mAppRow.banned);
|
||||||
mPriority.setChecked(mAppRow.priority);
|
mPriority.setChecked(mAppRow.priority);
|
||||||
mPeekable.setChecked(mAppRow.peekable);
|
|
||||||
mSensitive.setChecked(mAppRow.sensitive);
|
mSensitive.setChecked(mAppRow.sensitive);
|
||||||
|
|
||||||
mBlock.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
|
mBlock.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
|
||||||
@@ -172,14 +168,6 @@ public class AppNotificationSettings extends SettingsPreferenceFragment {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mPeekable.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
|
|
||||||
@Override
|
|
||||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
|
||||||
final boolean peekable = (Boolean) newValue;
|
|
||||||
return mBackend.setPeekable(pkg, mUid, peekable);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
mSensitive.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
|
mSensitive.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||||
@@ -219,7 +207,6 @@ public class AppNotificationSettings extends SettingsPreferenceFragment {
|
|||||||
|
|
||||||
setVisible(mBlock, !mIsSystemPackage);
|
setVisible(mBlock, !mIsSystemPackage);
|
||||||
setVisible(mPriority, mIsSystemPackage || !banned);
|
setVisible(mPriority, mIsSystemPackage || !banned);
|
||||||
setVisible(mPeekable, mIsSystemPackage || !banned);
|
|
||||||
setVisible(mSensitive, mIsSystemPackage || !banned && lockscreenSecure
|
setVisible(mSensitive, mIsSystemPackage || !banned && lockscreenSecure
|
||||||
&& lockscreenNotificationsEnabled && allowPrivate);
|
&& lockscreenNotificationsEnabled && allowPrivate);
|
||||||
}
|
}
|
||||||
|
@@ -45,7 +45,6 @@ public class NotificationBackend {
|
|||||||
row.icon = app.loadIcon(pm);
|
row.icon = app.loadIcon(pm);
|
||||||
row.banned = getNotificationsBanned(row.pkg, row.uid);
|
row.banned = getNotificationsBanned(row.pkg, row.uid);
|
||||||
row.priority = getHighPriority(row.pkg, row.uid);
|
row.priority = getHighPriority(row.pkg, row.uid);
|
||||||
row.peekable = getPeekable(row.pkg, row.uid);
|
|
||||||
row.sensitive = getSensitive(row.pkg, row.uid);
|
row.sensitive = getSensitive(row.pkg, row.uid);
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
@@ -90,25 +89,6 @@ public class NotificationBackend {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getPeekable(String pkg, int uid) {
|
|
||||||
try {
|
|
||||||
return sINM.getPackagePeekable(pkg, uid);
|
|
||||||
} catch (Exception e) {
|
|
||||||
Log.w(TAG, "Error calling NoMan", e);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean setPeekable(String pkg, int uid, boolean peekable) {
|
|
||||||
try {
|
|
||||||
sINM.setPackagePeekable(pkg, uid, peekable);
|
|
||||||
return true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
Log.w(TAG, "Error calling NoMan", e);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getSensitive(String pkg, int uid) {
|
public boolean getSensitive(String pkg, int uid) {
|
||||||
try {
|
try {
|
||||||
return sINM.getPackageVisibilityOverride(pkg, uid) == Notification.VISIBILITY_PRIVATE;
|
return sINM.getPackageVisibilityOverride(pkg, uid) == Notification.VISIBILITY_PRIVATE;
|
||||||
@@ -142,7 +122,6 @@ public class NotificationBackend {
|
|||||||
public Intent settingsIntent;
|
public Intent settingsIntent;
|
||||||
public boolean banned;
|
public boolean banned;
|
||||||
public boolean priority;
|
public boolean priority;
|
||||||
public boolean peekable;
|
|
||||||
public boolean sensitive;
|
public boolean sensitive;
|
||||||
public boolean first; // first app in section
|
public boolean first; // first app in section
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user