arc-setup: HACK for setting display panel orientation for dedede.bugzzy.
BUG=b:210802730, b:211563458
TEST=getprop ro.surface_flinger.primary_display_orientation
Change-Id: I4b9e60513caf0729f81493a7786a40eeec72031b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/3390388
Reviewed-by: Yusuke Sato <yusukes@chromium.org>
Tested-by: Edward Doan <edoan@chromium.org>
Commit-Queue: Kazuhiro Inaba <kinaba@chromium.org>
diff --git a/arc/setup/arc_property_util.cc b/arc/setup/arc_property_util.cc
index b863752..3cb317b 100644
--- a/arc/setup/arc_property_util.cc
+++ b/arc/setup/arc_property_util.cc
@@ -47,6 +47,8 @@
constexpr char kAbilist64PropertyExpected[] = "x86_64";
constexpr char kAbilist64PropertyReplacement[] = "x86_64,arm64-v8a";
constexpr char kDalvikVmIsaArm64[] = "ro.dalvik.vm.isa.arm64=x86_64";
+constexpr char kPrimaryDisplayOrientationPropertyTemplate[] =
+ "ro.surface_flinger.primary_display_orientation=ORIENTATION_%d";
// Prefix of Android property to enable debugging features.
constexpr char kDebuggablePropertyPrefix[] = "ro.debuggable=";
@@ -281,6 +283,24 @@
std::string oem_key_property = ComputeOEMKey(config, property);
new_properties +=
std::string(kOEMKey1PropertyPrefix) + oem_key_property + "\n";
+
+ // TODO(b/211563458): Remove this super dirty hack ASAP.
+ //
+ // The only customization method we currently have for this property
+ // is to add it to PRODUCT_PROPERTY_OVERRIDES in board_specific_setup.
+ // It is a build time, *per-board* configuration.
+ // However, a new model in board="dedede" family turned out to require
+ // a different values from other models in the same family (b/210802730).
+ //
+ // To work around the lack of per-model configuration, the below hack
+ // directly embeds the mapping from model name here as a short-term
+ // solution. The right approach should be to dynamically pass the
+ // panel orientation from Chrome down to arc-setup.
+ if (property == "bugzzy") {
+ new_properties +=
+ base::StringPrintf(kPrimaryDisplayOrientationPropertyTemplate, 90) +
+ "\n";
+ }
}
}