Merge "Helper methods for settings screen" into pi-dev
am: 6a66f4e8cf
Change-Id: I7c82e16f2c1004114484bc422afe47cb894ca3a3
This commit is contained in:
@@ -1145,6 +1145,21 @@ public class NotificationManager {
|
|||||||
SUPPRESSED_EFFECT_NOTIFICATION_LIST
|
SUPPRESSED_EFFECT_NOTIFICATION_LIST
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private static final int[] SCREEN_OFF_SUPPRESSED_EFFECTS = {
|
||||||
|
SUPPRESSED_EFFECT_SCREEN_OFF,
|
||||||
|
SUPPRESSED_EFFECT_FULL_SCREEN_INTENT,
|
||||||
|
SUPPRESSED_EFFECT_LIGHTS,
|
||||||
|
SUPPRESSED_EFFECT_AMBIENT,
|
||||||
|
};
|
||||||
|
|
||||||
|
private static final int[] SCREEN_ON_SUPPRESSED_EFFECTS = {
|
||||||
|
SUPPRESSED_EFFECT_SCREEN_ON,
|
||||||
|
SUPPRESSED_EFFECT_PEEK,
|
||||||
|
SUPPRESSED_EFFECT_STATUS_BAR,
|
||||||
|
SUPPRESSED_EFFECT_BADGE,
|
||||||
|
SUPPRESSED_EFFECT_NOTIFICATION_LIST
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Visual effects to suppress for a notification that is filtered by Do Not Disturb mode.
|
* Visual effects to suppress for a notification that is filtered by Do Not Disturb mode.
|
||||||
* Bitmask of SUPPRESSED_EFFECT_* constants.
|
* Bitmask of SUPPRESSED_EFFECT_* constants.
|
||||||
@@ -1297,6 +1312,32 @@ public class NotificationManager {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static boolean areAnyScreenOffEffectsSuppressed(int effects) {
|
||||||
|
for (int i = 0; i < SCREEN_OFF_SUPPRESSED_EFFECTS.length; i++) {
|
||||||
|
final int effect = SCREEN_OFF_SUPPRESSED_EFFECTS[i];
|
||||||
|
if ((effects & effect) != 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static boolean areAnyScreenOnEffectsSuppressed(int effects) {
|
||||||
|
for (int i = 0; i < SCREEN_ON_SUPPRESSED_EFFECTS.length; i++) {
|
||||||
|
final int effect = SCREEN_ON_SUPPRESSED_EFFECTS[i];
|
||||||
|
if ((effects & effect) != 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public static String suppressedEffectsToString(int effects) {
|
public static String suppressedEffectsToString(int effects) {
|
||||||
if (effects <= 0) return "";
|
if (effects <= 0) return "";
|
||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
|
|||||||
Reference in New Issue
Block a user