Revert "hwc: Add secure display attribute"

This reverts commit 844848cb90836cc6c337fdae94eaabe5a8f52d3b

Change-Id: If212b3627fc5a9921a832b7bee2a946a60cf4746
diff --git a/libexternal/external.cpp b/libexternal/external.cpp
index d37a915..3e93712 100644
--- a/libexternal/external.cpp
+++ b/libexternal/external.cpp
@@ -587,11 +587,6 @@
         mHwcContext->dpyAttr[HWC_DISPLAY_EXTERNAL].xres = width;
         mHwcContext->dpyAttr[HWC_DISPLAY_EXTERNAL].yres = height;
         mHwcContext->dpyAttr[HWC_DISPLAY_EXTERNAL].mDownScaleMode = false;
-        //FIXME: for now assume HDMI as secure
-        //Will need to read the HDCP status from the driver
-        //and update this accordingly
-        mHwcContext->dpyAttr[HWC_DISPLAY_EXTERNAL].secure = true;
-
         if(!qdutils::MDPVersion::getInstance().is8x26()
                 && mHwcContext->mMDPDownscaleEnabled) {
             int priW = mHwcContext->dpyAttr[HWC_DISPLAY_PRIMARY].xres;
diff --git a/libhwcomposer/hwc.cpp b/libhwcomposer/hwc.cpp
index b085993..4238eaf 100644
--- a/libhwcomposer/hwc.cpp
+++ b/libhwcomposer/hwc.cpp
@@ -822,7 +822,6 @@
         HWC_DISPLAY_HEIGHT,
         HWC_DISPLAY_DPI_X,
         HWC_DISPLAY_DPI_Y,
-        HWC_DISPLAY_SECURE,
         HWC_DISPLAY_NO_ATTRIBUTE,
     };
 
@@ -850,9 +849,6 @@
         case HWC_DISPLAY_DPI_Y:
             values[i] = (int32_t) (ctx->dpyAttr[disp].ydpi*1000.0);
             break;
-        case HWC_DISPLAY_SECURE:
-            values[i] = (int32_t) (ctx->dpyAttr[disp].secure);
-            break;
         default:
             ALOGE("Unknown display attribute %d",
                     attributes[i]);
diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp
index d00f820..41358be 100644
--- a/libhwcomposer/hwc_utils.cpp
+++ b/libhwcomposer/hwc_utils.cpp
@@ -136,7 +136,6 @@
     ctx->dpyAttr[HWC_DISPLAY_PRIMARY].xdpi = xdpi;
     ctx->dpyAttr[HWC_DISPLAY_PRIMARY].ydpi = ydpi;
     ctx->dpyAttr[HWC_DISPLAY_PRIMARY].vsync_period = 1000000000l / fps;
-    ctx->dpyAttr[HWC_DISPLAY_PRIMARY].secure = true;
 
     //Unblank primary on first boot
     if(ioctl(fb_fd, FBIOBLANK,FB_BLANK_UNBLANK) < 0) {
diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h
index 12c6d69..b105e83 100644
--- a/libhwcomposer/hwc_utils.h
+++ b/libhwcomposer/hwc_utils.h
@@ -78,7 +78,6 @@
     uint32_t stride;
     float xdpi;
     float ydpi;
-    bool secure;
     int fd;
     bool connected; //Applies only to pluggable disp.
     //Connected does not mean it ready to use.
diff --git a/libvirtual/virtual.cpp b/libvirtual/virtual.cpp
index 3c8d3c5..bed5e4c 100644
--- a/libvirtual/virtual.cpp
+++ b/libvirtual/virtual.cpp
@@ -84,7 +84,6 @@
     // this to distinguish between an ONLINE and RESUME event.
     mHwcContext->dpyAttr[HWC_DISPLAY_VIRTUAL].xres = 0;
     mHwcContext->dpyAttr[HWC_DISPLAY_VIRTUAL].yres = 0;
-    mHwcContext->dpyAttr[HWC_DISPLAY_VIRTUAL].secure = 0;
     return 0;
 }
 
@@ -171,45 +170,12 @@
     }
 }
 
-bool VirtualDisplay::isSinkSecure() {
-    char sysFsPath[MAX_SYSFS_FILE_PATH];
-    bool ret = false;
-    int fbNum = overlay::Overlay::getInstance()->
-        getFbForDpy(HWC_DISPLAY_VIRTUAL);
-    snprintf(sysFsPath, sizeof(sysFsPath),
-             "/sys/devices/virtual/graphics/fb%d/"
-             "secure", fbNum);
-
-    int fileFd = open(sysFsPath, O_RDONLY, 0);
-    if (fileFd < 0) {
-        ALOGE("In %s: file '%s' not found", __FUNCTION__, sysFsPath);
-        ret = false;
-    } else {
-        char buf;
-        ssize_t err = read(fileFd, &buf, 1);
-        if (err <= 0) {
-            ALOGE("%s: empty file '%s'", __FUNCTION__, sysFsPath);
-        } else {
-            if (buf == '1') {
-                // HDCP Supported: secure
-                ret = true;
-            } else {
-                // NonHDCP: non-secure
-                ret = false;
-            }
-        }
-        close(fileFd);
-    }
-    return ret;
-}
-
 void VirtualDisplay::setAttributes() {
     if(mHwcContext) {
         uint32_t &extW = mHwcContext->dpyAttr[HWC_DISPLAY_VIRTUAL].xres;
         uint32_t &extH = mHwcContext->dpyAttr[HWC_DISPLAY_VIRTUAL].yres;
         uint32_t priW = mHwcContext->dpyAttr[HWC_DISPLAY_PRIMARY].xres;
         uint32_t priH = mHwcContext->dpyAttr[HWC_DISPLAY_PRIMARY].yres;
-        bool &secure = mHwcContext->dpyAttr[HWC_DISPLAY_VIRTUAL].secure;
 
         // Dynamic Resolution Change depends on MDP downscaling.
         // MDP downscale property will be ignored to exercise DRC use case.
@@ -231,11 +197,6 @@
         }
         mHwcContext->dpyAttr[HWC_DISPLAY_VIRTUAL].vsync_period =
                 1000000000l /60;
-        if(mHwcContext->mVirtualonExtActive) {
-            //For WFD using V4l2 read the sysfs node to determine
-            //if the sink is secure
-            secure = isSinkSecure();
-        }
         ALOGD_IF(DEBUG,"%s: Setting Virtual Attr: res(%d x %d)",__FUNCTION__,
                  mVInfo.xres, mVInfo.yres);
     }
diff --git a/libvirtual/virtual.h b/libvirtual/virtual.h
index 4f9d7ab..a6aec40 100644
--- a/libvirtual/virtual.h
+++ b/libvirtual/virtual.h
@@ -51,7 +51,6 @@
 private:
     bool openFrameBuffer();
     bool closeFrameBuffer();
-    bool isSinkSecure();
     void setAttributes();
     void initResolution(uint32_t &extW, uint32_t &extH);
     void setToPrimary(uint32_t maxArea, uint32_t priW, uint32_t priH,