Merge "WindowContext: Add @WindowType intdef" into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
76b221c84b
@@ -71,6 +71,7 @@ import android.view.DisplayAdjustments;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewDebug;
|
import android.view.ViewDebug;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
|
import android.view.WindowManager.LayoutParams.WindowType;
|
||||||
import android.view.autofill.AutofillManager.AutofillClient;
|
import android.view.autofill.AutofillManager.AutofillClient;
|
||||||
import android.view.contentcapture.ContentCaptureManager.ContentCaptureClient;
|
import android.view.contentcapture.ContentCaptureManager.ContentCaptureClient;
|
||||||
import android.view.textclassifier.TextClassificationManager;
|
import android.view.textclassifier.TextClassificationManager;
|
||||||
@@ -5820,7 +5821,7 @@ public abstract class Context {
|
|||||||
* @see #WALLPAPER_SERVICE
|
* @see #WALLPAPER_SERVICE
|
||||||
* @throws IllegalArgumentException if token is invalid
|
* @throws IllegalArgumentException if token is invalid
|
||||||
*/
|
*/
|
||||||
public @NonNull Context createWindowContext(int type, @Nullable Bundle options) {
|
public @NonNull Context createWindowContext(@WindowType int type, @Nullable Bundle options) {
|
||||||
throw new RuntimeException("Not implemented. Must override in a subclass.");
|
throw new RuntimeException("Not implemented. Must override in a subclass.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ import android.os.Looper;
|
|||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
import android.view.Display;
|
import android.view.Display;
|
||||||
import android.view.DisplayAdjustments;
|
import android.view.DisplayAdjustments;
|
||||||
|
import android.view.WindowManager.LayoutParams.WindowType;
|
||||||
import android.view.autofill.AutofillManager.AutofillClient;
|
import android.view.autofill.AutofillManager.AutofillClient;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -978,7 +979,7 @@ public class ContextWrapper extends Context {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@NonNull
|
@NonNull
|
||||||
public Context createWindowContext(int type, @Nullable Bundle options) {
|
public Context createWindowContext(@WindowType int type, @Nullable Bundle options) {
|
||||||
return mBase.createWindowContext(type, options);
|
return mBase.createWindowContext(type, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -805,6 +805,7 @@ public interface WindowManager extends ViewManager {
|
|||||||
@ViewDebug.IntToString(from = TYPE_APPLICATION_OVERLAY,
|
@ViewDebug.IntToString(from = TYPE_APPLICATION_OVERLAY,
|
||||||
to = "APPLICATION_OVERLAY")
|
to = "APPLICATION_OVERLAY")
|
||||||
})
|
})
|
||||||
|
@WindowType
|
||||||
public int type;
|
public int type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1243,6 +1244,40 @@ public interface WindowManager extends ViewManager {
|
|||||||
*/
|
*/
|
||||||
public static final int INVALID_WINDOW_TYPE = -1;
|
public static final int INVALID_WINDOW_TYPE = -1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@IntDef(prefix = "TYPE_", value = {
|
||||||
|
TYPE_ACCESSIBILITY_OVERLAY,
|
||||||
|
TYPE_APPLICATION,
|
||||||
|
TYPE_APPLICATION_ATTACHED_DIALOG,
|
||||||
|
TYPE_APPLICATION_MEDIA,
|
||||||
|
TYPE_APPLICATION_OVERLAY,
|
||||||
|
TYPE_APPLICATION_PANEL,
|
||||||
|
TYPE_APPLICATION_STARTING,
|
||||||
|
TYPE_APPLICATION_SUB_PANEL,
|
||||||
|
TYPE_BASE_APPLICATION,
|
||||||
|
TYPE_DRAWN_APPLICATION,
|
||||||
|
TYPE_INPUT_METHOD,
|
||||||
|
TYPE_INPUT_METHOD_DIALOG,
|
||||||
|
TYPE_KEYGUARD,
|
||||||
|
TYPE_KEYGUARD_DIALOG,
|
||||||
|
TYPE_PHONE,
|
||||||
|
TYPE_PRIORITY_PHONE,
|
||||||
|
TYPE_PRIVATE_PRESENTATION,
|
||||||
|
TYPE_SEARCH_BAR,
|
||||||
|
TYPE_STATUS_BAR,
|
||||||
|
TYPE_STATUS_BAR_PANEL,
|
||||||
|
TYPE_SYSTEM_ALERT,
|
||||||
|
TYPE_SYSTEM_DIALOG,
|
||||||
|
TYPE_SYSTEM_ERROR,
|
||||||
|
TYPE_SYSTEM_OVERLAY,
|
||||||
|
TYPE_TOAST,
|
||||||
|
TYPE_WALLPAPER,
|
||||||
|
})
|
||||||
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
|
public @interface WindowType {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if the window type is an alert window.
|
* Return true if the window type is an alert window.
|
||||||
*
|
*
|
||||||
@@ -1250,7 +1285,7 @@ public interface WindowManager extends ViewManager {
|
|||||||
* @return If the window type is an alert window.
|
* @return If the window type is an alert window.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public static boolean isSystemAlertWindowType(int type) {
|
public static boolean isSystemAlertWindowType(@WindowType int type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case TYPE_PHONE:
|
case TYPE_PHONE:
|
||||||
case TYPE_PRIORITY_PHONE:
|
case TYPE_PRIORITY_PHONE:
|
||||||
|
|||||||
Reference in New Issue
Block a user