Modify the edge detection area

Due to Mali-4xx only support fp16 in fragment shader.
Modify border width to 2, and change the detetion area.

Bug: 131397880
Test: testDialogProducer pass
Change-Id: Ia222cb89c8a42837a2e022f7f82d0d7f7c3d115a
Signed-off-by: Yao Rui <rui.yao@mediatek.com>
diff --git a/tests/tests/view/src/android/view/cts/PixelCopyTest.java b/tests/tests/view/src/android/view/cts/PixelCopyTest.java
index ab24972..6f14aa9 100644
--- a/tests/tests/view/src/android/view/cts/PixelCopyTest.java
+++ b/tests/tests/view/src/android/view/cts/PixelCopyTest.java
@@ -757,21 +757,21 @@
     private void assertBitmapEdgeColor(Bitmap bitmap, int edgeColor) {
         // Just quickly sample a few pixels on the edge and assert
         // they are edge color, then assert that just inside the edge is a different color
-        assertBitmapColor("Top edge", bitmap, edgeColor, bitmap.getWidth() / 2, 0);
-        assertBitmapNotColor("Top edge", bitmap, edgeColor, bitmap.getWidth() / 2, 1);
+        assertBitmapColor("Top edge", bitmap, edgeColor, bitmap.getWidth() / 2, 1);
+        assertBitmapNotColor("Top edge", bitmap, edgeColor, bitmap.getWidth() / 2, 2);
 
-        assertBitmapColor("Left edge", bitmap, edgeColor, 0, bitmap.getHeight() / 2);
-        assertBitmapNotColor("Left edge", bitmap, edgeColor, 1, bitmap.getHeight() / 2);
+        assertBitmapColor("Left edge", bitmap, edgeColor, 1, bitmap.getHeight() / 2);
+        assertBitmapNotColor("Left edge", bitmap, edgeColor, 2, bitmap.getHeight() / 2);
 
         assertBitmapColor("Bottom edge", bitmap, edgeColor,
-                bitmap.getWidth() / 2, bitmap.getHeight() - 1);
-        assertBitmapNotColor("Bottom edge", bitmap, edgeColor,
                 bitmap.getWidth() / 2, bitmap.getHeight() - 2);
+        assertBitmapNotColor("Bottom edge", bitmap, edgeColor,
+                bitmap.getWidth() / 2, bitmap.getHeight() - 3);
 
         assertBitmapColor("Right edge", bitmap, edgeColor,
-                bitmap.getWidth() - 1, bitmap.getHeight() / 2);
-        assertBitmapNotColor("Right edge", bitmap, edgeColor,
                 bitmap.getWidth() - 2, bitmap.getHeight() / 2);
+        assertBitmapNotColor("Right edge", bitmap, edgeColor,
+                bitmap.getWidth() - 3, bitmap.getHeight() / 2);
     }
 
     private boolean pixelsAreSame(int ideal, int given, int threshold) {
diff --git a/tests/tests/view/src/android/view/cts/PixelCopyViewProducerActivity.java b/tests/tests/view/src/android/view/cts/PixelCopyViewProducerActivity.java
index 054de45..07aa4fd 100644
--- a/tests/tests/view/src/android/view/cts/PixelCopyViewProducerActivity.java
+++ b/tests/tests/view/src/android/view/cts/PixelCopyViewProducerActivity.java
@@ -157,22 +157,23 @@
         protected void onDraw(Canvas canvas) {
             int cx = getWidth() / 2;
             int cy = getHeight() / 2;
+            final int BORDER_WIDTH = 2;
 
             canvas.drawColor(Color.YELLOW);
 
-            mRect.set(1, 1, cx, cy);
+            mRect.set(BORDER_WIDTH, BORDER_WIDTH, cx, cy);
             mPaint.setColor(Color.RED);
             canvas.drawRect(mRect, mPaint);
 
-            mRect.set(cx, 1, getWidth() - 1, cy);
+            mRect.set(cx, BORDER_WIDTH, getWidth() - BORDER_WIDTH, cy);
             mPaint.setColor(Color.GREEN);
             canvas.drawRect(mRect, mPaint);
 
-            mRect.set(1, cy, cx, getHeight() - 1);
+            mRect.set(BORDER_WIDTH, cy, cx, getHeight() - BORDER_WIDTH);
             mPaint.setColor(Color.BLUE);
             canvas.drawRect(mRect, mPaint);
 
-            mRect.set(cx, cy, getWidth() - 1, getHeight() - 1);
+            mRect.set(cx, cy, getWidth() - BORDER_WIDTH, getHeight() - BORDER_WIDTH);
             mPaint.setColor(Color.BLACK);
             canvas.drawRect(mRect, mPaint);
         }