Merge "Use ro.boot.qemu to check if the device is an emulator" am: 62d82e0b33 am: 4ba8fde9ba
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1625662 Change-Id: I039b17ca0bf956ee3d86c72edcbf81957938ae4b
This commit is contained in:
@@ -138,7 +138,7 @@ public class Build {
|
|||||||
*/
|
*/
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
@TestApi
|
@TestApi
|
||||||
public static final boolean IS_EMULATOR = getString("ro.kernel.qemu").equals("1");
|
public static final boolean IS_EMULATOR = getString("ro.boot.qemu").equals("1");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A hardware serial number, if available. Alphanumeric only, case-insensitive.
|
* A hardware serial number, if available. Alphanumeric only, case-insensitive.
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ bool Properties::load() {
|
|||||||
SkAndroidFrameworkTraceUtil::setEnableTracing(
|
SkAndroidFrameworkTraceUtil::setEnableTracing(
|
||||||
base::GetBoolProperty(PROPERTY_SKIA_ATRACE_ENABLED, false));
|
base::GetBoolProperty(PROPERTY_SKIA_ATRACE_ENABLED, false));
|
||||||
|
|
||||||
runningInEmulator = base::GetBoolProperty(PROPERTY_QEMU_KERNEL, false);
|
runningInEmulator = base::GetBoolProperty(PROPERTY_IS_EMULATOR, false);
|
||||||
|
|
||||||
defaultRenderAhead = std::max(-1, std::min(2, base::GetIntProperty(PROPERTY_RENDERAHEAD,
|
defaultRenderAhead = std::max(-1, std::min(2, base::GetIntProperty(PROPERTY_RENDERAHEAD,
|
||||||
render_ahead().value_or(0))));
|
render_ahead().value_or(0))));
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ enum DebugLevel {
|
|||||||
/**
|
/**
|
||||||
* Property for whether this is running in the emulator.
|
* Property for whether this is running in the emulator.
|
||||||
*/
|
*/
|
||||||
#define PROPERTY_QEMU_KERNEL "ro.kernel.qemu"
|
#define PROPERTY_IS_EMULATOR "ro.boot.qemu"
|
||||||
|
|
||||||
#define PROPERTY_RENDERAHEAD "debug.hwui.render_ahead"
|
#define PROPERTY_RENDERAHEAD "debug.hwui.render_ahead"
|
||||||
|
|
||||||
|
|||||||
@@ -2445,8 +2445,8 @@ class DatabaseHelper extends SQLiteOpenHelper {
|
|||||||
R.bool.def_auto_time_zone); // Sync timezone to NITZ
|
R.bool.def_auto_time_zone); // Sync timezone to NITZ
|
||||||
|
|
||||||
loadSetting(stmt, Settings.Global.STAY_ON_WHILE_PLUGGED_IN,
|
loadSetting(stmt, Settings.Global.STAY_ON_WHILE_PLUGGED_IN,
|
||||||
("1".equals(SystemProperties.get("ro.kernel.qemu")) ||
|
("1".equals(SystemProperties.get("ro.boot.qemu"))
|
||||||
res.getBoolean(R.bool.def_stay_on_while_plugged_in))
|
|| res.getBoolean(R.bool.def_stay_on_while_plugged_in))
|
||||||
? 1 : 0);
|
? 1 : 0);
|
||||||
|
|
||||||
loadIntegerSetting(stmt, Settings.Global.WIFI_SLEEP_POLICY,
|
loadIntegerSetting(stmt, Settings.Global.WIFI_SLEEP_POLICY,
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ public class ClipboardService extends SystemService {
|
|||||||
|
|
||||||
private static final String TAG = "ClipboardService";
|
private static final String TAG = "ClipboardService";
|
||||||
private static final boolean IS_EMULATOR =
|
private static final boolean IS_EMULATOR =
|
||||||
SystemProperties.getBoolean("ro.kernel.qemu", false);
|
SystemProperties.getBoolean("ro.boot.qemu", false);
|
||||||
|
|
||||||
private final ActivityManagerInternal mAmInternal;
|
private final ActivityManagerInternal mAmInternal;
|
||||||
private final IUriGrantsManager mUgm;
|
private final IUriGrantsManager mUgm;
|
||||||
|
|||||||
@@ -1127,7 +1127,7 @@ public final class SystemServer {
|
|||||||
false);
|
false);
|
||||||
boolean enableLeftyService = SystemProperties.getBoolean("config.enable_lefty", false);
|
boolean enableLeftyService = SystemProperties.getBoolean("config.enable_lefty", false);
|
||||||
|
|
||||||
boolean isEmulator = SystemProperties.get("ro.kernel.qemu").equals("1");
|
boolean isEmulator = SystemProperties.get("ro.boot.qemu").equals("1");
|
||||||
|
|
||||||
boolean isWatch = context.getPackageManager().hasSystemFeature(
|
boolean isWatch = context.getPackageManager().hasSystemFeature(
|
||||||
PackageManager.FEATURE_WATCH);
|
PackageManager.FEATURE_WATCH);
|
||||||
|
|||||||
Reference in New Issue
Block a user