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

Commit c4bd05b4 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5828070 from 23cdf1a4 to qt-qpr1-release

Change-Id: I4978078e2b34ad79d57125c3201e028a8939e4ba
parents f9220151 23cdf1a4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -664,7 +664,7 @@ int64_t WorkDirectory::make_timestamp_ns_locked() {
            nanosleep(&spec, nullptr);
        }
        clock_gettime(CLOCK_REALTIME, &spec);
        timestampNs = (spec.tv_sec) * 1000 + spec.tv_nsec;
        timestampNs = int64_t(spec.tv_sec) * 1000 + spec.tv_nsec;
    } while (file_exists_locked(timestampNs));
    return timestampNs;
}
+36 −0
Original line number Diff line number Diff line
@@ -820,4 +820,40 @@ public final class DisplayManager {
         */
        void onDisplayChanged(int displayId);
    }

    /**
     * Interface for accessing keys belonging to {@link
     * android.provider.DeviceConfig#NAMESPACE_DISPLAY_MANAGER}.
     * @hide
     */
    public interface DeviceConfig {

        /**
         * Key for accessing the 60 hz only regions.
         *
         * @see android.provider.DeviceConfig#NAMESPACE_DISPLAY_MANAGER
         * @see android.R.array#config_brightnessThresholdsOfPeakRefreshRate
         * @hide
         */
        String KEY_PEAK_REFRESH_RATE_BRIGHTNESS_THRESHOLDS =
                "peak_refresh_rate_brightness_thresholds";

        /**
         * Key for accessing the 60 hz only regions.
         *
         * @see android.provider.DeviceConfig#NAMESPACE_DISPLAY_MANAGER
         * @see android.R.array#config_brightnessThresholdsOfPeakRefreshRate
         * @hide
         */
        String KEY_PEAK_REFRESH_RATE_AMBIENT_THRESHOLDS = "peak_refresh_rate_ambient_thresholds";

        /**
         * Key for default peak refresh rate
         *
         * @see android.provider.DeviceConfig#NAMESPACE_DISPLAY_MANAGER
         * @see android.R.integer#config_defaultPeakRefreshRate
         * @hide
         */
        String KEY_PEAK_REFRESH_RATE_DEFAULT = "peak_refresh_rate_default";
    }
}
+21 −5
Original line number Diff line number Diff line
@@ -67,6 +67,8 @@ public class GraphicsEnvironment {
    private static final String PROPERTY_GFX_DRIVER_PRERELEASE = "ro.gfx.driver.1";
    private static final String PROPERTY_GFX_DRIVER_BUILD_TIME = "ro.gfx.driver_build_time";
    private static final String METADATA_DRIVER_BUILD_TIME = "com.android.gamedriver.build_time";
    private static final String METADATA_DEVELOPER_DRIVER_ENABLE =
            "com.android.graphics.developerdriver.enable";
    private static final String ANGLE_RULES_FILE = "a4a_rules.json";
    private static final String ANGLE_TEMP_RULES = "debug.angle.rules";
    private static final String ACTION_ANGLE_FOR_ANDROID = "android.app.action.ANGLE_FOR_ANDROID";
@@ -691,7 +693,8 @@ public class GraphicsEnvironment {
    /**
     * Return the driver package name to use. Return null for system driver.
     */
    private static String chooseDriverInternal(Context context, Bundle coreSettings) {
    private static String chooseDriverInternal(
            Context context, Bundle coreSettings, PackageManager pm, String packageName) {
        final String gameDriver = SystemProperties.get(PROPERTY_GFX_DRIVER);
        final boolean hasGameDriver = gameDriver != null && !gameDriver.isEmpty();

@@ -706,12 +709,24 @@ public class GraphicsEnvironment {
        // To minimize risk of driver updates crippling the device beyond user repair, never use an
        // updated driver for privileged or non-updated system apps. Presumably pre-installed apps
        // were tested thoroughly with the pre-installed driver.
        final ApplicationInfo ai = context.getApplicationInfo();
        ApplicationInfo ai;
        try {
            // Get the ApplicationInfo from PackageManager so that metadata fields present.
            ai = pm.getApplicationInfo(packageName, PackageManager.GET_META_DATA);
        } catch (PackageManager.NameNotFoundException e) {
            // Unlikely to fail for applications, but in case of failure, fall back to use the
            // ApplicationInfo from context directly.
            ai = context.getApplicationInfo();
        }
        if (ai.isPrivilegedApp() || (ai.isSystemApp() && !ai.isUpdatedSystemApp())) {
            if (DEBUG) Log.v(TAG, "Ignoring driver package for privileged/non-updated system app.");
            return null;
        }

        final boolean enablePrereleaseDriver =
                (ai.metaData != null && ai.metaData.getBoolean(METADATA_DEVELOPER_DRIVER_ENABLE))
                || getCanLoadSystemLibraries() == 1;

        // Priority for Game Driver settings global on confliction (Higher priority comes first):
        // 1. GAME_DRIVER_ALL_APPS
        // 2. GAME_DRIVER_OPT_OUT_APPS
@@ -728,7 +743,7 @@ public class GraphicsEnvironment {
                return hasGameDriver ? gameDriver : null;
            case GAME_DRIVER_GLOBAL_OPT_IN_PRERELEASE_DRIVER:
                if (DEBUG) Log.v(TAG, "All apps opt in to use prerelease driver.");
                return hasPrereleaseDriver ? prereleaseDriver : null;
                return hasPrereleaseDriver && enablePrereleaseDriver ? prereleaseDriver : null;
            case GAME_DRIVER_GLOBAL_OPT_IN_DEFAULT:
            default:
                break;
@@ -745,7 +760,7 @@ public class GraphicsEnvironment {
                    null, coreSettings, Settings.Global.GAME_DRIVER_PRERELEASE_OPT_IN_APPS)
                        .contains(appPackageName)) {
            if (DEBUG) Log.v(TAG, "App opts in for prerelease Game Driver.");
            return hasPrereleaseDriver ? prereleaseDriver : null;
            return hasPrereleaseDriver && enablePrereleaseDriver ? prereleaseDriver : null;
        }

        // Early return here since the rest logic is only for Game Driver.
@@ -783,7 +798,8 @@ public class GraphicsEnvironment {
     */
    private static boolean chooseDriver(
            Context context, Bundle coreSettings, PackageManager pm, String packageName) {
        final String driverPackageName = chooseDriverInternal(context, coreSettings);
        final String driverPackageName = chooseDriverInternal(context, coreSettings, pm,
                packageName);
        if (driverPackageName == null) {
            return false;
        }
+8 −0
Original line number Diff line number Diff line
@@ -135,6 +135,14 @@ public final class DeviceConfig {
    @SystemApi
    public static final String NAMESPACE_DEX_BOOT = "dex_boot";

    /**
     * Namespace for display manager related features. The names to access the properties in this
     * namespace should be defined in {@link android.hardware.display.DisplayManager}.
     *
     * @hide
     */
    public static final String NAMESPACE_DISPLAY_MANAGER = "display_manager";

    /**
     * Namespace for all Game Driver features.
     *
+4 −14
Original line number Diff line number Diff line
@@ -51,7 +51,6 @@ import android.view.textclassifier.TextSelection;

import com.android.internal.util.Preconditions;

import java.lang.ref.WeakReference;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

@@ -431,23 +430,18 @@ public abstract class TextClassifierService extends Service {
     * Forwards the callback result to a wrapped binder callback.
     */
    private static final class ProxyCallback<T extends Parcelable> implements Callback<T> {
        private WeakReference<ITextClassifierCallback> mTextClassifierCallback;
        private ITextClassifierCallback mTextClassifierCallback;

        private ProxyCallback(ITextClassifierCallback textClassifierCallback) {
            mTextClassifierCallback =
                    new WeakReference<>(Preconditions.checkNotNull(textClassifierCallback));
            mTextClassifierCallback = Preconditions.checkNotNull(textClassifierCallback);
        }

        @Override
        public void onSuccess(T result) {
            ITextClassifierCallback callback = mTextClassifierCallback.get();
            if (callback == null) {
                return;
            }
            try {
                Bundle bundle = new Bundle(1);
                bundle.putParcelable(KEY_RESULT, result);
                callback.onSuccess(bundle);
                mTextClassifierCallback.onSuccess(bundle);
            } catch (RemoteException e) {
                Slog.d(LOG_TAG, "Error calling callback");
            }
@@ -455,12 +449,8 @@ public abstract class TextClassifierService extends Service {

        @Override
        public void onFailure(CharSequence error) {
            ITextClassifierCallback callback = mTextClassifierCallback.get();
            if (callback == null) {
                return;
            }
            try {
                callback.onFailure();
                mTextClassifierCallback.onFailure();
            } catch (RemoteException e) {
                Slog.d(LOG_TAG, "Error calling callback");
            }
Loading