display: Add HDMI support in APIs exposed by display.

- Remove hardcoded primary display from getActiveConfig() and
  getDisplayAttributes() for video decoder to query the secondary
  display resolution.
- Add permission for Video decoder UID to call these APIs.

Change-Id: I1ec1e19dda76f2e0e085c52450449bdc13a739fa
CRs-Fixed: 1100704
This commit is contained in:
Namit Solanki
2016-11-02 15:53:43 +05:30
committed by Gerrit - the friendly Code Review server
parent 766ae8675e
commit 03d567945c
2 changed files with 6 additions and 5 deletions

View File

@@ -198,12 +198,12 @@ int getConfigCount(int /*dpy*/) {
return numConfigs; return numConfigs;
} }
int getActiveConfig(int /*dpy*/) { int getActiveConfig(int dpy) {
int configIndex = -1; int configIndex = -1;
sp<IQService> binder = getBinder(); sp<IQService> binder = getBinder();
if(binder != NULL) { if(binder != NULL) {
Parcel inParcel, outParcel; Parcel inParcel, outParcel;
inParcel.writeInt32(DISPLAY_PRIMARY); inParcel.writeInt32(dpy);
status_t err = binder->dispatch(IQService::GET_ACTIVE_CONFIG, status_t err = binder->dispatch(IQService::GET_ACTIVE_CONFIG,
&inParcel, &outParcel); &inParcel, &outParcel);
if(!err) { if(!err) {
@@ -236,13 +236,13 @@ int setActiveConfig(int configIndex, int /*dpy*/) {
return err; return err;
} }
DisplayAttributes getDisplayAttributes(int configIndex, int /*dpy*/) { DisplayAttributes getDisplayAttributes(int configIndex, int dpy) {
DisplayAttributes dpyattr = {}; DisplayAttributes dpyattr = {};
sp<IQService> binder = getBinder(); sp<IQService> binder = getBinder();
if(binder != NULL) { if(binder != NULL) {
Parcel inParcel, outParcel; Parcel inParcel, outParcel;
inParcel.writeInt32(configIndex); inParcel.writeInt32(configIndex);
inParcel.writeInt32(DISPLAY_PRIMARY); inParcel.writeInt32(dpy);
status_t err = binder->dispatch( status_t err = binder->dispatch(
IQService::GET_DISPLAY_ATTRIBUTES_FOR_CONFIG, &inParcel, IQService::GET_DISPLAY_ATTRIBUTES_FOR_CONFIG, &inParcel,
&outParcel); &outParcel);

View File

@@ -93,7 +93,8 @@ status_t BnQService::onTransact(
callerUid == AID_ROOT || callerUid == AID_ROOT ||
callerUid == AID_CAMERASERVER || callerUid == AID_CAMERASERVER ||
callerUid == AID_AUDIO || callerUid == AID_AUDIO ||
callerUid == AID_SYSTEM); callerUid == AID_SYSTEM ||
callerUid == AID_MEDIA_CODEC);
if (code == CONNECT_HWC_CLIENT) { if (code == CONNECT_HWC_CLIENT) {
CHECK_INTERFACE(IQService, data, reply); CHECK_INTERFACE(IQService, data, reply);