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

Commit c485677a authored by John Wu's avatar John Wu Committed by Android (Google) Code Review
Browse files

Merge "[Ravenwood] Enable graphics support" into main

parents c374ee63 8b53f465
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ import android.os.UserHandle;
import android.os.UserManager;
import android.ravenwood.annotation.RavenwoodKeep;
import android.ravenwood.annotation.RavenwoodKeepPartialClass;
import android.ravenwood.annotation.RavenwoodKeepWholeClass;
import android.ravenwood.annotation.RavenwoodReplace;
import android.util.AndroidRuntimeException;
import android.util.Log;
@@ -460,6 +461,7 @@ public class Instrumentation {
     * 
     * @param runner The code to run on the main thread.
     */
    @RavenwoodReplace(blockedBy = ActivityThread.class)
    public void runOnMainSync(Runnable runner) {
        validateNotAppThread();
        SyncRunnable sr = new SyncRunnable(runner);
@@ -467,6 +469,13 @@ public class Instrumentation {
        sr.waitForComplete();
    }

    private void runOnMainSync$ravenwood(Runnable runner) {
        validateNotAppThread();
        SyncRunnable sr = new SyncRunnable(runner);
        mInstrContext.getMainExecutor().execute(sr);
        sr.waitForComplete();
    }

    boolean isSdkSandboxAllowedToStartActivities() {
        return Process.isSdkSandbox()
                && mThread != null
@@ -2442,7 +2451,8 @@ public class Instrumentation {
        }
    }

    private final void validateNotAppThread() {
    @RavenwoodKeep
    private void validateNotAppThread() {
        if (Looper.myLooper() == Looper.getMainLooper()) {
            throw new RuntimeException(
                "This method can not be called from the main application thread");
@@ -2586,6 +2596,7 @@ public class Instrumentation {
        }
    }

    @RavenwoodKeepWholeClass
    private static final class SyncRunnable implements Runnable {
        private final Runnable mTarget;
        private boolean mComplete;
+0 −2
Original line number Diff line number Diff line
@@ -482,7 +482,6 @@ public class Resources {
     *
     * @return Typeface The Typeface data associated with the resource.
     */
    @RavenwoodThrow(blockedBy = Typeface.class)
    @NonNull public Typeface getFont(@FontRes int id) throws NotFoundException {
        final TypedValue value = obtainTempTypedValue();
        try {
@@ -507,7 +506,6 @@ public class Resources {
    /**
     * @hide
     */
    @RavenwoodThrow(blockedBy = Typeface.class)
    public void preloadFonts(@ArrayRes int id) {
        final TypedArray array = obtainTypedArray(id);
        try {
+0 −1
Original line number Diff line number Diff line
@@ -1068,7 +1068,6 @@ public class ResourcesImpl {
     * Loads a font from XML or resources stream.
     */
    @Nullable
    @RavenwoodThrow(blockedBy = Typeface.class)
    public Typeface loadFont(Resources wrapper, TypedValue value, int id) {
        if (value.string == null) {
            throw new NotFoundException("Resource \"" + getResourceName(id) + "\" ("
+0 −1
Original line number Diff line number Diff line
@@ -1043,7 +1043,6 @@ public class TypedArray implements AutoCloseable {
     *         not a font resource.
     */
    @Nullable
    @RavenwoodThrow(blockedBy = Typeface.class)
    public Typeface getFont(@StyleableRes int index) {
        if (mRecycled) {
            throw new RuntimeException("Cannot make calls to a recycled instance!");
+1 −0
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@ import java.util.Objects;
 * @hide
 */
@SystemApi
@android.ravenwood.annotation.RavenwoodKeepWholeClass
public final class FontFamilyUpdateRequest {

    /**
Loading