Merge "Remove 'peekable' notification preference."

This commit is contained in:
Julia Reynolds
2015-11-19 13:41:01 +00:00
committed by Android (Google) Code Review
7 changed files with 0 additions and 68 deletions

View File

@@ -88,15 +88,4 @@ public class AppStateNotificationBridge extends AppStateBaseBridge {
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;
}
};
}

View File

@@ -821,9 +821,6 @@ public class InstalledAppDetails extends AppInfoBase
if (appRow.sensitive) {
notifSummary.add(context.getString(R.string.notifications_sensitive));
}
if (!appRow.peekable) {
notifSummary.add(context.getString(R.string.notifications_no_peeking));
}
switch (notifSummary.size()) {
case 3:
return context.getString(R.string.notifications_three_items,

View File

@@ -139,7 +139,6 @@ public class ManageApplications extends InstrumentedFragment
R.string.filter_apps_disabled, // Disabled
R.string.filter_notif_blocked_apps, // Blocked 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_personal_apps, // Personal
R.string.filter_work_apps, // Work
@@ -160,7 +159,6 @@ public class ManageApplications extends InstrumentedFragment
ApplicationsState.FILTER_DISABLED, // Disabled
AppStateNotificationBridge.FILTER_APP_NOTIFICATION_BLOCKED, // Blocked Notifications
AppStateNotificationBridge.FILTER_APP_NOTIFICATION_PRIORITY, // Priority Notifications
AppStateNotificationBridge.FILTER_APP_NOTIFICATION_NO_PEEK, // No peeking Notifications
AppStateNotificationBridge.FILTER_APP_NOTIFICATION_SENSITIVE, // Sensitive Notifications
ApplicationsState.FILTER_PERSONAL, // Personal
ApplicationsState.FILTER_WORK, // Work

View File

@@ -55,7 +55,6 @@ public class AppNotificationSettings extends SettingsPreferenceFragment {
private static final String KEY_BLOCK = "block";
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_APP_SETTINGS = "app_settings";
@@ -68,7 +67,6 @@ public class AppNotificationSettings extends SettingsPreferenceFragment {
private Context mContext;
private SwitchPreference mBlock;
private SwitchPreference mPriority;
private SwitchPreference mPeekable;
private SwitchPreference mSensitive;
private AppRow mAppRow;
private boolean mCreated;
@@ -133,7 +131,6 @@ public class AppNotificationSettings extends SettingsPreferenceFragment {
addPreferencesFromResource(R.xml.app_notification_settings);
mBlock = (SwitchPreference) findPreference(KEY_BLOCK);
mPriority = (SwitchPreference) findPreference(KEY_PRIORITY);
mPeekable = (SwitchPreference) findPreference(KEY_PEEKABLE);
mSensitive = (SwitchPreference) findPreference(KEY_SENSITIVE);
mAppRow = mBackend.loadAppRow(pm, info.applicationInfo);
@@ -146,7 +143,6 @@ public class AppNotificationSettings extends SettingsPreferenceFragment {
mBlock.setChecked(mAppRow.banned);
updateDependents(mAppRow.banned);
mPriority.setChecked(mAppRow.priority);
mPeekable.setChecked(mAppRow.peekable);
mSensitive.setChecked(mAppRow.sensitive);
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() {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
@@ -219,7 +207,6 @@ public class AppNotificationSettings extends SettingsPreferenceFragment {
setVisible(mBlock, !mIsSystemPackage);
setVisible(mPriority, mIsSystemPackage || !banned);
setVisible(mPeekable, mIsSystemPackage || !banned);
setVisible(mSensitive, mIsSystemPackage || !banned && lockscreenSecure
&& lockscreenNotificationsEnabled && allowPrivate);
}

View File

@@ -45,7 +45,6 @@ public class NotificationBackend {
row.icon = app.loadIcon(pm);
row.banned = getNotificationsBanned(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);
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) {
try {
return sINM.getPackageVisibilityOverride(pkg, uid) == Notification.VISIBILITY_PRIVATE;
@@ -142,7 +122,6 @@ public class NotificationBackend {
public Intent settingsIntent;
public boolean banned;
public boolean priority;
public boolean peekable;
public boolean sensitive;
public boolean first; // first app in section
}