Merge "Remove @hide from top-level StatusBarManager"

This commit is contained in:
Evan Laird
2019-01-30 00:19:19 +00:00
committed by Android (Google) Code Review
2 changed files with 55 additions and 4 deletions

View File

@@ -35,40 +35,53 @@ import java.lang.annotation.RetentionPolicy;
/**
* Allows an app to control the status bar.
*
* @hide
*/
@SystemService(Context.STATUS_BAR_SERVICE)
public class StatusBarManager {
/** @hide */
@UnsupportedAppUsage
public static final int DISABLE_EXPAND = View.STATUS_BAR_DISABLE_EXPAND;
/** @hide */
public static final int DISABLE_NOTIFICATION_ICONS = View.STATUS_BAR_DISABLE_NOTIFICATION_ICONS;
/** @hide */
public static final int DISABLE_NOTIFICATION_ALERTS
= View.STATUS_BAR_DISABLE_NOTIFICATION_ALERTS;
/** @hide */
@Deprecated
@UnsupportedAppUsage
public static final int DISABLE_NOTIFICATION_TICKER
= View.STATUS_BAR_DISABLE_NOTIFICATION_TICKER;
/** @hide */
public static final int DISABLE_SYSTEM_INFO = View.STATUS_BAR_DISABLE_SYSTEM_INFO;
/** @hide */
public static final int DISABLE_HOME = View.STATUS_BAR_DISABLE_HOME;
/** @hide */
public static final int DISABLE_RECENT = View.STATUS_BAR_DISABLE_RECENT;
/** @hide */
public static final int DISABLE_BACK = View.STATUS_BAR_DISABLE_BACK;
/** @hide */
public static final int DISABLE_CLOCK = View.STATUS_BAR_DISABLE_CLOCK;
/** @hide */
public static final int DISABLE_SEARCH = View.STATUS_BAR_DISABLE_SEARCH;
/** @hide */
@Deprecated
public static final int DISABLE_NAVIGATION =
public static final int DISABLE_NAVIGATION =
View.STATUS_BAR_DISABLE_HOME | View.STATUS_BAR_DISABLE_RECENT;
/** @hide */
@UnsupportedAppUsage
public static final int DISABLE_NONE = 0x00000000;
/** @hide */
public static final int DISABLE_MASK = DISABLE_EXPAND | DISABLE_NOTIFICATION_ICONS
| DISABLE_NOTIFICATION_ALERTS | DISABLE_NOTIFICATION_TICKER
| DISABLE_SYSTEM_INFO | DISABLE_RECENT | DISABLE_HOME | DISABLE_BACK | DISABLE_CLOCK
| DISABLE_SEARCH;
/** @hide */
@IntDef(flag = true, prefix = {"DISABLE_"}, value = {
DISABLE_NONE,
DISABLE_EXPAND,
@@ -91,17 +104,25 @@ public class StatusBarManager {
* Setting this flag disables quick settings completely, but does not disable expanding the
* notification shade.
*/
/** @hide */
public static final int DISABLE2_QUICK_SETTINGS = 1;
/** @hide */
public static final int DISABLE2_SYSTEM_ICONS = 1 << 1;
/** @hide */
public static final int DISABLE2_NOTIFICATION_SHADE = 1 << 2;
/** @hide */
public static final int DISABLE2_GLOBAL_ACTIONS = 1 << 3;
/** @hide */
public static final int DISABLE2_ROTATE_SUGGESTIONS = 1 << 4;
/** @hide */
public static final int DISABLE2_NONE = 0x00000000;
/** @hide */
public static final int DISABLE2_MASK = DISABLE2_QUICK_SETTINGS | DISABLE2_SYSTEM_ICONS
| DISABLE2_NOTIFICATION_SHADE | DISABLE2_GLOBAL_ACTIONS | DISABLE2_ROTATE_SUGGESTIONS;
/** @hide */
@IntDef(flag = true, prefix = { "DISABLE2_" }, value = {
DISABLE2_NONE,
DISABLE2_MASK,
@@ -114,12 +135,17 @@ public class StatusBarManager {
@Retention(RetentionPolicy.SOURCE)
public @interface Disable2Flags {}
/** @hide */
public static final int NAVIGATION_HINT_BACK_ALT = 1 << 0;
/** @hide */
public static final int NAVIGATION_HINT_IME_SHOWN = 1 << 1;
/** @hide */
public static final int WINDOW_STATUS_BAR = 1;
/** @hide */
public static final int WINDOW_NAVIGATION_BAR = 2;
/** @hide */
@IntDef(flag = true, prefix = { "WINDOW_" }, value = {
WINDOW_STATUS_BAR,
WINDOW_NAVIGATION_BAR
@@ -127,10 +153,14 @@ public class StatusBarManager {
@Retention(RetentionPolicy.SOURCE)
public @interface WindowType {}
/** @hide */
public static final int WINDOW_STATE_SHOWING = 0;
/** @hide */
public static final int WINDOW_STATE_HIDING = 1;
/** @hide */
public static final int WINDOW_STATE_HIDDEN = 2;
/** @hide */
@IntDef(flag = true, prefix = { "WINDOW_STATE_" }, value = {
WINDOW_STATE_SHOWING,
WINDOW_STATE_HIDING,
@@ -139,8 +169,11 @@ public class StatusBarManager {
@Retention(RetentionPolicy.SOURCE)
public @interface WindowVisibleState {}
/** @hide */
public static final int CAMERA_LAUNCH_SOURCE_WIGGLE = 0;
/** @hide */
public static final int CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP = 1;
/** @hide */
public static final int CAMERA_LAUNCH_SOURCE_LIFT_TRIGGER = 2;
@UnsupportedAppUsage
@@ -169,6 +202,8 @@ public class StatusBarManager {
/**
* Disable some features in the status bar. Pass the bitwise-or of the DISABLE_* flags.
* To re-enable everything, pass {@link #DISABLE_NONE}.
*
* @hide
*/
@UnsupportedAppUsage
public void disable(int what) {
@@ -188,6 +223,8 @@ public class StatusBarManager {
* To re-enable everything, pass {@link #DISABLE_NONE}.
*
* Warning: Only pass DISABLE2_* flags into this function, do not use DISABLE_* flags.
*
* @hide
*/
public void disable2(@Disable2Flags int what) {
try {
@@ -203,6 +240,8 @@ public class StatusBarManager {
/**
* Expand the notifications panel.
*
* @hide
*/
@UnsupportedAppUsage
public void expandNotificationsPanel() {
@@ -215,9 +254,11 @@ public class StatusBarManager {
throw ex.rethrowFromSystemServer();
}
}
/**
* Collapse the notifications and settings panels.
*
* @hide
*/
@UnsupportedAppUsage
public void collapsePanels() {
@@ -233,6 +274,8 @@ public class StatusBarManager {
/**
* Expand the settings panel.
*
* @hide
*/
@UnsupportedAppUsage
public void expandSettingsPanel() {
@@ -242,6 +285,8 @@ public class StatusBarManager {
/**
* Expand the settings panel and open a subPanel. If the subpanel is null or does not have a
* corresponding tile, the QS panel is simply expanded
*
* @hide
*/
@UnsupportedAppUsage
public void expandSettingsPanel(@Nullable String subPanel) {
@@ -255,6 +300,7 @@ public class StatusBarManager {
}
}
/** @hide */
@UnsupportedAppUsage
public void setIcon(String slot, int iconId, int iconLevel, String contentDescription) {
try {
@@ -268,6 +314,7 @@ public class StatusBarManager {
}
}
/** @hide */
@UnsupportedAppUsage
public void removeIcon(String slot) {
try {
@@ -280,6 +327,7 @@ public class StatusBarManager {
}
}
/** @hide */
@UnsupportedAppUsage
public void setIconVisibility(String slot, boolean visible) {
try {