Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 351a4ce3 authored by Charles Chen's avatar Charles Chen Committed by Android (Google) Code Review
Browse files

Merge "Release Context#isUiContext(Context)"

parents c5be76c2 853c0f31
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -10158,6 +10158,7 @@ package android.content {
    method public abstract void grantUriPermission(String, android.net.Uri, int);
    method public abstract boolean isDeviceProtectedStorage();
    method public boolean isRestricted();
    method public static boolean isUiContext(@NonNull android.content.Context);
    method public abstract boolean moveDatabaseFrom(android.content.Context, String);
    method public abstract boolean moveSharedPreferencesFrom(android.content.Context, String);
    method @NonNull public final android.content.res.TypedArray obtainStyledAttributes(@NonNull @StyleableRes int[]);
+15 −0
Original line number Diff line number Diff line
@@ -6285,4 +6285,19 @@ public abstract class Context {
    public boolean isUiContext() {
        throw new RuntimeException("Not implemented. Must override in a subclass.");
    }

    /**
     * Returns {@code true} if the context is a UI context which can access UI components such as
     * {@link WindowManager}, {@link android.view.LayoutInflater LayoutInflater} or
     * {@link android.app.WallpaperManager WallpaperManager}.
     * <p>
     * Examples of UI contexts are
     * an {@link android.app.Activity Activity}, a context created from
     * {@link #createWindowContext(int, Bundle)} or
     * {@link android.inputmethodservice.InputMethodService InputMethodService}
     * </p>
     */
    public static boolean isUiContext(@NonNull Context context) {
        return context.isUiContext();
    }
}