sde: Add support to set the display mode of the primary display
The display mode for the primary display can be set to either
command or video mode if the target supports this.
Syntax:
adb shell "service call display.qservice 29 i32 <DISPLAY_MODE>"
DISPLAY_MODE = 1 -> Video
2 -> Command
Change-Id: Iadf4beea8959a90a0b18f8286a094bbbdf18358a
diff --git a/libqdutils/display_config.cpp b/libqdutils/display_config.cpp
index 40b1ef7..350192d 100644
--- a/libqdutils/display_config.cpp
+++ b/libqdutils/display_config.cpp
@@ -262,6 +262,24 @@
return dpyattr;
}
+int setPanelMode(int mode) {
+ status_t err = (status_t) FAILED_TRANSACTION;
+ sp<IQService> binder = getBinder();
+ if(binder != NULL) {
+ Parcel inParcel, outParcel;
+ inParcel.writeInt32(mode);
+ err = binder->dispatch(IQService::SET_DISPLAY_MODE,
+ &inParcel, &outParcel);
+ if(!err) {
+ ALOGI("%s() Successfully set the display mode to %d", __FUNCTION__,
+ mode);
+ } else {
+ ALOGE("%s() failed with err %d", __FUNCTION__, err);
+ }
+ }
+ return err;
+}
+
//=============================================================================
// The functions/methods below run in the context of HWC and
// are called in response to binder calls from clients