Merge "API Review: Add @IntDef and other annotations to Menu Item flags." into nyc-dev

am: 9a5f9c2

* commit '9a5f9c208752bdb8c14fd2f2ef88408442f49c84':
  API Review: Add @IntDef and other annotations to Menu Item flags.

Change-Id: Ie571f6cb9dc496349aeb2b56e2648fb549e2d3ad
This commit is contained in:
Hui Shu
2016-04-27 17:56:55 +00:00
committed by android-build-merger

View File

@@ -16,9 +16,15 @@
package android.webkit;
import android.annotation.IntDef;
import android.annotation.SystemApi;
import android.content.Context;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Manages settings state for a WebView. When a WebView is first created, it
* obtains a set of default settings. These default settings will be returned
@@ -1361,19 +1367,33 @@ public abstract class WebSettings {
*/
public abstract boolean getOffscreenPreRaster();
/**
* @hide
*/
@IntDef(flag = true,
value = {
MENU_ITEM_NONE,
MENU_ITEM_SHARE,
MENU_ITEM_WEB_SEARCH,
MENU_ITEM_PROCESS_TEXT
})
@Retention(RetentionPolicy.SOURCE)
@Target({ElementType.PARAMETER, ElementType.METHOD})
private @interface MenuItemFlags {}
/**
* Disables the action mode menu items according to {@code menuItems} flag.
* @param menuItems an integer field flag for the menu items to be disabled.
*/
public abstract void setDisabledActionModeMenuItems(int menuItems);
public abstract void setDisabledActionModeMenuItems(@MenuItemFlags int menuItems);
/**
* Gets the action mode menu items that are disabled, expressed in an integer field flag.
* The default value is {@link #MENU_ITEM_NONE}
*
* @return all the disabled menu item flags combined with OR.
* @return all the disabled menu item flags combined with bitwise OR.
*/
public abstract int getDisabledActionModeMenuItems();
public abstract @MenuItemFlags int getDisabledActionModeMenuItems();
/**
* Used with {@link #setDisabledActionModeMenuItems}.