blob: 58a71e1db88dcdd88b9ba43659f0891d9ff533f7 [file] [log] [blame]
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.base.compat;
import android.annotation.TargetApi;
import android.content.res.Configuration;
import android.os.Build;
import android.view.Display;
import org.chromium.base.annotations.DoNotInline;
/**
* Utility class to use new APIs that were added in O (API level 26). These need to exist in a
* separate class so that Android framework can successfully verify classes without
* encountering the new APIs.
*/
@DoNotInline
@TargetApi(Build.VERSION_CODES.O)
public final class ApiHelperForO {
private ApiHelperForO() {}
/** See {@link Display#isWideColorGamut() }. */
public static boolean isWideColorGamut(Display display) {
return display.isWideColorGamut();
}
/** See {@link Configuration#isScreenWideColorGamut() }. */
public static boolean isScreenWideColorGamut(Configuration configuration) {
return configuration.isScreenWideColorGamut();
}
}