docstring_tokens
stringlengths 18
16.9k
| code_tokens
stringlengths 75
1.81M
| html_url
stringlengths 74
116
| file_name
stringlengths 3
311
|
---|---|---|---|
keep keep replace replace replace replace replace keep replace
|
<mask> canvas.drawRect(left, topOfTheBottom, right, bottom, PAINT);
<mask> }
<mask> }
<mask>
<mask> // draw left
<mask> if (Color.alpha(leftColor) != 0 && leftWidth != 0) {
<mask> PAINT.setColor(leftColor);
<mask>
<mask> if (isDrawPathRequired) {
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove } else {
canvas.drawRect(left, topOfTheBottom, right, bottom, PAINT);
</s> add </s> remove }
// draw bottom
if (Color.alpha(bottomColor) != 0 && bottomWidth != 0) {
PAINT.setColor(bottomColor);
</s> add </s> remove }
// draw right
if (Color.alpha(rightColor) != 0 && rightWidth != 0) {
PAINT.setColor(rightColor);
</s> add </s> remove } else {
canvas.drawRect(left, top, right, bottomOfTheTop, PAINT);
</s> add </s> remove } else {
canvas.drawRect(left, bottomOfTheTop, rightOfTheLeft, topOfTheBottom, PAINT);
</s> add
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/flat/DrawBorder.java
|
keep add keep keep keep keep
|
<mask> PAINT.setColor(leftColor);
<mask> updatePathForLeftBorder(
<mask> top,
<mask> topInset,
<mask> bottom,
<mask> bottomInset,
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove bottomOfTheTop,
</s> add topInset, </s> remove if (isDrawPathRequired) {
</s> add // Draw left.
if (borderLeft != 0 && Color.alpha(leftColor) != 0) {
PAINT.setColor(leftColor); </s> remove topOfTheBottom,
</s> add bottomInset, </s> add mPathForBorder, </s> remove }
// draw left
if (Color.alpha(leftColor) != 0 && leftWidth != 0) {
PAINT.setColor(leftColor);
</s> add </s> remove float bottomOfTheTop,
</s> add float topInset,
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/flat/DrawBorder.java
|
keep replace keep replace keep keep
|
<mask> top,
<mask> bottomOfTheTop,
<mask> bottom,
<mask> topOfTheBottom,
<mask> left,
<mask> rightOfTheLeft);
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove rightOfTheLeft);
</s> add leftInset); </s> remove private void updatePathForLeftBorder(
</s> add private static void updatePathForLeftBorder(
Path path, </s> remove float bottomOfTheTop,
</s> add float topInset, </s> remove } else {
canvas.drawRect(left, bottomOfTheTop, rightOfTheLeft, topOfTheBottom, PAINT);
</s> add </s> remove topOfTheBottom,
</s> add bottomInset,
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/flat/DrawBorder.java
|
keep replace keep replace replace keep keep keep
|
<mask> left,
<mask> rightOfTheLeft);
<mask> canvas.drawPath(mPathForBorder, PAINT);
<mask> } else {
<mask> canvas.drawRect(left, bottomOfTheTop, rightOfTheLeft, topOfTheBottom, PAINT);
<mask> }
<mask> }
<mask>
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove topOfTheBottom,
</s> add bottomInset, </s> remove leftOfTheRight);
</s> add rightInset); </s> remove leftOfTheRight);
</s> add rightInset); </s> remove rightOfTheLeft,
</s> add leftInset, </s> remove rightOfTheLeft,
</s> add leftInset,
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/flat/DrawBorder.java
|
keep keep replace replace replace replace replace keep replace keep keep keep keep
|
<mask> canvas.drawRect(left, bottomOfTheTop, rightOfTheLeft, topOfTheBottom, PAINT);
<mask> }
<mask> }
<mask>
<mask> // draw right
<mask> if (Color.alpha(rightColor) != 0 && rightWidth != 0) {
<mask> PAINT.setColor(rightColor);
<mask>
<mask> if (isDrawPathRequired) {
<mask> updatePathForRightBorder(
<mask> top,
<mask> bottomOfTheTop,
<mask> bottom,
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove } else {
canvas.drawRect(left, bottomOfTheTop, rightOfTheLeft, topOfTheBottom, PAINT);
</s> add </s> remove }
// draw left
if (Color.alpha(leftColor) != 0 && leftWidth != 0) {
PAINT.setColor(leftColor);
</s> add </s> remove }
// draw bottom
if (Color.alpha(bottomColor) != 0 && bottomWidth != 0) {
PAINT.setColor(bottomColor);
</s> add </s> remove } else {
canvas.drawRect(left, top, right, bottomOfTheTop, PAINT);
</s> add </s> remove } else {
canvas.drawRect(left, topOfTheBottom, right, bottom, PAINT);
</s> add
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/flat/DrawBorder.java
|
keep keep keep add keep keep keep keep keep
|
<mask> // Draw right.
<mask> if (borderRight != 0 && Color.alpha(rightColor) != 0) {
<mask> PAINT.setColor(rightColor);
<mask> updatePathForRightBorder(
<mask> top,
<mask> topInset,
<mask> bottom,
<mask> bottomInset,
<mask> right,
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove if (isDrawPathRequired) {
</s> add // Draw right.
if (borderRight != 0 && Color.alpha(rightColor) != 0) {
PAINT.setColor(rightColor); </s> add mPathForBorder, </s> remove if (isDrawPathRequired) {
</s> add // Draw left.
if (borderLeft != 0 && Color.alpha(leftColor) != 0) {
PAINT.setColor(leftColor); </s> remove }
// draw right
if (Color.alpha(rightColor) != 0 && rightWidth != 0) {
PAINT.setColor(rightColor);
</s> add </s> remove if (isDrawPathRequired) {
</s> add // Draw top.
if (borderTop != 0 && Color.alpha(topColor) != 0) {
PAINT.setColor(topColor); </s> remove if (isDrawPathRequired) {
</s> add // Draw bottom.
if (borderBottom != 0 && Color.alpha(bottomColor) != 0) {
PAINT.setColor(bottomColor);
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/flat/DrawBorder.java
|
keep keep replace keep replace keep keep
|
<mask> updatePathForRightBorder(
<mask> top,
<mask> bottomOfTheTop,
<mask> bottom,
<mask> topOfTheBottom,
<mask> right,
<mask> leftOfTheRight);
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove private void updatePathForRightBorder(
</s> add private static void updatePathForRightBorder(
Path path, </s> remove leftOfTheRight);
</s> add rightInset); </s> remove float bottomOfTheTop,
</s> add float topInset, </s> remove float topOfTheBottom,
</s> add float bottomInset, </s> remove rightOfTheLeft,
</s> add leftInset,
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/flat/DrawBorder.java
|
keep keep keep keep replace keep replace replace keep keep keep keep
|
<mask> bottomOfTheTop,
<mask> bottom,
<mask> topOfTheBottom,
<mask> right,
<mask> leftOfTheRight);
<mask> canvas.drawPath(mPathForBorder, PAINT);
<mask> } else {
<mask> canvas.drawRect(leftOfTheRight, bottomOfTheTop, right, topOfTheBottom, PAINT);
<mask> }
<mask> }
<mask>
<mask> // draw center
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove topOfTheBottom,
</s> add bottomInset, </s> remove
// draw center
if (Color.alpha(mBackgroundColor) != 0) {
PAINT.setColor(mBackgroundColor);
canvas.drawRect(rightOfTheLeft, bottomOfTheTop, leftOfTheRight, topOfTheBottom, PAINT);
}
</s> add </s> remove leftOfTheRight);
</s> add rightInset); </s> remove } else {
canvas.drawRect(left, topOfTheBottom, right, bottom, PAINT);
</s> add </s> remove rightOfTheLeft,
</s> add leftInset,
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/flat/DrawBorder.java
|
keep keep replace replace replace replace replace replace keep keep replace keep
|
<mask> }
<mask> }
<mask>
<mask> // draw center
<mask> if (Color.alpha(mBackgroundColor) != 0) {
<mask> PAINT.setColor(mBackgroundColor);
<mask> canvas.drawRect(rightOfTheLeft, bottomOfTheTop, leftOfTheRight, topOfTheBottom, PAINT);
<mask> }
<mask> }
<mask>
<mask> private void updatePathForTopBorder(
<mask> float top,
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove } else {
canvas.drawRect(leftOfTheRight, bottomOfTheTop, right, topOfTheBottom, PAINT);
</s> add </s> remove // draw top
if (Color.alpha(topColor) != 0 && topWidth != 0) {
PAINT.setColor(topColor);
</s> add // Draw center. Any of the borders might be opaque or transparent, so we need to draw this.
if (Color.alpha(mBackgroundColor) != 0) {
PAINT.setColor(mBackgroundColor);
canvas.drawRect(left, top, right, bottom, PAINT);
} </s> remove }
// draw right
if (Color.alpha(rightColor) != 0 && rightWidth != 0) {
PAINT.setColor(rightColor);
</s> add </s> remove }
// draw bottom
if (Color.alpha(bottomColor) != 0 && bottomWidth != 0) {
PAINT.setColor(bottomColor);
</s> add </s> remove }
// draw left
if (Color.alpha(leftColor) != 0 && leftWidth != 0) {
PAINT.setColor(leftColor);
</s> add
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/flat/DrawBorder.java
|
keep keep keep replace keep replace keep
|
<mask>
<mask> private void updatePathForTopBorder(
<mask> float top,
<mask> float bottomOfTheTop,
<mask> float left,
<mask> float rightOfTheLeft,
<mask> float right,
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove private void updatePathForTopBorder(
</s> add private static void updatePathForTopBorder(
Path path, </s> remove float topOfTheBottom,
</s> add float bottomInset, </s> remove private void updatePathForBottomBorder(
</s> add private static void updatePathForBottomBorder(
Path path, </s> remove float bottomOfTheTop,
</s> add float topInset, </s> remove private void updatePathForLeftBorder(
</s> add private static void updatePathForLeftBorder(
Path path,
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/flat/DrawBorder.java
|
keep keep keep replace replace replace replace replace replace replace replace replace replace keep keep replace keep keep
|
<mask> float left,
<mask> float rightOfTheLeft,
<mask> float right,
<mask> float leftOfTheRight) {
<mask> if (mPathForBorder == null) {
<mask> mPathForBorder = new Path();
<mask> }
<mask> mPathForBorder.reset();
<mask> mPathForBorder.moveTo(left, top);
<mask> mPathForBorder.lineTo(rightOfTheLeft, bottomOfTheTop);
<mask> mPathForBorder.lineTo(leftOfTheRight, bottomOfTheTop);
<mask> mPathForBorder.lineTo(right, top);
<mask> mPathForBorder.lineTo(left, top);
<mask> }
<mask>
<mask> private void updatePathForBottomBorder(
<mask> float bottom,
<mask> float topOfTheBottom,
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove float rightOfTheLeft) {
if (mPathForBorder == null) {
mPathForBorder = new Path();
}
mPathForBorder.reset();
mPathForBorder.moveTo(left, top);
mPathForBorder.lineTo(rightOfTheLeft, bottomOfTheTop);
mPathForBorder.lineTo(rightOfTheLeft, topOfTheBottom);
mPathForBorder.lineTo(left, bottom);
mPathForBorder.lineTo(left, top);
</s> add float leftInset) {
path.reset();
path.moveTo(left, top);
path.lineTo(leftInset, topInset);
path.lineTo(leftInset, bottomInset);
path.lineTo(left, bottom);
path.lineTo(left, top); </s> remove float leftOfTheRight) {
if (mPathForBorder == null) {
mPathForBorder = new Path();
}
mPathForBorder.reset();
mPathForBorder.moveTo(right, top);
mPathForBorder.lineTo(right, bottom);
mPathForBorder.lineTo(leftOfTheRight, topOfTheBottom);
mPathForBorder.lineTo(leftOfTheRight, bottomOfTheTop);
mPathForBorder.lineTo(right, top);
</s> add float rightInset) {
path.reset();
path.moveTo(right, top);
path.lineTo(right, bottom);
path.lineTo(rightInset, bottomInset);
path.lineTo(rightInset, topInset);
path.lineTo(right, top); </s> remove float leftOfTheRight) {
if (mPathForBorder == null) {
mPathForBorder = new Path();
}
mPathForBorder.reset();
mPathForBorder.moveTo(left, bottom);
mPathForBorder.lineTo(right, bottom);
mPathForBorder.lineTo(leftOfTheRight, topOfTheBottom);
mPathForBorder.lineTo(rightOfTheLeft, topOfTheBottom);
mPathForBorder.lineTo(left, bottom);
</s> add float rightInset) {
path.reset();
path.moveTo(left, bottom);
path.lineTo(right, bottom);
path.lineTo(rightInset, bottomInset);
path.lineTo(leftInset, bottomInset);
path.lineTo(left, bottom); </s> remove float rightOfTheLeft,
</s> add float leftInset, </s> remove float topOfTheBottom,
</s> add float bottomInset,
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/flat/DrawBorder.java
|
keep keep keep replace keep replace
|
<mask>
<mask> private void updatePathForBottomBorder(
<mask> float bottom,
<mask> float topOfTheBottom,
<mask> float left,
<mask> float rightOfTheLeft,
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove private void updatePathForBottomBorder(
</s> add private static void updatePathForBottomBorder(
Path path, </s> remove float leftOfTheRight) {
if (mPathForBorder == null) {
mPathForBorder = new Path();
}
mPathForBorder.reset();
mPathForBorder.moveTo(left, top);
mPathForBorder.lineTo(rightOfTheLeft, bottomOfTheTop);
mPathForBorder.lineTo(leftOfTheRight, bottomOfTheTop);
mPathForBorder.lineTo(right, top);
mPathForBorder.lineTo(left, top);
</s> add float rightInset) {
path.reset();
path.moveTo(left, top);
path.lineTo(leftInset, topInset);
path.lineTo(rightInset, topInset);
path.lineTo(right, top);
path.lineTo(left, top); </s> remove private void updatePathForTopBorder(
</s> add private static void updatePathForTopBorder(
Path path, </s> remove private void updatePathForLeftBorder(
</s> add private static void updatePathForLeftBorder(
Path path, </s> remove float bottomOfTheTop,
</s> add float topInset,
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/flat/DrawBorder.java
|
keep keep replace replace replace replace replace replace replace replace replace replace keep keep replace keep keep keep
|
<mask> float rightOfTheLeft,
<mask> float right,
<mask> float leftOfTheRight) {
<mask> if (mPathForBorder == null) {
<mask> mPathForBorder = new Path();
<mask> }
<mask> mPathForBorder.reset();
<mask> mPathForBorder.moveTo(left, bottom);
<mask> mPathForBorder.lineTo(right, bottom);
<mask> mPathForBorder.lineTo(leftOfTheRight, topOfTheBottom);
<mask> mPathForBorder.lineTo(rightOfTheLeft, topOfTheBottom);
<mask> mPathForBorder.lineTo(left, bottom);
<mask> }
<mask>
<mask> private void updatePathForLeftBorder(
<mask> float top,
<mask> float bottomOfTheTop,
<mask> float bottom,
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove float rightOfTheLeft) {
if (mPathForBorder == null) {
mPathForBorder = new Path();
}
mPathForBorder.reset();
mPathForBorder.moveTo(left, top);
mPathForBorder.lineTo(rightOfTheLeft, bottomOfTheTop);
mPathForBorder.lineTo(rightOfTheLeft, topOfTheBottom);
mPathForBorder.lineTo(left, bottom);
mPathForBorder.lineTo(left, top);
</s> add float leftInset) {
path.reset();
path.moveTo(left, top);
path.lineTo(leftInset, topInset);
path.lineTo(leftInset, bottomInset);
path.lineTo(left, bottom);
path.lineTo(left, top); </s> remove float leftOfTheRight) {
if (mPathForBorder == null) {
mPathForBorder = new Path();
}
mPathForBorder.reset();
mPathForBorder.moveTo(right, top);
mPathForBorder.lineTo(right, bottom);
mPathForBorder.lineTo(leftOfTheRight, topOfTheBottom);
mPathForBorder.lineTo(leftOfTheRight, bottomOfTheTop);
mPathForBorder.lineTo(right, top);
</s> add float rightInset) {
path.reset();
path.moveTo(right, top);
path.lineTo(right, bottom);
path.lineTo(rightInset, bottomInset);
path.lineTo(rightInset, topInset);
path.lineTo(right, top); </s> remove float leftOfTheRight) {
if (mPathForBorder == null) {
mPathForBorder = new Path();
}
mPathForBorder.reset();
mPathForBorder.moveTo(left, top);
mPathForBorder.lineTo(rightOfTheLeft, bottomOfTheTop);
mPathForBorder.lineTo(leftOfTheRight, bottomOfTheTop);
mPathForBorder.lineTo(right, top);
mPathForBorder.lineTo(left, top);
</s> add float rightInset) {
path.reset();
path.moveTo(left, top);
path.lineTo(leftInset, topInset);
path.lineTo(rightInset, topInset);
path.lineTo(right, top);
path.lineTo(left, top); </s> remove float rightOfTheLeft,
</s> add float leftInset, </s> remove float topOfTheBottom,
</s> add float bottomInset,
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/flat/DrawBorder.java
|
keep replace keep replace keep keep keep keep
|
<mask> float top,
<mask> float bottomOfTheTop,
<mask> float bottom,
<mask> float topOfTheBottom,
<mask> float left,
<mask> float rightOfTheLeft) {
<mask> if (mPathForBorder == null) {
<mask> mPathForBorder = new Path();
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove float topOfTheBottom,
</s> add float bottomInset, </s> remove float rightOfTheLeft) {
if (mPathForBorder == null) {
mPathForBorder = new Path();
}
mPathForBorder.reset();
mPathForBorder.moveTo(left, top);
mPathForBorder.lineTo(rightOfTheLeft, bottomOfTheTop);
mPathForBorder.lineTo(rightOfTheLeft, topOfTheBottom);
mPathForBorder.lineTo(left, bottom);
mPathForBorder.lineTo(left, top);
</s> add float leftInset) {
path.reset();
path.moveTo(left, top);
path.lineTo(leftInset, topInset);
path.lineTo(leftInset, bottomInset);
path.lineTo(left, bottom);
path.lineTo(left, top); </s> remove float rightOfTheLeft,
</s> add float leftInset, </s> remove float rightOfTheLeft,
</s> add float leftInset, </s> remove float leftOfTheRight) {
if (mPathForBorder == null) {
mPathForBorder = new Path();
}
mPathForBorder.reset();
mPathForBorder.moveTo(left, bottom);
mPathForBorder.lineTo(right, bottom);
mPathForBorder.lineTo(leftOfTheRight, topOfTheBottom);
mPathForBorder.lineTo(rightOfTheLeft, topOfTheBottom);
mPathForBorder.lineTo(left, bottom);
</s> add float rightInset) {
path.reset();
path.moveTo(left, bottom);
path.lineTo(right, bottom);
path.lineTo(rightInset, bottomInset);
path.lineTo(leftInset, bottomInset);
path.lineTo(left, bottom);
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/flat/DrawBorder.java
|
keep replace replace replace replace replace replace replace replace replace replace keep keep replace keep keep keep
|
<mask> float left,
<mask> float rightOfTheLeft) {
<mask> if (mPathForBorder == null) {
<mask> mPathForBorder = new Path();
<mask> }
<mask> mPathForBorder.reset();
<mask> mPathForBorder.moveTo(left, top);
<mask> mPathForBorder.lineTo(rightOfTheLeft, bottomOfTheTop);
<mask> mPathForBorder.lineTo(rightOfTheLeft, topOfTheBottom);
<mask> mPathForBorder.lineTo(left, bottom);
<mask> mPathForBorder.lineTo(left, top);
<mask> }
<mask>
<mask> private void updatePathForRightBorder(
<mask> float top,
<mask> float bottomOfTheTop,
<mask> float bottom,
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove float leftOfTheRight) {
if (mPathForBorder == null) {
mPathForBorder = new Path();
}
mPathForBorder.reset();
mPathForBorder.moveTo(left, top);
mPathForBorder.lineTo(rightOfTheLeft, bottomOfTheTop);
mPathForBorder.lineTo(leftOfTheRight, bottomOfTheTop);
mPathForBorder.lineTo(right, top);
mPathForBorder.lineTo(left, top);
</s> add float rightInset) {
path.reset();
path.moveTo(left, top);
path.lineTo(leftInset, topInset);
path.lineTo(rightInset, topInset);
path.lineTo(right, top);
path.lineTo(left, top); </s> remove float leftOfTheRight) {
if (mPathForBorder == null) {
mPathForBorder = new Path();
}
mPathForBorder.reset();
mPathForBorder.moveTo(left, bottom);
mPathForBorder.lineTo(right, bottom);
mPathForBorder.lineTo(leftOfTheRight, topOfTheBottom);
mPathForBorder.lineTo(rightOfTheLeft, topOfTheBottom);
mPathForBorder.lineTo(left, bottom);
</s> add float rightInset) {
path.reset();
path.moveTo(left, bottom);
path.lineTo(right, bottom);
path.lineTo(rightInset, bottomInset);
path.lineTo(leftInset, bottomInset);
path.lineTo(left, bottom); </s> remove float leftOfTheRight) {
if (mPathForBorder == null) {
mPathForBorder = new Path();
}
mPathForBorder.reset();
mPathForBorder.moveTo(right, top);
mPathForBorder.lineTo(right, bottom);
mPathForBorder.lineTo(leftOfTheRight, topOfTheBottom);
mPathForBorder.lineTo(leftOfTheRight, bottomOfTheTop);
mPathForBorder.lineTo(right, top);
</s> add float rightInset) {
path.reset();
path.moveTo(right, top);
path.lineTo(right, bottom);
path.lineTo(rightInset, bottomInset);
path.lineTo(rightInset, topInset);
path.lineTo(right, top); </s> remove private void updatePathForLeftBorder(
</s> add private static void updatePathForLeftBorder(
Path path, </s> remove float topOfTheBottom,
</s> add float bottomInset,
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/flat/DrawBorder.java
|
keep keep keep keep replace keep replace keep keep keep keep
|
<mask> }
<mask>
<mask> private void updatePathForRightBorder(
<mask> float top,
<mask> float bottomOfTheTop,
<mask> float bottom,
<mask> float topOfTheBottom,
<mask> float right,
<mask> float leftOfTheRight) {
<mask> if (mPathForBorder == null) {
<mask> mPathForBorder = new Path();
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove float rightOfTheLeft,
</s> add float leftInset, </s> remove float rightOfTheLeft,
</s> add float leftInset, </s> remove float topOfTheBottom,
</s> add float bottomInset, </s> remove float rightOfTheLeft) {
if (mPathForBorder == null) {
mPathForBorder = new Path();
}
mPathForBorder.reset();
mPathForBorder.moveTo(left, top);
mPathForBorder.lineTo(rightOfTheLeft, bottomOfTheTop);
mPathForBorder.lineTo(rightOfTheLeft, topOfTheBottom);
mPathForBorder.lineTo(left, bottom);
mPathForBorder.lineTo(left, top);
</s> add float leftInset) {
path.reset();
path.moveTo(left, top);
path.lineTo(leftInset, topInset);
path.lineTo(leftInset, bottomInset);
path.lineTo(left, bottom);
path.lineTo(left, top); </s> remove float leftOfTheRight) {
if (mPathForBorder == null) {
mPathForBorder = new Path();
}
mPathForBorder.reset();
mPathForBorder.moveTo(left, bottom);
mPathForBorder.lineTo(right, bottom);
mPathForBorder.lineTo(leftOfTheRight, topOfTheBottom);
mPathForBorder.lineTo(rightOfTheLeft, topOfTheBottom);
mPathForBorder.lineTo(left, bottom);
</s> add float rightInset) {
path.reset();
path.moveTo(left, bottom);
path.lineTo(right, bottom);
path.lineTo(rightInset, bottomInset);
path.lineTo(leftInset, bottomInset);
path.lineTo(left, bottom);
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/flat/DrawBorder.java
|
keep keep keep keep replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
|
<mask> float bottomOfTheTop,
<mask> float bottom,
<mask> float topOfTheBottom,
<mask> float right,
<mask> float leftOfTheRight) {
<mask> if (mPathForBorder == null) {
<mask> mPathForBorder = new Path();
<mask> }
<mask> mPathForBorder.reset();
<mask> mPathForBorder.moveTo(right, top);
<mask> mPathForBorder.lineTo(right, bottom);
<mask> mPathForBorder.lineTo(leftOfTheRight, topOfTheBottom);
<mask> mPathForBorder.lineTo(leftOfTheRight, bottomOfTheTop);
<mask> mPathForBorder.lineTo(right, top);
<mask> }
<mask>
<mask> private int resolveBorderColor(int flag, int color, int defaultColor) {
<mask> return isFlagSet(flag) ? color : defaultColor;
<mask> }
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove float leftOfTheRight) {
if (mPathForBorder == null) {
mPathForBorder = new Path();
}
mPathForBorder.reset();
mPathForBorder.moveTo(left, top);
mPathForBorder.lineTo(rightOfTheLeft, bottomOfTheTop);
mPathForBorder.lineTo(leftOfTheRight, bottomOfTheTop);
mPathForBorder.lineTo(right, top);
mPathForBorder.lineTo(left, top);
</s> add float rightInset) {
path.reset();
path.moveTo(left, top);
path.lineTo(leftInset, topInset);
path.lineTo(rightInset, topInset);
path.lineTo(right, top);
path.lineTo(left, top); </s> remove float leftOfTheRight) {
if (mPathForBorder == null) {
mPathForBorder = new Path();
}
mPathForBorder.reset();
mPathForBorder.moveTo(left, bottom);
mPathForBorder.lineTo(right, bottom);
mPathForBorder.lineTo(leftOfTheRight, topOfTheBottom);
mPathForBorder.lineTo(rightOfTheLeft, topOfTheBottom);
mPathForBorder.lineTo(left, bottom);
</s> add float rightInset) {
path.reset();
path.moveTo(left, bottom);
path.lineTo(right, bottom);
path.lineTo(rightInset, bottomInset);
path.lineTo(leftInset, bottomInset);
path.lineTo(left, bottom); </s> remove float rightOfTheLeft) {
if (mPathForBorder == null) {
mPathForBorder = new Path();
}
mPathForBorder.reset();
mPathForBorder.moveTo(left, top);
mPathForBorder.lineTo(rightOfTheLeft, bottomOfTheTop);
mPathForBorder.lineTo(rightOfTheLeft, topOfTheBottom);
mPathForBorder.lineTo(left, bottom);
mPathForBorder.lineTo(left, top);
</s> add float leftInset) {
path.reset();
path.moveTo(left, top);
path.lineTo(leftInset, topInset);
path.lineTo(leftInset, bottomInset);
path.lineTo(left, bottom);
path.lineTo(left, top); </s> remove float topOfTheBottom,
</s> add float bottomInset, </s> remove float rightOfTheLeft,
</s> add float leftInset, </s> remove float rightOfTheLeft,
</s> add float leftInset,
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/flat/DrawBorder.java
|
keep keep keep keep replace keep keep
|
<mask> "PUBLIC",
<mask> ],
<mask> deps = [
<mask> react_native_dep("third-party/java/jsr-305:jsr-305"),
<mask> react_native_target("java/com/facebook/react/bridge:bridge"),
<mask> ],
<mask> )
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> add react_native_dep("java/com/facebook/jni:jni"),
react_native_dep("java/com/facebook/proguard/annotations:annotations"), </s> remove deps = [
react_native_target("jni/xreact/jni:jni"),
],
</s> add xcode_public_headers_symlinks = True,
deps = ([
"//native/third-party/android-ndk:android",
"//xplat/folly:molly",
"//xplat/fbgloginit:fbgloginit",
"//xplat/fbsystrace:fbsystrace",
react_native_xplat_target("cxxreact:bridge"),
react_native_xplat_target("cxxreact:module"),
FBJNI_TARGET,
] + JSC_DEPS) if not IS_OSS_BUILD else [], </s> add react_native_dep("third-party/java/okio:okio"), </s> remove header_namespace = "cxxreact",
labels = ["accounts_for_platform_and_build_mode_flags"],
</s> add header_namespace = "", </s> remove exported_headers = [
"CxxModule.h",
"JsArgumentHelpers.h",
"JsArgumentHelpers-inl.h",
</s> add exported_headers = subdir_glob(
[
("", "CxxModule.h"),
("", "JsArgumentHelpers.h"),
("", "JsArgumentHelpers-inl.h"),
],
prefix = "cxxreact",
),
force_static = True,
header_namespace = "",
visibility = [
"PUBLIC",
],
xcode_public_headers_symlinks = True,
deps = [
"//xplat/folly:molly",
],
)
rn_xplat_cxx_library(
name = "jsbigstring",
srcs = [
"JSBigString.cpp", </s> remove def react_library(**kwargs):
fb_apple_library(
name = 'bridge',
header_path_prefix = "cxxreact",
inherited_buck_flags = STATIC_LIBRARY_IOS_FLAGS,
frameworks = [
'$SDKROOT/System/Library/Frameworks/JavaScriptCore.framework',
],
tests = [
react_native_xplat_target('cxxreact/tests:tests')
],
**kwargs_add(
kwargs,
preprocessor_flags = DEBUG_PREPROCESSOR_FLAGS + INSPECTOR_FLAGS,
deps = [
'//xplat/folly:molly',
],
visibility = [ 'PUBLIC' ],
)
)
cxx_library(
</s> add rn_xplat_cxx_library(
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/module/model/BUCK
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> private static final String EVENT_NAME = "touchExplorationDidChange";
<mask>
<mask> public AccessibilityInfoModule(ReactApplicationContext context) {
<mask> super(context);
<mask> mAccessibilityManager = (AccessibilityManager) getReactApplicationContext()
<mask> .getSystemService(Context.ACCESSIBILITY_SERVICE);
<mask> mEnabled = mAccessibilityManager.isTouchExplorationEnabled();
<mask> if (Build.VERSION.SDK_INT >= 19) {
<mask> mTouchExplorationStateChangeListener = new ReactTouchExplorationStateChangeListener();
<mask> }
<mask> }
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> add @ReactProp(name = "thirdPartyCookiesEnabled")
public void setThirdPartyCookiesEnabled(WebView view, boolean enabled) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
CookieManager.getInstance().setAcceptThirdPartyCookies(view, enabled);
}
}
</s> remove public static Pattern mJsModuleIdPattern = Pattern.compile("(?:^|[/\\\\])(\\d+\\.js)$");
</s> add </s> remove private float mContentWidth;
private float mContentHeight;
</s> add </s> remove private void handleConnect(JSONObject payload) throws JSONException, IOException {
</s> add private void handleConnect(JSONObject payload) throws JSONException { </s> remove mShakeListener.onShake();
</s> add if (currentTimestamp - mLastShakeTimestamp >= VISIBLE_TIME_RANGE_NS) {
mNumShakes++;
}
mLastShakeTimestamp = currentTimestamp;
if (mNumShakes >= mMinNumShakes) {
mNumShakes = 0;
mLastShakeTimestamp = 0;
mShakeListener.onShake();
}
}
if (currentTimestamp - mLastShakeTimestamp > SHAKING_WINDOW_NS) {
mNumShakes = 0;
mLastShakeTimestamp = 0; </s> remove private void handleWrappedEvent(JSONObject payload) throws JSONException, IOException {
</s> add private void handleWrappedEvent(JSONObject payload) throws JSONException {
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/modules/accessibilityinfo/AccessibilityInfoModule.java
|
keep add keep keep keep keep
|
<mask> }
<mask>
<mask> @Override
<mask> public void onHostDestroy() {
<mask> }
<mask> }
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove mMessageCallback.onMessage(message);
</s> add mMessageCallback.onMessage(text); </s> remove public void onPong(Buffer payload) {
}
@Override
public void onClose(int code, String reason) {
</s> add public void onClosed(WebSocket webSocket, int code, String reason) { </s> remove public synchronized void onPong(Buffer payload) { }
</s> add public synchronized void onMessage(WebSocket webSocket, ByteString bytes) {
if (mMessageCallback != null) {
mMessageCallback.onMessage(bytes);
}
} </s> remove public void onFailure(IOException e, Response response) {
notifyWebSocketFailed(id, e.getMessage());
</s> add public void onFailure(WebSocket webSocket, Throwable t, Response response) {
notifyWebSocketFailed(id, t.getMessage()); </s> remove handleProxyMessage(new JSONObject(message.string()));
} catch (JSONException e) {
throw new IOException(e);
} finally {
message.close();
</s> add handleProxyMessage(new JSONObject(text));
} catch (Exception e) {
throw new RuntimeException(e); </s> remove public synchronized void onMessage(ResponseBody message) {
</s> add public synchronized void onMessage(WebSocket webSocket, String text) {
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/modules/accessibilityinfo/AccessibilityInfoModule.java
|
keep keep add keep keep
|
<mask> react_native_target("java/com/facebook/react/devsupport:interfaces"),
<mask> react_native_target("java/com/facebook/react/jstasks:jstasks"),
<mask> react_native_target("java/com/facebook/react/module/annotations:annotations"),
<mask> ],
<mask> )
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> add react_native_dep("third-party/java/okio:okio"), </s> remove react_native_target("java/com/facebook/react/bridge:bridge"),
</s> add </s> add react_native_dep("third-party/java/okio:okio"), </s> add react_native_tests_target("java/com/facebook/common/logging:logging"), </s> remove react_native_dep("third-party/java/okhttp:okhttp3-ws"),
</s> add </s> remove ],
</s> add ] + JSC_DEPS,
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/modules/core/BUCK
|
keep keep keep replace replace keep keep keep keep replace replace replace keep keep keep
|
<mask> */
<mask> package com.facebook.react.modules.core;
<mask>
<mask> import java.util.regex.Matcher;
<mask> import java.util.regex.Pattern;
<mask> import com.facebook.common.logging.FLog;
<mask> import com.facebook.react.bridge.BaseJavaModule;
<mask> import com.facebook.react.bridge.ReactMethod;
<mask> import com.facebook.react.bridge.ReadableArray;
<mask> import com.facebook.react.bridge.ReadableMap;
<mask> import com.facebook.react.bridge.ReadableType;
<mask> import com.facebook.react.devsupport.interfaces.DevSupportManager;
<mask> import com.facebook.react.common.JavascriptException;
<mask> import com.facebook.react.common.ReactConstants;
<mask> import com.facebook.react.module.annotations.ReactModule;
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> add import com.facebook.react.devsupport.interfaces.DevSupportManager; </s> remove import java.util.regex.Matcher;
import java.util.regex.Pattern;
</s> add </s> remove import com.facebook.react.uimanager.FloatUtil;
</s> add import com.facebook.react.common.build.ReactBuildConfig; </s> add import com.facebook.react.common.DebugServerException; </s> add import android.webkit.CookieManager;
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/modules/core/ExceptionsManagerModule.java
|
keep keep add keep keep keep keep keep
|
<mask> import com.facebook.react.bridge.ReadableArray;
<mask> import com.facebook.react.common.JavascriptException;
<mask> import com.facebook.react.common.ReactConstants;
<mask> import com.facebook.react.module.annotations.ReactModule;
<mask> import com.facebook.react.util.JSStackTrace;
<mask>
<mask> @ReactModule(name = ExceptionsManagerModule.NAME)
<mask> public class ExceptionsManagerModule extends BaseJavaModule {
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> add import com.facebook.react.util.JSStackTrace; </s> remove import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.ReadableType;
import com.facebook.react.devsupport.interfaces.DevSupportManager;
</s> add </s> remove import okhttp3.ResponseBody;
import okhttp3.ws.WebSocket;
import okhttp3.ws.WebSocketCall;
import okhttp3.ws.WebSocketListener;
import java.net.URISyntaxException;
import java.net.URI;
import java.util.HashMap;
import java.util.Map;
import java.util.List;
import java.util.concurrent.TimeUnit;
import okio.Buffer;
</s> add import okhttp3.WebSocket;
import okhttp3.WebSocketListener; </s> add import com.facebook.react.common.DebugServerException; </s> add import java.io.StringReader; </s> add import android.webkit.CookieManager;
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/modules/core/ExceptionsManagerModule.java
|
keep add keep keep keep keep
|
<mask> import com.facebook.react.devsupport.interfaces.DevSupportManager;
<mask> import com.facebook.react.module.annotations.ReactModule;
<mask>
<mask> @ReactModule(name = ExceptionsManagerModule.NAME)
<mask> public class ExceptionsManagerModule extends BaseJavaModule {
<mask>
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> add import com.facebook.react.devsupport.interfaces.DevSupportManager; </s> remove import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.ReadableType;
import com.facebook.react.devsupport.interfaces.DevSupportManager;
</s> add </s> remove import okhttp3.ResponseBody;
import okhttp3.ws.WebSocket;
import okhttp3.ws.WebSocketCall;
import okhttp3.ws.WebSocketListener;
import java.net.URISyntaxException;
import java.net.URI;
import java.util.HashMap;
import java.util.Map;
import java.util.List;
import java.util.concurrent.TimeUnit;
import okio.Buffer;
</s> add import okhttp3.WebSocket;
import okhttp3.WebSocketListener; </s> remove public static Pattern mJsModuleIdPattern = Pattern.compile("(?:^|[/\\\\])(\\d+\\.js)$");
</s> add </s> remove import com.facebook.react.packagerconnection.JSPackagerClient;
</s> add import com.facebook.react.packagerconnection.RequestHandler; </s> remove import okhttp3.ResponseBody;
import okhttp3.ws.WebSocket;
import okhttp3.ws.WebSocketCall;
import okhttp3.ws.WebSocketListener;
import okio.Buffer;
</s> add import okhttp3.WebSocket;
import okhttp3.WebSocketListener;
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/modules/core/ExceptionsManagerModule.java
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> public class ExceptionsManagerModule extends BaseJavaModule {
<mask>
<mask> final public static String NAME = "ExceptionsManager";
<mask>
<mask> public static Pattern mJsModuleIdPattern = Pattern.compile("(?:^|[/\\\\])(\\d+\\.js)$");
<mask>
<mask> public final DevSupportManager mDevSupportManager;
<mask>
<mask> public ExceptionsManagerModule(DevSupportManager devSupportManager) {
<mask> mDevSupportManager = devSupportManager;
<mask> }
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove final public class ReconnectingWebSocket implements WebSocketListener {
</s> add final public class ReconnectingWebSocket extends WebSocketListener { </s> add import com.facebook.react.util.JSStackTrace; </s> add static final YogaValue AUTO = new YogaValue(YogaConstants.UNDEFINED, YogaUnit.AUTO); </s> remove public class JSDebuggerWebSocketClient implements WebSocketListener {
</s> add public class JSDebuggerWebSocketClient extends WebSocketListener { </s> add import com.facebook.react.devsupport.interfaces.DevSupportManager; </s> remove private class Connection implements WebSocketListener {
</s> add private class Connection extends WebSocketListener {
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/modules/core/ExceptionsManagerModule.java
|
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
|
<mask> public String getName() {
<mask> return NAME;
<mask> }
<mask>
<mask> // If the file name of a stack frame is numeric (+ ".js"), we assume it's a lazily injected module
<mask> // coming from a "random access bundle". We are using special source maps for these bundles, so
<mask> // that we can symbolicate stack traces for multiple injected files with a single source map.
<mask> // We have to include the module id in the stack for that, though. The ".js" suffix is kept to
<mask> // avoid ambiguities between "module-id:line" and "line:column".
<mask> private static String stackFrameToModuleId(ReadableMap frame) {
<mask> if (frame.hasKey("file") && !frame.isNull("file") && frame.getType("file") == ReadableType.String) {
<mask> final Matcher matcher = mJsModuleIdPattern.matcher(frame.getString("file"));
<mask> if (matcher.find()) {
<mask> return matcher.group(1) + ":";
<mask> }
<mask> }
<mask> return "";
<mask> }
<mask>
<mask> private String stackTraceToString(String message, ReadableArray stack) {
<mask> StringBuilder stringBuilder = new StringBuilder(message).append(", stack:\n");
<mask> for (int i = 0; i < stack.size(); i++) {
<mask> ReadableMap frame = stack.getMap(i);
<mask> stringBuilder.append(frame.getString("methodName")).append("@").append(stackFrameToModuleId(frame)).append(frame.getInt("lineNumber"));
<mask> if (frame.hasKey("column") && !frame.isNull("column") && frame.getType("column") == ReadableType.Number) {
<mask> stringBuilder.append(":").append(frame.getInt("column"));
<mask> }
<mask> stringBuilder.append("\n");
<mask> }
<mask> return stringBuilder.toString();
<mask> }
<mask>
<mask> @ReactMethod
<mask> public void reportFatalException(String title, ReadableArray details, int exceptionId) {
<mask> if (mDevSupportManager.getDevSupportEnabled()) {
<mask> {
<mask> showOrThrowError(title, details, exceptionId);
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove throw new JavascriptException(stackTraceToString(title, details));
</s> add throw new JavascriptException(JSStackTrace.format(title, details)); </s> remove Matcher matcher = STACK_FRAME_PATTERN.matcher(stackTrace[i]);
if (!matcher.find()) {
throw new IllegalArgumentException(
</s> add if (stackTrace[i].equals("[native code]")) {
result[i] = new StackFrameImpl(null, stackTrace[i], -1, -1);
} else {
Matcher matcher = STACK_FRAME_PATTERN.matcher(stackTrace[i]);
if (!matcher.find()) {
throw new IllegalArgumentException( </s> add StringBuilder sb = new StringBuilder();
toStringWithIndentation(sb, 0);
return sb.toString();
}
private void toStringWithIndentation(StringBuilder result, int level) {
// Spaces and tabs are dropped by IntelliJ logcat integration, so rely on __ instead.
for (int i = 0; i < level; ++i) {
result.append("__");
}
result
.append(getClass().getSimpleName())
.append(" "); </s> remove return getClass().getSimpleName() + " (virtual node)";
</s> add for (int i = 0; i < getChildCount(); i++) {
getChildAt(i).toStringWithIndentation(result, level + 1);
} </s> remove static void runStdFunctionImpl(alias_ref<JClass>, jlong ptr) {
(*reinterpret_cast<std::function<void()>*>(ptr))();
}
static void OnLoad() {
// We need the javaClassStatic so that the class lookup is cached and that
// runStdFunction can be called from a ThreadScope-attached thread.
javaClassStatic()->registerNatives({
makeNativeMethod("runStdFunctionImpl", runStdFunctionImpl),
});
}
};
</s> add ThreadLocal<ThreadScope>& scopeStorage() {
// We don't want the ThreadLocal to delete the ThreadScopes.
static ThreadLocal<ThreadScope> scope([] (void*) {});
return scope; </s> remove marginAxisColumn)) {
</s> add marginAxisColumn,
config)) {
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/modules/core/ExceptionsManagerModule.java
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> {
<mask> if (mDevSupportManager.getDevSupportEnabled()) {
<mask> mDevSupportManager.showNewJSError(title, details, exceptionId);
<mask> } else {
<mask> FLog.e(ReactConstants.TAG, stackTraceToString(title, details));
<mask> }
<mask> }
<mask> } else {
<mask> {
<mask> try {
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove throw new JavascriptException(stackTraceToString(title, details));
</s> add throw new JavascriptException(JSStackTrace.format(title, details)); </s> remove public synchronized void sendMessage(RequestBody message) throws IOException {
</s> add public synchronized void sendMessage(String message) throws IOException {
if (mWebSocket != null) {
mWebSocket.send(message);
} else {
throw new ClosedChannelException();
}
}
public synchronized void sendMessage(ByteString message) throws IOException { </s> remove mWebSocket.sendMessage(message);
</s> add mWebSocket.send(message); </s> remove } finally {
response.close();
</s> add </s> remove return mYogaNode.toString();
</s> add result
.append(getLayoutWidth())
.append(",")
.append(getLayoutHeight());
} else {
result.append("(virtual node)");
}
result.append("\n");
if (getChildCount() == 0) {
return; </s> remove public void onMessage(ResponseBody response) throws IOException {
String message;
try {
if (response.contentType() == WebSocket.BINARY) {
message = Base64.encodeToString(response.source().readByteArray(), Base64.NO_WRAP);
} else {
message = response.source().readUtf8();
}
} catch (IOException e) {
notifyWebSocketFailed(id, e.getMessage());
return;
}
try {
response.source().close();
} catch (IOException e) {
FLog.e(
ReactConstants.TAG,
"Could not close BufferedSource for WebSocket id " + id,
e);
}
</s> add public void onMessage(WebSocket webSocket, ByteString bytes) {
String text = bytes.utf8();
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/modules/core/ExceptionsManagerModule.java
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> private void showOrThrowError(String title, ReadableArray details, int exceptionId) {
<mask> if (mDevSupportManager.getDevSupportEnabled()) {
<mask> mDevSupportManager.showNewJSError(title, details, exceptionId);
<mask> } else {
<mask> throw new JavascriptException(stackTraceToString(title, details));
<mask> }
<mask> }
<mask>
<mask> @ReactMethod
<mask> public void updateExceptionMessage(String title, ReadableArray details, int exceptionId) {
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove FLog.e(ReactConstants.TAG, stackTraceToString(title, details));
</s> add FLog.e(ReactConstants.TAG, JSStackTrace.format(title, details)); </s> remove // If the file name of a stack frame is numeric (+ ".js"), we assume it's a lazily injected module
// coming from a "random access bundle". We are using special source maps for these bundles, so
// that we can symbolicate stack traces for multiple injected files with a single source map.
// We have to include the module id in the stack for that, though. The ".js" suffix is kept to
// avoid ambiguities between "module-id:line" and "line:column".
private static String stackFrameToModuleId(ReadableMap frame) {
if (frame.hasKey("file") && !frame.isNull("file") && frame.getType("file") == ReadableType.String) {
final Matcher matcher = mJsModuleIdPattern.matcher(frame.getString("file"));
if (matcher.find()) {
return matcher.group(1) + ":";
}
}
return "";
}
private String stackTraceToString(String message, ReadableArray stack) {
StringBuilder stringBuilder = new StringBuilder(message).append(", stack:\n");
for (int i = 0; i < stack.size(); i++) {
ReadableMap frame = stack.getMap(i);
stringBuilder.append(frame.getString("methodName")).append("@").append(stackFrameToModuleId(frame)).append(frame.getInt("lineNumber"));
if (frame.hasKey("column") && !frame.isNull("column") && frame.getType("column") == ReadableType.Number) {
stringBuilder.append(":").append(frame.getInt("column"));
}
stringBuilder.append("\n");
}
return stringBuilder.toString();
}
</s> add </s> remove public synchronized void sendMessage(RequestBody message) throws IOException {
</s> add public synchronized void sendMessage(String message) throws IOException {
if (mWebSocket != null) {
mWebSocket.send(message);
} else {
throw new ClosedChannelException();
}
}
public synchronized void sendMessage(ByteString message) throws IOException { </s> remove mWebSocket.sendMessage(message);
</s> add mWebSocket.send(message); </s> remove void CxxNativeModule::invoke(unsigned int reactMethodId, folly::dynamic&& params) {
</s> add void CxxNativeModule::invoke(unsigned int reactMethodId, folly::dynamic&& params, int callId) { </s> remove handleProxyMessage(new JSONObject(message.string()));
} catch (JSONException e) {
throw new IOException(e);
} finally {
message.close();
</s> add handleProxyMessage(new JSONObject(text));
} catch (Exception e) {
throw new RuntimeException(e);
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/modules/core/ExceptionsManagerModule.java
|
keep add keep keep keep keep keep keep
|
<mask> react_native_dep("third-party/java/okhttp:okhttp3"),
<mask> react_native_dep("third-party/java/okhttp:okhttp3-urlconnection"),
<mask> react_native_target("java/com/facebook/react/bridge:bridge"),
<mask> react_native_target("java/com/facebook/react/common:common"),
<mask> react_native_target("java/com/facebook/react/module/annotations:annotations"),
<mask> react_native_target("java/com/facebook/react/modules/common:common"),
<mask> react_native_target("java/com/facebook/react/modules/network:network"),
<mask> ],
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove react_native_dep("third-party/java/okhttp:okhttp3-ws"),
</s> add </s> remove react_native_dep("third-party/java/okhttp:okhttp3-ws"),
</s> add </s> remove react_native_dep("third-party/java/okhttp:okhttp3-ws"),
</s> add </s> add react_native_tests_target("java/com/facebook/common/logging:logging"), </s> add react_native_target("java/com/facebook/react/util:util"), </s> remove react_native_target("java/com/facebook/react/bridge:bridge"),
</s> add
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/modules/fresco/BUCK
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> private final ConnectivityManager mConnectivityManager;
<mask> private final ConnectivityBroadcastReceiver mConnectivityBroadcastReceiver;
<mask> private boolean mNoNetworkPermission = false;
<mask>
<mask> private String mConnectivity = "";
<mask>
<mask> public NetInfoModule(ReactApplicationContext reactContext) {
<mask> super(reactContext);
<mask> mConnectivityManager =
<mask> (ConnectivityManager) reactContext.getSystemService(Context.CONNECTIVITY_SERVICE);
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> add private OkHttpClient mHttpClient; </s> remove final public class ReconnectingWebSocket implements WebSocketListener {
</s> add final public class ReconnectingWebSocket extends WebSocketListener { </s> remove private class Connection implements WebSocketListener {
</s> add private class Connection extends WebSocketListener { </s> remove private float mContentWidth;
private float mContentHeight;
</s> add </s> add // ~0 == 0xFFFFFFFF, all bits set to 1.
private static final int ALL_BITS_SET = ~0;
// 0 == 0x00000000, all bits set to 0.
private static final int ALL_BITS_UNSET = 0;
</s> add // ~0 == 0xFFFFFFFF, all bits set to 1.
private static final int ALL_BITS_SET = ~0;
// 0 == 0x00000000, all bits set to 0.
private static final int ALL_BITS_UNSET = 0;
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/modules/netinfo/NetInfoModule.java
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> react_native_dep("libraries/fbcore/src/main/java/com/facebook/common/logging:logging"),
<mask> react_native_dep("third-party/java/infer-annotations:infer-annotations"),
<mask> react_native_dep("third-party/java/jsr-305:jsr-305"),
<mask> react_native_dep("third-party/java/okhttp:okhttp3"),
<mask> react_native_dep("third-party/java/okhttp:okhttp3-ws"),
<mask> react_native_dep("third-party/java/okio:okio"),
<mask> react_native_target("java/com/facebook/react/bridge:bridge"),
<mask> react_native_target("java/com/facebook/react/common:common"),
<mask> react_native_target("java/com/facebook/react/module/annotations:annotations"),
<mask> react_native_target("java/com/facebook/react/modules/core:core"),
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove react_native_dep("third-party/java/okhttp:okhttp3-ws"),
</s> add </s> remove react_native_dep("third-party/java/okhttp:okhttp3-ws"),
</s> add </s> remove react_native_dep("third-party/java/okhttp:okhttp3-ws"),
</s> add </s> add react_native_dep("third-party/java/okio:okio"), </s> add react_native_dep("libraries/soloader/java/com/facebook/soloader:soloader"), </s> remove react_native_dep("third-party/java/okhttp:okhttp3-ws"),
</s> add react_native_dep("third-party/java/okio:okio"),
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/BUCK
|
keep keep keep keep replace keep keep keep keep keep keep keep keep replace replace keep keep
|
<mask> */
<mask>
<mask> package com.facebook.react.modules.websocket;
<mask>
<mask> import android.util.Base64;
<mask>
<mask> import java.io.IOException;
<mask> import java.lang.IllegalStateException;
<mask> import javax.annotation.Nullable;
<mask>
<mask> import android.util.Base64;
<mask>
<mask> import java.io.IOException;
<mask> import java.lang.IllegalStateException;
<mask> import javax.annotation.Nullable;
<mask>
<mask> import com.facebook.common.logging.FLog;
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> add import javax.annotation.Nullable;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException; </s> remove import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import javax.annotation.Nullable;
</s> add </s> add import javax.annotation.Nullable;
import javax.annotation.concurrent.NotThreadSafe; </s> add import java.io.StringReader; </s> remove import okhttp3.RequestBody;
</s> add
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.java
|
keep keep keep replace keep replace replace replace replace replace replace replace replace replace replace replace replace replace keep
|
<mask>
<mask> import okhttp3.OkHttpClient;
<mask> import okhttp3.Request;
<mask> import okhttp3.RequestBody;
<mask> import okhttp3.Response;
<mask> import okhttp3.ResponseBody;
<mask> import okhttp3.ws.WebSocket;
<mask> import okhttp3.ws.WebSocketCall;
<mask> import okhttp3.ws.WebSocketListener;
<mask>
<mask> import java.net.URISyntaxException;
<mask> import java.net.URI;
<mask> import java.util.HashMap;
<mask> import java.util.Map;
<mask> import java.util.List;
<mask> import java.util.concurrent.TimeUnit;
<mask>
<mask> import okio.Buffer;
<mask> import okio.ByteString;
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove import okhttp3.RequestBody;
</s> add </s> remove import okhttp3.RequestBody;
</s> add </s> remove import okhttp3.RequestBody;
</s> add </s> remove import okhttp3.ResponseBody;
import okhttp3.ws.WebSocket;
import okhttp3.ws.WebSocketCall;
import okhttp3.ws.WebSocketListener;
import okio.Buffer;
</s> add import okhttp3.WebSocket;
import okhttp3.WebSocketListener; </s> remove import okhttp3.ResponseBody;
import okhttp3.ws.WebSocket;
import okhttp3.ws.WebSocketCall;
import okhttp3.ws.WebSocketListener;
import okio.Buffer;
</s> add import okhttp3.WebSocket;
import okhttp3.WebSocketListener;
import okio.ByteString;
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.java
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> builder.addHeader("Sec-WebSocket-Protocol", protocolsValue.toString());
<mask> }
<mask> }
<mask>
<mask> WebSocketCall.create(client, builder.build()).enqueue(new WebSocketListener() {
<mask>
<mask> @Override
<mask> public void onOpen(WebSocket webSocket, Response response) {
<mask> mWebSocketConnections.put(id, webSocket);
<mask> WritableMap params = Arguments.createMap();
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove public void onFailure(IOException e, Response response) {
abort("Websocket exception", e);
</s> add public void onFailure(WebSocket webSocket, Throwable t, Response response) {
abort("Websocket exception", t); </s> remove public void onPong(Buffer buffer) {
</s> add public void onMessage(WebSocket webSocket, String text) {
WritableMap params = Arguments.createMap();
params.putInt("id", id);
params.putString("data", text);
params.putString("type", "text");
sendEvent("websocketMessage", params); </s> remove public void onClose(int code, String reason) {
</s> add public void onClosed(WebSocket webSocket, int code, String reason) { </s> remove public void onFailure(IOException e, Response response) {
notifyWebSocketFailed(id, e.getMessage());
</s> add public void onFailure(WebSocket webSocket, Throwable t, Response response) {
notifyWebSocketFailed(id, t.getMessage()); </s> remove public void onFailure(IOException e, Response response) {
</s> add public void onFailure(WebSocket webSocket, Throwable t, Response response) { </s> remove public synchronized void onFailure(IOException e, Response response) {
</s> add public synchronized void onFailure(WebSocket webSocket, Throwable t, Response response) {
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.java
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> sendEvent("websocketOpen", params);
<mask> }
<mask>
<mask> @Override
<mask> public void onClose(int code, String reason) {
<mask> WritableMap params = Arguments.createMap();
<mask> params.putInt("id", id);
<mask> params.putInt("code", code);
<mask> params.putString("reason", reason);
<mask> sendEvent("websocketClosed", params);
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove public void onPong(Buffer buffer) {
</s> add public void onMessage(WebSocket webSocket, String text) {
WritableMap params = Arguments.createMap();
params.putInt("id", id);
params.putString("data", text);
params.putString("type", "text");
sendEvent("websocketMessage", params); </s> remove params.putString("data", message);
params.putString("type", response.contentType() == WebSocket.BINARY ? "binary" : "text");
</s> add params.putString("data", text);
params.putString("type", "binary"); </s> remove public void onClose(int code, String reason) {
</s> add public void onClosed(WebSocket webSocket, int code, String reason) { </s> remove public void onPong(Buffer payload) {
}
@Override
public void onClose(int code, String reason) {
</s> add public void onClosed(WebSocket webSocket, int code, String reason) { </s> remove public void onMessage(ResponseBody response) throws IOException {
String message;
try {
if (response.contentType() == WebSocket.BINARY) {
message = Base64.encodeToString(response.source().readByteArray(), Base64.NO_WRAP);
} else {
message = response.source().readUtf8();
}
} catch (IOException e) {
notifyWebSocketFailed(id, e.getMessage());
return;
}
try {
response.source().close();
} catch (IOException e) {
FLog.e(
ReactConstants.TAG,
"Could not close BufferedSource for WebSocket id " + id,
e);
}
</s> add public void onMessage(WebSocket webSocket, ByteString bytes) {
String text = bytes.utf8(); </s> remove public synchronized void onClose(int code, String reason) {
</s> add public synchronized void onClosed(WebSocket webSocket, int code, String reason) {
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.java
|
keep keep keep keep replace replace keep keep keep replace
|
<mask> sendEvent("websocketClosed", params);
<mask> }
<mask>
<mask> @Override
<mask> public void onFailure(IOException e, Response response) {
<mask> notifyWebSocketFailed(id, e.getMessage());
<mask> }
<mask>
<mask> @Override
<mask> public void onPong(Buffer buffer) {
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove public void onFailure(IOException e, Response response) {
abort("Websocket exception", e);
</s> add public void onFailure(WebSocket webSocket, Throwable t, Response response) {
abort("Websocket exception", t); </s> remove public void onFailure(IOException e, Response response) {
</s> add public void onFailure(WebSocket webSocket, Throwable t, Response response) { </s> remove public synchronized void onFailure(IOException e, Response response) {
</s> add public synchronized void onFailure(WebSocket webSocket, Throwable t, Response response) { </s> remove } finally {
response.close();
</s> add </s> remove abort("Websocket exception", e);
</s> add abort("Websocket exception", t);
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.java
|
keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep replace replace keep
|
<mask> }
<mask>
<mask> @Override
<mask> public void onMessage(ResponseBody response) throws IOException {
<mask> String message;
<mask> try {
<mask> if (response.contentType() == WebSocket.BINARY) {
<mask> message = Base64.encodeToString(response.source().readByteArray(), Base64.NO_WRAP);
<mask> } else {
<mask> message = response.source().readUtf8();
<mask> }
<mask> } catch (IOException e) {
<mask> notifyWebSocketFailed(id, e.getMessage());
<mask> return;
<mask> }
<mask> try {
<mask> response.source().close();
<mask> } catch (IOException e) {
<mask> FLog.e(
<mask> ReactConstants.TAG,
<mask> "Could not close BufferedSource for WebSocket id " + id,
<mask> e);
<mask> }
<mask>
<mask> WritableMap params = Arguments.createMap();
<mask> params.putInt("id", id);
<mask> params.putString("data", message);
<mask> params.putString("type", response.contentType() == WebSocket.BINARY ? "binary" : "text");
<mask> sendEvent("websocketMessage", params);
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove public void onPong(Buffer buffer) {
</s> add public void onMessage(WebSocket webSocket, String text) {
WritableMap params = Arguments.createMap();
params.putInt("id", id);
params.putString("data", text);
params.putString("type", "text");
sendEvent("websocketMessage", params); </s> remove Buffer buffer = new Buffer();
client.sendPing(buffer);
} catch (IOException | IllegalStateException e) {
</s> add client.send(ByteString.EMPTY);
} catch (Exception e) { </s> remove client.sendMessage(RequestBody.create(WebSocket.TEXT, message));
} catch (IOException | IllegalStateException e) {
</s> add client.send(message);
} catch (Exception e) { </s> remove client.sendMessage(
RequestBody.create(WebSocket.BINARY, ByteString.decodeBase64(base64String)));
} catch (IOException | IllegalStateException e) {
</s> add client.send(ByteString.decodeBase64(base64String));
} catch (Exception e) { </s> remove public void onMessage(ResponseBody response) throws IOException {
if (response.contentType() != WebSocket.TEXT) {
FLog.w(TAG, "Websocket received unexpected message with payload of type " + response.contentType());
return;
}
</s> add public void onMessage(WebSocket webSocket, String text) {
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.java
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> // This is a programmer error
<mask> throw new RuntimeException("Cannot send a message. Unknown WebSocket id " + id);
<mask> }
<mask> try {
<mask> client.sendMessage(RequestBody.create(WebSocket.TEXT, message));
<mask> } catch (IOException | IllegalStateException e) {
<mask> notifyWebSocketFailed(id, e.getMessage());
<mask> }
<mask> }
<mask>
<mask> @ReactMethod
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove client.sendMessage(
RequestBody.create(WebSocket.BINARY, ByteString.decodeBase64(base64String)));
} catch (IOException | IllegalStateException e) {
</s> add client.send(ByteString.decodeBase64(base64String));
} catch (Exception e) { </s> remove Buffer buffer = new Buffer();
client.sendPing(buffer);
} catch (IOException | IllegalStateException e) {
</s> add client.send(ByteString.EMPTY);
} catch (Exception e) { </s> remove public void onMessage(ResponseBody response) throws IOException {
String message;
try {
if (response.contentType() == WebSocket.BINARY) {
message = Base64.encodeToString(response.source().readByteArray(), Base64.NO_WRAP);
} else {
message = response.source().readUtf8();
}
} catch (IOException e) {
notifyWebSocketFailed(id, e.getMessage());
return;
}
try {
response.source().close();
} catch (IOException e) {
FLog.e(
ReactConstants.TAG,
"Could not close BufferedSource for WebSocket id " + id,
e);
}
</s> add public void onMessage(WebSocket webSocket, ByteString bytes) {
String text = bytes.utf8(); </s> remove } catch (IOException | JSONException e) {
</s> add } catch (JSONException e) { </s> remove } catch (IOException | JSONException e) {
</s> add } catch (JSONException e) { </s> remove mWebSocket.sendMessage(RequestBody.create(WebSocket.TEXT, message));
} catch (IOException e) {
</s> add mWebSocket.send(message);
} catch (Exception e) {
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.java
|
keep keep keep keep replace replace replace keep keep keep keep keep
|
<mask> // This is a programmer error
<mask> throw new RuntimeException("Cannot send a message. Unknown WebSocket id " + id);
<mask> }
<mask> try {
<mask> client.sendMessage(
<mask> RequestBody.create(WebSocket.BINARY, ByteString.decodeBase64(base64String)));
<mask> } catch (IOException | IllegalStateException e) {
<mask> notifyWebSocketFailed(id, e.getMessage());
<mask> }
<mask> }
<mask>
<mask> @ReactMethod
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove client.sendMessage(RequestBody.create(WebSocket.TEXT, message));
} catch (IOException | IllegalStateException e) {
</s> add client.send(message);
} catch (Exception e) { </s> remove Buffer buffer = new Buffer();
client.sendPing(buffer);
} catch (IOException | IllegalStateException e) {
</s> add client.send(ByteString.EMPTY);
} catch (Exception e) { </s> remove public void onMessage(ResponseBody response) throws IOException {
String message;
try {
if (response.contentType() == WebSocket.BINARY) {
message = Base64.encodeToString(response.source().readByteArray(), Base64.NO_WRAP);
} else {
message = response.source().readUtf8();
}
} catch (IOException e) {
notifyWebSocketFailed(id, e.getMessage());
return;
}
try {
response.source().close();
} catch (IOException e) {
FLog.e(
ReactConstants.TAG,
"Could not close BufferedSource for WebSocket id " + id,
e);
}
</s> add public void onMessage(WebSocket webSocket, ByteString bytes) {
String text = bytes.utf8(); </s> remove } catch (IOException | JSONException e) {
</s> add } catch (JSONException e) { </s> remove } catch (IOException | JSONException e) {
</s> add } catch (JSONException e) { </s> remove throw;
</s> add std::rethrow_exception(ptr);
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.java
|
keep keep keep keep replace replace replace keep keep keep keep keep
|
<mask> // This is a programmer error
<mask> throw new RuntimeException("Cannot send a message. Unknown WebSocket id " + id);
<mask> }
<mask> try {
<mask> Buffer buffer = new Buffer();
<mask> client.sendPing(buffer);
<mask> } catch (IOException | IllegalStateException e) {
<mask> notifyWebSocketFailed(id, e.getMessage());
<mask> }
<mask> }
<mask>
<mask> private void notifyWebSocketFailed(int id, String message) {
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove client.sendMessage(RequestBody.create(WebSocket.TEXT, message));
} catch (IOException | IllegalStateException e) {
</s> add client.send(message);
} catch (Exception e) { </s> remove client.sendMessage(
RequestBody.create(WebSocket.BINARY, ByteString.decodeBase64(base64String)));
} catch (IOException | IllegalStateException e) {
</s> add client.send(ByteString.decodeBase64(base64String));
} catch (Exception e) { </s> remove public void onMessage(ResponseBody response) throws IOException {
String message;
try {
if (response.contentType() == WebSocket.BINARY) {
message = Base64.encodeToString(response.source().readByteArray(), Base64.NO_WRAP);
} else {
message = response.source().readUtf8();
}
} catch (IOException e) {
notifyWebSocketFailed(id, e.getMessage());
return;
}
try {
response.source().close();
} catch (IOException e) {
FLog.e(
ReactConstants.TAG,
"Could not close BufferedSource for WebSocket id " + id,
e);
}
</s> add public void onMessage(WebSocket webSocket, ByteString bytes) {
String text = bytes.utf8(); </s> remove } catch (IOException | JSONException e) {
</s> add } catch (JSONException e) { </s> remove } catch (IOException | JSONException e) {
</s> add } catch (JSONException e) { </s> remove handleProxyMessage(new JSONObject(message.string()));
} catch (JSONException e) {
throw new IOException(e);
} finally {
message.close();
</s> add handleProxyMessage(new JSONObject(text));
} catch (Exception e) {
throw new RuntimeException(e);
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.java
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> include_defs("//ReactAndroid/DEFS")
<mask>
<mask> android_library(
<mask> name = "packagerconnection",
<mask> srcs = glob(["**/*.java"]),
<mask> visibility = [
<mask> "PUBLIC",
<mask> ],
<mask> deps = [
<mask> react_native_dep("libraries/fbcore/src/main/java/com/facebook/common/logging:logging"),
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> add react_native_dep("java/com/facebook/jni:jni"),
react_native_dep("java/com/facebook/proguard/annotations:annotations"), </s> remove exported_headers = [
"CxxModule.h",
"JsArgumentHelpers.h",
"JsArgumentHelpers-inl.h",
</s> add exported_headers = subdir_glob(
[
("", "CxxModule.h"),
("", "JsArgumentHelpers.h"),
("", "JsArgumentHelpers-inl.h"),
],
prefix = "cxxreact",
),
force_static = True,
header_namespace = "",
visibility = [
"PUBLIC",
],
xcode_public_headers_symlinks = True,
deps = [
"//xplat/folly:molly",
],
)
rn_xplat_cxx_library(
name = "jsbigstring",
srcs = [
"JSBigString.cpp", </s> add compiler_flags = CXX_LIBRARY_COMPILER_FLAGS + [
"-fexceptions",
"-frtti",
],
exported_headers = subdir_glob(
[("", "JSBigString.h")],
prefix = "cxxreact",
), </s> remove srcs = [
"Dummy.cpp",
],
</s> add srcs = glob(["*.cpp"]),
headers = glob(
["*.h"],
excludes = EXPORTED_HEADERS,
), </s> remove header_namespace = "cxxreact",
labels = ["accounts_for_platform_and_build_mode_flags"],
</s> add header_namespace = "", </s> remove deps = [
react_native_target("jni/xreact/jni:jni"),
],
</s> add xcode_public_headers_symlinks = True,
deps = ([
"//native/third-party/android-ndk:android",
"//xplat/folly:molly",
"//xplat/fbgloginit:fbgloginit",
"//xplat/fbsystrace:fbsystrace",
react_native_xplat_target("cxxreact:bridge"),
react_native_xplat_target("cxxreact:module"),
FBJNI_TARGET,
] + JSC_DEPS) if not IS_OSS_BUILD else [],
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/BUCK
|
keep keep keep add keep keep keep keep
|
<mask> visibility = [
<mask> "PUBLIC",
<mask> ],
<mask> deps = [
<mask> react_native_dep("libraries/fbcore/src/main/java/com/facebook/common/logging:logging"),
<mask> react_native_dep("libraries/soloader/java/com/facebook/soloader:soloader"),
<mask> react_native_dep("third-party/java/infer-annotations:infer-annotations"),
<mask> react_native_dep("third-party/java/jsr-305:jsr-305"),
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove react_native_target("java/com/facebook/react/bridge:bridge"),
</s> add </s> remove srcs = glob(["**/*.java"]),
</s> add srcs = glob(
["**/*.java"],
excludes = ["SamplingProfilerPackagerMethod.java"] if IS_OSS_BUILD else [],
), </s> remove header_namespace = "cxxreact",
labels = ["accounts_for_platform_and_build_mode_flags"],
</s> add header_namespace = "", </s> remove deps = [
react_native_target("jni/xreact/jni:jni"),
],
</s> add xcode_public_headers_symlinks = True,
deps = ([
"//native/third-party/android-ndk:android",
"//xplat/folly:molly",
"//xplat/fbgloginit:fbgloginit",
"//xplat/fbsystrace:fbsystrace",
react_native_xplat_target("cxxreact:bridge"),
react_native_xplat_target("cxxreact:module"),
FBJNI_TARGET,
] + JSC_DEPS) if not IS_OSS_BUILD else [], </s> remove exported_headers = [
"CxxModule.h",
"JsArgumentHelpers.h",
"JsArgumentHelpers-inl.h",
</s> add exported_headers = subdir_glob(
[
("", "CxxModule.h"),
("", "JsArgumentHelpers.h"),
("", "JsArgumentHelpers-inl.h"),
],
prefix = "cxxreact",
),
force_static = True,
header_namespace = "",
visibility = [
"PUBLIC",
],
xcode_public_headers_symlinks = True,
deps = [
"//xplat/folly:molly",
],
)
rn_xplat_cxx_library(
name = "jsbigstring",
srcs = [
"JSBigString.cpp", </s> add compiler_flags = CXX_LIBRARY_COMPILER_FLAGS + [
"-fexceptions",
"-frtti",
],
exported_headers = subdir_glob(
[("", "JSBigString.h")],
prefix = "cxxreact",
),
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/BUCK
|
keep keep add keep keep keep keep keep keep
|
<mask> react_native_dep("java/com/facebook/jni:jni"),
<mask> react_native_dep("java/com/facebook/proguard/annotations:annotations"),
<mask> react_native_dep("libraries/fbcore/src/main/java/com/facebook/common/logging:logging"),
<mask> react_native_dep("third-party/java/infer-annotations:infer-annotations"),
<mask> react_native_dep("third-party/java/jsr-305:jsr-305"),
<mask> react_native_dep("third-party/java/okhttp:okhttp3"),
<mask> react_native_dep("third-party/java/okio:okio"),
<mask> react_native_target("java/com/facebook/react/modules/systeminfo:systeminfo-moduleless"),
<mask> ] + ([react_native_target("jni/packagerconnection:jni")] if not IS_OSS_BUILD else []),
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove ],
</s> add ] + ([react_native_target("jni/packagerconnection:jni")] if not IS_OSS_BUILD else []), </s> remove react_native_dep("third-party/java/okhttp:okhttp3-ws"),
</s> add </s> add react_native_dep("java/com/facebook/jni:jni"),
react_native_dep("java/com/facebook/proguard/annotations:annotations"), </s> remove react_native_dep("third-party/java/okhttp:okhttp3-ws"),
</s> add </s> remove react_native_dep("third-party/java/okhttp:okhttp3-ws"),
</s> add </s> remove react_native_dep("third-party/java/okhttp:okhttp3-ws"),
</s> add react_native_dep("third-party/java/okio:okio"),
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/BUCK
|
keep keep keep keep replace keep keep replace
|
<mask> react_native_dep("libraries/fbcore/src/main/java/com/facebook/common/logging:logging"),
<mask> react_native_dep("third-party/java/infer-annotations:infer-annotations"),
<mask> react_native_dep("third-party/java/jsr-305:jsr-305"),
<mask> react_native_dep("third-party/java/okhttp:okhttp3"),
<mask> react_native_dep("third-party/java/okhttp:okhttp3-ws"),
<mask> react_native_dep("third-party/java/okio:okio"),
<mask> react_native_target("java/com/facebook/react/modules/systeminfo:systeminfo-moduleless"),
<mask> ],
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove react_native_dep("third-party/java/okhttp:okhttp3-ws"),
</s> add </s> remove react_native_dep("third-party/java/okhttp:okhttp3-ws"),
</s> add </s> add react_native_dep("libraries/soloader/java/com/facebook/soloader:soloader"), </s> remove react_native_dep("third-party/java/okhttp:okhttp3-ws"),
</s> add react_native_dep("third-party/java/okio:okio"), </s> remove react_native_dep("third-party/java/okhttp:okhttp3-ws"),
</s> add
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/BUCK
|
keep keep keep keep replace replace replace keep keep keep keep keep
|
<mask>
<mask> import com.facebook.common.logging.FLog;
<mask> import com.facebook.react.modules.systeminfo.AndroidInfoHelpers;
<mask>
<mask> import okhttp3.RequestBody;
<mask> import okhttp3.ResponseBody;
<mask> import okhttp3.ws.WebSocket;
<mask>
<mask> import org.json.JSONObject;
<mask>
<mask> /**
<mask> * A client for packager that uses WebSocket connection.
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove import okhttp3.ResponseBody;
import okhttp3.ws.WebSocket;
import okhttp3.ws.WebSocketCall;
import okhttp3.ws.WebSocketListener;
import okio.Buffer;
</s> add import okhttp3.WebSocket;
import okhttp3.WebSocketListener;
import okio.ByteString; </s> remove import okhttp3.ResponseBody;
import okhttp3.ws.WebSocket;
import okhttp3.ws.WebSocketCall;
import okhttp3.ws.WebSocketListener;
import okio.Buffer;
</s> add import okhttp3.WebSocket;
import okhttp3.WebSocketListener; </s> remove import okhttp3.RequestBody;
</s> add </s> remove import okhttp3.ResponseBody;
import okhttp3.ws.WebSocket;
import okhttp3.ws.WebSocketCall;
import okhttp3.ws.WebSocketListener;
import okio.Buffer;
</s> add import okhttp3.WebSocket;
import okhttp3.WebSocketListener; </s> remove import okio.Buffer;
import okio.BufferedSource;
</s> add </s> remove import okhttp3.RequestBody;
</s> add
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/JSPackagerClient.java
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> JSONObject message = new JSONObject();
<mask> message.put("version", PROTOCOL_VERSION);
<mask> message.put("id", mId);
<mask> message.put("result", result);
<mask> mWebSocket.sendMessage(RequestBody.create(WebSocket.TEXT, message.toString()));
<mask> } catch (Exception e) {
<mask> FLog.e(TAG, "Responding failed", e);
<mask> }
<mask> }
<mask>
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove mWebSocket.sendMessage(RequestBody.create(WebSocket.TEXT, message.toString()));
</s> add mWebSocket.sendMessage(message.toString()); </s> remove } finally {
response.close();
</s> add </s> remove mWebSocket.sendMessage(RequestBody.create(WebSocket.TEXT, message));
} catch (IOException e) {
</s> add mWebSocket.send(message);
} catch (Exception e) { </s> remove } catch (JSONException | IOException e) {
</s> add } catch (JSONException e) { </s> remove public void send(JSONObject object) throws IOException {
if (mWebSocket == null) {
return;
}
mWebSocket.sendMessage(RequestBody.create(WebSocket.TEXT, object.toString()));
</s> add public void send(final JSONObject object) {
new AsyncTask<WebSocket, Void, Void>() {
@Override
protected Void doInBackground(WebSocket... sockets) {
if (sockets == null || sockets.length == 0) {
return null;
}
try {
sockets[0].send(object.toString());
} catch (Exception e) {
FLog.w(TAG, "Couldn't send event to packager", e);
}
return null;
}
}.execute(mWebSocket); </s> add @Override
public void onMessage(ByteString bytes) {
FLog.w(TAG, "Websocket received message with payload of unexpected type binary");
}
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/JSPackagerClient.java
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> JSONObject message = new JSONObject();
<mask> message.put("version", PROTOCOL_VERSION);
<mask> message.put("id", mId);
<mask> message.put("error", error);
<mask> mWebSocket.sendMessage(RequestBody.create(WebSocket.TEXT, message.toString()));
<mask> } catch (Exception e) {
<mask> FLog.e(TAG, "Responding with error failed", e);
<mask> }
<mask> }
<mask> }
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove mWebSocket.sendMessage(RequestBody.create(WebSocket.TEXT, message.toString()));
</s> add mWebSocket.sendMessage(message.toString()); </s> remove } finally {
response.close();
</s> add </s> remove mWebSocket.sendMessage(RequestBody.create(WebSocket.TEXT, message));
} catch (IOException e) {
</s> add mWebSocket.send(message);
} catch (Exception e) { </s> remove } catch (JSONException | IOException e) {
</s> add } catch (JSONException e) { </s> add @Override
public void onMessage(ByteString bytes) {
FLog.w(TAG, "Websocket received message with payload of unexpected type binary");
}
</s> remove public void send(JSONObject object) throws IOException {
if (mWebSocket == null) {
return;
}
mWebSocket.sendMessage(RequestBody.create(WebSocket.TEXT, object.toString()));
</s> add public void send(final JSONObject object) {
new AsyncTask<WebSocket, Void, Void>() {
@Override
protected Void doInBackground(WebSocket... sockets) {
if (sockets == null || sockets.length == 0) {
return null;
}
try {
sockets[0].send(object.toString());
} catch (Exception e) {
FLog.w(TAG, "Couldn't send event to packager", e);
}
return null;
}
}.execute(mWebSocket);
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/JSPackagerClient.java
|
keep keep keep keep replace replace replace replace replace replace replace replace keep replace keep keep keep
|
<mask> mWebSocket.closeQuietly();
<mask> }
<mask>
<mask> @Override
<mask> public void onMessage(ResponseBody response) {
<mask> if (response.contentType() != WebSocket.TEXT) {
<mask> FLog.w(
<mask> TAG,
<mask> "Websocket received message with payload of unexpected type " + response.contentType());
<mask> return;
<mask> }
<mask>
<mask> try {
<mask> JSONObject message = new JSONObject(response.string());
<mask>
<mask> int version = message.optInt("version");
<mask> String method = message.optString("method");
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove public void onMessage(ResponseBody response) throws IOException {
if (response.contentType() != WebSocket.TEXT) {
FLog.w(TAG, "Websocket received unexpected message with payload of type " + response.contentType());
return;
}
</s> add public void onMessage(WebSocket webSocket, String text) { </s> add @Override
public void onMessage(ByteString bytes) {
FLog.w(TAG, "Websocket received message with payload of unexpected type binary");
}
</s> remove public void onMessage(ResponseBody response) throws IOException {
String message;
try {
if (response.contentType() == WebSocket.BINARY) {
message = Base64.encodeToString(response.source().readByteArray(), Base64.NO_WRAP);
} else {
message = response.source().readUtf8();
}
} catch (IOException e) {
notifyWebSocketFailed(id, e.getMessage());
return;
}
try {
response.source().close();
} catch (IOException e) {
FLog.e(
ReactConstants.TAG,
"Could not close BufferedSource for WebSocket id " + id,
e);
}
</s> add public void onMessage(WebSocket webSocket, ByteString bytes) {
String text = bytes.utf8(); </s> remove public void downloadBundleFromURL(final BundleDownloadCallback callback, final File outputFile, final String bundleURL) {
final Request request = new Request.Builder().url(bundleURL).addHeader("Accept", "multipart/mixed").build();
mDownloadBundleFromURLCall = Assertions.assertNotNull(mClient.newCall(request));
mDownloadBundleFromURLCall.enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
// ignore callback if call was cancelled
if (mDownloadBundleFromURLCall == null || mDownloadBundleFromURLCall.isCanceled()) {
mDownloadBundleFromURLCall = null;
return;
}
mDownloadBundleFromURLCall = null;
callback.onFailure(DebugServerException.makeGeneric("Could not connect to development server.", "URL: " + call.request().url().toString(), e));
}
@Override
public void onResponse(Call call, final Response response) throws IOException {
// ignore callback if call was cancelled
if (mDownloadBundleFromURLCall == null || mDownloadBundleFromURLCall.isCanceled()) {
mDownloadBundleFromURLCall = null;
return;
}
mDownloadBundleFromURLCall = null;
final String url = response.request().url().toString();
// Make sure the result is a multipart response and parse the boundary.
String contentType = response.header("content-type");
Pattern regex = Pattern.compile("multipart/mixed;.*boundary=\"([^\"]+)\"");
Matcher match = regex.matcher(contentType);
if (match.find()) {
String boundary = match.group(1);
MultipartStreamReader bodyReader = new MultipartStreamReader(response.body().source(), boundary);
boolean completed = bodyReader.readAllParts(new MultipartStreamReader.ChunkCallback() {
@Override
public void execute(Map<String, String> headers, Buffer body, boolean finished) throws IOException {
// encoded as JSON.
if (finished) {
// The http status code for each separate chunk is in the X-Http-Status header.
int status = response.code();
if (headers.containsKey("X-Http-Status")) {
status = Integer.parseInt(headers.get("X-Http-Status"));
}
processBundleResult(url, status, body, outputFile, callback);
} else {
if (!headers.containsKey("Content-Type") || !headers.get("Content-Type").equals("application/json")) {
return;
}
try {
JSONObject progress = new JSONObject(body.readUtf8());
String status = null;
if (progress.has("status")) {
status = progress.getString("status");
}
Integer done = null;
if (progress.has("done")) {
done = progress.getInt("done");
}
Integer total = null;
if (progress.has("total")) {
total = progress.getInt("total");
}
callback.onProgress(status, done, total);
} catch (JSONException e) {
FLog.e(ReactConstants.TAG, "Error parsing progress JSON. " + e.toString());
}
}
}
});
if (!completed) {
callback.onFailure(new DebugServerException("Error while reading multipart response.\n\nResponse code: " + response.code() + "\n\n" + "URL: " + call.request().url().toString() + "\n\n"));
}
} else {
/**
* In case the server doesn't support multipart/mixed responses,
* fallback to normal download.
*/
processBundleResult(url, response.code(), Okio.buffer(response.body().source()), outputFile, callback);
}
}
});
}
private void processBundleResult(String url, int statusCode, BufferedSource body, File outputFile, BundleDownloadCallback callback) throws IOException {
// Check for server errors. If the server error has the expected form, fail with more info.
if (statusCode != 200) {
String bodyString = body.readUtf8();
DebugServerException debugServerException = DebugServerException.parse(bodyString);
if (debugServerException != null) {
callback.onFailure(debugServerException);
} else {
StringBuilder sb = new StringBuilder();
sb.append("The development server returned response error code: ").append(statusCode).append("\n\n").append("URL: ").append(url).append("\n\n").append("Body:\n").append(bodyString);
callback.onFailure(new DebugServerException(sb.toString()));
}
return;
}
Sink output = null;
try {
output = Okio.sink(outputFile);
body.readAll(output);
callback.onSuccess();
} finally {
if (output != null) {
output.close();
}
}
}
public void cancelDownloadBundleFromURL() {
if (mDownloadBundleFromURLCall != null) {
mDownloadBundleFromURLCall.cancel();
mDownloadBundleFromURLCall = null;
}
}
</s> add </s> remove mWebSocket.sendMessage(RequestBody.create(WebSocket.TEXT, message.toString()));
</s> add mWebSocket.sendMessage(message.toString());
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/JSPackagerClient.java
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> handler.onRequest(params, new ResponderImpl(id));
<mask> }
<mask> } catch (Exception e) {
<mask> FLog.e(TAG, "Handling the message failed", e);
<mask> } finally {
<mask> response.close();
<mask> }
<mask> }
<mask>
<mask> private void abortOnMessage(Object id, String reason) {
<mask> if (id != null) {
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> add @Override
public void onMessage(ByteString bytes) {
FLog.w(TAG, "Websocket received message with payload of unexpected type binary");
}
</s> remove } finally {
response.close();
</s> add </s> remove mWebSocket.sendMessage(RequestBody.create(WebSocket.TEXT, message.toString()));
</s> add mWebSocket.sendMessage(message.toString()); </s> remove mWebSocket.sendMessage(RequestBody.create(WebSocket.TEXT, message.toString()));
</s> add mWebSocket.sendMessage(message.toString()); </s> remove mWebSocket.sendMessage(RequestBody.create(WebSocket.TEXT, message));
} catch (IOException e) {
</s> add mWebSocket.send(message);
} catch (Exception e) { </s> remove Buffer buffer = new Buffer();
client.sendPing(buffer);
} catch (IOException | IllegalStateException e) {
</s> add client.send(ByteString.EMPTY);
} catch (Exception e) {
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/JSPackagerClient.java
|
keep keep keep add keep keep keep keep keep
|
<mask> FLog.e(TAG, "Handling the message failed", e);
<mask> }
<mask> }
<mask>
<mask> private void abortOnMessage(Object id, String reason) {
<mask> if (id != null) {
<mask> (new ResponderImpl(id)).error(reason);
<mask> }
<mask>
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove } finally {
response.close();
</s> add </s> remove mWebSocket.sendMessage(RequestBody.create(WebSocket.TEXT, message.toString()));
</s> add mWebSocket.sendMessage(message.toString()); </s> remove mWebSocket.sendMessage(RequestBody.create(WebSocket.TEXT, message.toString()));
</s> add mWebSocket.sendMessage(message.toString()); </s> remove } finally {
response.close();
</s> add </s> remove public synchronized void onClose(int code, String reason) {
</s> add public synchronized void onClosed(WebSocket webSocket, int code, String reason) { </s> remove public synchronized void onPong(Buffer payload) { }
</s> add public synchronized void onMessage(WebSocket webSocket, ByteString bytes) {
if (mMessageCallback != null) {
mMessageCallback.onMessage(bytes);
}
}
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/JSPackagerClient.java
|
keep keep keep replace keep replace replace replace replace replace keep
|
<mask>
<mask> import okhttp3.OkHttpClient;
<mask> import okhttp3.Request;
<mask> import okhttp3.RequestBody;
<mask> import okhttp3.Response;
<mask> import okhttp3.ResponseBody;
<mask> import okhttp3.ws.WebSocket;
<mask> import okhttp3.ws.WebSocketCall;
<mask> import okhttp3.ws.WebSocketListener;
<mask> import okio.Buffer;
<mask>
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove import okhttp3.RequestBody;
</s> add </s> remove import okhttp3.RequestBody;
</s> add </s> remove import okhttp3.RequestBody;
</s> add </s> remove import okhttp3.ResponseBody;
import okhttp3.ws.WebSocket;
import okhttp3.ws.WebSocketCall;
import okhttp3.ws.WebSocketListener;
import okio.Buffer;
</s> add import okhttp3.WebSocket;
import okhttp3.WebSocketListener; </s> remove import okhttp3.ResponseBody;
import okhttp3.ws.WebSocket;
import okhttp3.ws.WebSocketCall;
import okhttp3.ws.WebSocketListener;
import okio.Buffer;
</s> add import okhttp3.WebSocket;
import okhttp3.WebSocketListener;
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/ReconnectingWebSocket.java
|
keep keep keep keep replace keep keep keep keep keep
|
<mask>
<mask> /**
<mask> * A wrapper around WebSocketClient that reconnects automatically
<mask> */
<mask> final public class ReconnectingWebSocket implements WebSocketListener {
<mask> private static final String TAG = ReconnectingWebSocket.class.getSimpleName();
<mask>
<mask> private static final int RECONNECT_DELAY_MS = 2000;
<mask>
<mask> public interface MessageCallback {
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove public class JSDebuggerWebSocketClient implements WebSocketListener {
</s> add public class JSDebuggerWebSocketClient extends WebSocketListener { </s> remove import okhttp3.ResponseBody;
import okhttp3.ws.WebSocket;
import okhttp3.ws.WebSocketCall;
import okhttp3.ws.WebSocketListener;
import okio.Buffer;
</s> add import okhttp3.WebSocket;
import okhttp3.WebSocketListener;
import okio.ByteString; </s> remove private class Connection implements WebSocketListener {
</s> add private class Connection extends WebSocketListener { </s> remove void onMessage(ResponseBody message);
</s> add void onMessage(String text);
void onMessage(ByteString bytes); </s> remove import okhttp3.ResponseBody;
import okhttp3.ws.WebSocket;
import okhttp3.ws.WebSocketCall;
import okhttp3.ws.WebSocketListener;
import okio.Buffer;
</s> add import okhttp3.WebSocket;
import okhttp3.WebSocketListener; </s> add private OkHttpClient mHttpClient;
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/ReconnectingWebSocket.java
|
keep keep keep keep replace keep keep keep keep keep
|
<mask>
<mask> private static final int RECONNECT_DELAY_MS = 2000;
<mask>
<mask> public interface MessageCallback {
<mask> void onMessage(ResponseBody message);
<mask> }
<mask>
<mask> public interface ConnectionCallback {
<mask> void onConnected();
<mask> void onDisconnected();
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove final public class ReconnectingWebSocket implements WebSocketListener {
</s> add final public class ReconnectingWebSocket extends WebSocketListener { </s> remove public interface BundleDownloadCallback {
void onSuccess();
void onProgress(@Nullable String status, @Nullable Integer done, @Nullable Integer total);
void onFailure(Exception cause);
}
</s> add </s> remove void onCaptureHeapCommand(@Nullable final Responder responder);
</s> add void onCaptureHeapCommand(final Responder responder); </s> remove private class Connection implements WebSocketListener {
</s> add private class Connection extends WebSocketListener { </s> remove public class JSDebuggerWebSocketClient implements WebSocketListener {
</s> add public class JSDebuggerWebSocketClient extends WebSocketListener { </s> remove void onPokeSamplingProfilerCommand(@Nullable final Responder responder);
</s> add void onPokeSamplingProfilerCommand(final Responder responder);
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/ReconnectingWebSocket.java
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> .readTimeout(0, TimeUnit.MINUTES) // Disable timeouts for read
<mask> .build();
<mask>
<mask> Request request = new Request.Builder().url(mUrl).build();
<mask> WebSocketCall call = WebSocketCall.create(httpClient, request);
<mask> call.enqueue(this);
<mask> }
<mask>
<mask> private synchronized void delayedReconnect() {
<mask> // check that we haven't been closed in the meantime
<mask> if (!mClosed) {
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove WebSocketCall call = WebSocketCall.create(httpClient, request);
call.enqueue(this);
</s> add mHttpClient.newWebSocket(request, this); </s> remove OkHttpClient httpClient = new OkHttpClient.Builder()
.connectTimeout(10, TimeUnit.SECONDS)
.writeTimeout(10, TimeUnit.SECONDS)
.readTimeout(0, TimeUnit.MINUTES) // Disable timeouts for read
.build();
</s> add if (mHttpClient == null) {
mHttpClient = new OkHttpClient.Builder()
.connectTimeout(10, TimeUnit.SECONDS)
.writeTimeout(10, TimeUnit.SECONDS)
.readTimeout(0, TimeUnit.MINUTES) // Disable timeouts for read
.build();
} </s> remove WebSocketCall call = WebSocketCall.create(mHttpClient, request);
call.enqueue(this);
</s> add mHttpClient.newWebSocket(request, this); </s> remove private static final Matrix sMatrix = new Matrix();
private static final Matrix sInverse = new Matrix();
</s> add </s> remove public void downloadBundleFromURL(final BundleDownloadCallback callback, final File outputFile, final String bundleURL) {
final Request request = new Request.Builder().url(bundleURL).addHeader("Accept", "multipart/mixed").build();
mDownloadBundleFromURLCall = Assertions.assertNotNull(mClient.newCall(request));
mDownloadBundleFromURLCall.enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
// ignore callback if call was cancelled
if (mDownloadBundleFromURLCall == null || mDownloadBundleFromURLCall.isCanceled()) {
mDownloadBundleFromURLCall = null;
return;
}
mDownloadBundleFromURLCall = null;
callback.onFailure(DebugServerException.makeGeneric("Could not connect to development server.", "URL: " + call.request().url().toString(), e));
}
@Override
public void onResponse(Call call, final Response response) throws IOException {
// ignore callback if call was cancelled
if (mDownloadBundleFromURLCall == null || mDownloadBundleFromURLCall.isCanceled()) {
mDownloadBundleFromURLCall = null;
return;
}
mDownloadBundleFromURLCall = null;
final String url = response.request().url().toString();
// Make sure the result is a multipart response and parse the boundary.
String contentType = response.header("content-type");
Pattern regex = Pattern.compile("multipart/mixed;.*boundary=\"([^\"]+)\"");
Matcher match = regex.matcher(contentType);
if (match.find()) {
String boundary = match.group(1);
MultipartStreamReader bodyReader = new MultipartStreamReader(response.body().source(), boundary);
boolean completed = bodyReader.readAllParts(new MultipartStreamReader.ChunkCallback() {
@Override
public void execute(Map<String, String> headers, Buffer body, boolean finished) throws IOException {
// encoded as JSON.
if (finished) {
// The http status code for each separate chunk is in the X-Http-Status header.
int status = response.code();
if (headers.containsKey("X-Http-Status")) {
status = Integer.parseInt(headers.get("X-Http-Status"));
}
processBundleResult(url, status, body, outputFile, callback);
} else {
if (!headers.containsKey("Content-Type") || !headers.get("Content-Type").equals("application/json")) {
return;
}
try {
JSONObject progress = new JSONObject(body.readUtf8());
String status = null;
if (progress.has("status")) {
status = progress.getString("status");
}
Integer done = null;
if (progress.has("done")) {
done = progress.getInt("done");
}
Integer total = null;
if (progress.has("total")) {
total = progress.getInt("total");
}
callback.onProgress(status, done, total);
} catch (JSONException e) {
FLog.e(ReactConstants.TAG, "Error parsing progress JSON. " + e.toString());
}
}
}
});
if (!completed) {
callback.onFailure(new DebugServerException("Error while reading multipart response.\n\nResponse code: " + response.code() + "\n\n" + "URL: " + call.request().url().toString() + "\n\n"));
}
} else {
/**
* In case the server doesn't support multipart/mixed responses,
* fallback to normal download.
*/
processBundleResult(url, response.code(), Okio.buffer(response.body().source()), outputFile, callback);
}
}
});
}
private void processBundleResult(String url, int statusCode, BufferedSource body, File outputFile, BundleDownloadCallback callback) throws IOException {
// Check for server errors. If the server error has the expected form, fail with more info.
if (statusCode != 200) {
String bodyString = body.readUtf8();
DebugServerException debugServerException = DebugServerException.parse(bodyString);
if (debugServerException != null) {
callback.onFailure(debugServerException);
} else {
StringBuilder sb = new StringBuilder();
sb.append("The development server returned response error code: ").append(statusCode).append("\n\n").append("URL: ").append(url).append("\n\n").append("Body:\n").append(bodyString);
callback.onFailure(new DebugServerException(sb.toString()));
}
return;
}
Sink output = null;
try {
output = Okio.sink(outputFile);
body.readAll(output);
callback.onSuccess();
} finally {
if (output != null) {
output.close();
}
}
}
public void cancelDownloadBundleFromURL() {
if (mDownloadBundleFromURLCall != null) {
mDownloadBundleFromURLCall.cancel();
mDownloadBundleFromURLCall = null;
}
}
</s> add </s> remove // If the file name of a stack frame is numeric (+ ".js"), we assume it's a lazily injected module
// coming from a "random access bundle". We are using special source maps for these bundles, so
// that we can symbolicate stack traces for multiple injected files with a single source map.
// We have to include the module id in the stack for that, though. The ".js" suffix is kept to
// avoid ambiguities between "module-id:line" and "line:column".
private static String stackFrameToModuleId(ReadableMap frame) {
if (frame.hasKey("file") && !frame.isNull("file") && frame.getType("file") == ReadableType.String) {
final Matcher matcher = mJsModuleIdPattern.matcher(frame.getString("file"));
if (matcher.find()) {
return matcher.group(1) + ":";
}
}
return "";
}
private String stackTraceToString(String message, ReadableArray stack) {
StringBuilder stringBuilder = new StringBuilder(message).append(", stack:\n");
for (int i = 0; i < stack.size(); i++) {
ReadableMap frame = stack.getMap(i);
stringBuilder.append(frame.getString("methodName")).append("@").append(stackFrameToModuleId(frame)).append(frame.getInt("lineNumber"));
if (frame.hasKey("column") && !frame.isNull("column") && frame.getType("column") == ReadableType.Number) {
stringBuilder.append(":").append(frame.getInt("column"));
}
stringBuilder.append("\n");
}
return stringBuilder.toString();
}
</s> add
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/ReconnectingWebSocket.java
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> private void closeWebSocketQuietly() {
<mask> if (mWebSocket != null) {
<mask> try {
<mask> mWebSocket.close(1000, "End of session");
<mask> } catch (IOException e) {
<mask> // swallow, no need to handle it here
<mask> }
<mask> mWebSocket = null;
<mask> }
<mask> }
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/ReconnectingWebSocket.java
|
keep keep keep replace keep replace keep keep keep keep
|
<mask> }
<mask>
<mask> @Override
<mask> public synchronized void onFailure(IOException e, Response response) {
<mask> if (mWebSocket != null) {
<mask> abort("Websocket exception", e);
<mask> }
<mask> if (!mClosed) {
<mask> if (mConnectionCallback != null) {
<mask> mConnectionCallback.onDisconnected();
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove abort("Websocket exception", e);
</s> add abort("Websocket exception", t); </s> remove public void onFailure(IOException e, Response response) {
</s> add public void onFailure(WebSocket webSocket, Throwable t, Response response) { </s> remove public void onFailure(IOException e, Response response) {
abort("Websocket exception", e);
</s> add public void onFailure(WebSocket webSocket, Throwable t, Response response) {
abort("Websocket exception", t); </s> remove public synchronized void onClose(int code, String reason) {
</s> add public synchronized void onClosed(WebSocket webSocket, int code, String reason) { </s> remove } finally {
response.close();
</s> add
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/ReconnectingWebSocket.java
|
keep keep keep replace keep keep keep keep keep keep keep keep replace keep keep keep
|
<mask> }
<mask>
<mask> @Override
<mask> public synchronized void onMessage(ResponseBody message) {
<mask> if (mMessageCallback != null) {
<mask> mMessageCallback.onMessage(message);
<mask> }
<mask> }
<mask>
<mask> @Override
<mask> public synchronized void onMessage(ResponseBody message) {
<mask> if (mMessageCallback != null) {
<mask> mMessageCallback.onMessage(message);
<mask> }
<mask> }
<mask>
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove public synchronized void onPong(Buffer payload) { }
</s> add public synchronized void onMessage(WebSocket webSocket, ByteString bytes) {
if (mMessageCallback != null) {
mMessageCallback.onMessage(bytes);
}
} </s> remove public synchronized void sendMessage(RequestBody message) throws IOException {
</s> add public synchronized void sendMessage(String message) throws IOException {
if (mWebSocket != null) {
mWebSocket.send(message);
} else {
throw new ClosedChannelException();
}
}
public synchronized void sendMessage(ByteString message) throws IOException { </s> remove mWebSocket.sendMessage(message);
</s> add mWebSocket.send(message); </s> remove public synchronized void onFailure(IOException e, Response response) {
</s> add public synchronized void onFailure(WebSocket webSocket, Throwable t, Response response) { </s> remove public synchronized void onClose(int code, String reason) {
</s> add public synchronized void onClosed(WebSocket webSocket, int code, String reason) {
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/ReconnectingWebSocket.java
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> }
<mask> }
<mask>
<mask> @Override
<mask> public synchronized void onPong(Buffer payload) { }
<mask>
<mask> @Override
<mask> public synchronized void onClose(int code, String reason) {
<mask> mWebSocket = null;
<mask> if (!mClosed) {
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove public synchronized void onClose(int code, String reason) {
</s> add public synchronized void onClosed(WebSocket webSocket, int code, String reason) { </s> remove public void onPong(Buffer payload) {
}
@Override
public void onClose(int code, String reason) {
</s> add public void onClosed(WebSocket webSocket, int code, String reason) { </s> remove public void onClose(int code, String reason) {
</s> add public void onClosed(WebSocket webSocket, int code, String reason) { </s> remove @Override
public void onPong(Buffer payload) {
// ignore
}
</s> add </s> remove mMessageCallback.onMessage(message);
</s> add mMessageCallback.onMessage(text); </s> remove public void onClose(int code, String reason) {
</s> add public void onClosed(WebSocket webSocket, int code, String reason) {
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/ReconnectingWebSocket.java
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> @Override
<mask> public synchronized void onPong(Buffer payload) { }
<mask>
<mask> @Override
<mask> public synchronized void onClose(int code, String reason) {
<mask> mWebSocket = null;
<mask> if (!mClosed) {
<mask> if (mConnectionCallback != null) {
<mask> mConnectionCallback.onDisconnected();
<mask> }
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove public synchronized void onPong(Buffer payload) { }
</s> add public synchronized void onMessage(WebSocket webSocket, ByteString bytes) {
if (mMessageCallback != null) {
mMessageCallback.onMessage(bytes);
}
} </s> remove public void onPong(Buffer payload) {
}
@Override
public void onClose(int code, String reason) {
</s> add public void onClosed(WebSocket webSocket, int code, String reason) { </s> remove public void onClose(int code, String reason) {
</s> add public void onClosed(WebSocket webSocket, int code, String reason) { </s> remove mMessageCallback.onMessage(message);
</s> add mMessageCallback.onMessage(text); </s> remove abort("Websocket exception", e);
</s> add abort("Websocket exception", t); </s> remove @Override
public void onPong(Buffer payload) {
// ignore
}
</s> add
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/ReconnectingWebSocket.java
|
keep keep replace keep replace keep
|
<mask> }
<mask>
<mask> public synchronized void sendMessage(RequestBody message) throws IOException {
<mask> if (mWebSocket != null) {
<mask> mWebSocket.sendMessage(message);
<mask> } else {
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove public synchronized void onMessage(ResponseBody message) {
</s> add public synchronized void onMessage(WebSocket webSocket, String text) { </s> remove mMessageCallback.onMessage(message);
</s> add mMessageCallback.onMessage(text); </s> remove public synchronized void onFailure(IOException e, Response response) {
</s> add public synchronized void onFailure(WebSocket webSocket, Throwable t, Response response) { </s> remove abort("Websocket exception", e);
</s> add abort("Websocket exception", t); </s> remove public synchronized void onPong(Buffer payload) { }
</s> add public synchronized void onMessage(WebSocket webSocket, ByteString bytes) {
if (mMessageCallback != null) {
mMessageCallback.onMessage(bytes);
}
}
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/ReconnectingWebSocket.java
|
keep keep keep add keep keep keep keep keep
|
<mask> * of patent rights can be found in the PATENTS file in the same directory.
<mask> */
<mask> package com.facebook.react.uimanager;
<mask>
<mask> import android.content.res.Resources;
<mask> import android.util.Log;
<mask> import android.util.SparseArray;
<mask> import android.util.SparseBooleanArray;
<mask> import android.view.Menu;
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove import java.util.regex.Matcher;
import java.util.regex.Pattern;
</s> add </s> remove #include <pthread.h>
</s> add </s> remove import okio.Buffer;
import okio.BufferedSource;
</s> add </s> remove import javax.annotation.Nullable;
import javax.annotation.concurrent.NotThreadSafe;
</s> add </s> remove import android.util.Base64;
</s> add import javax.annotation.Nullable; </s> add import com.facebook.react.common.DebugServerException;
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> import com.facebook.react.uimanager.layoutanimation.LayoutAnimationController;
<mask> import com.facebook.react.uimanager.layoutanimation.LayoutAnimationListener;
<mask> import com.facebook.systrace.Systrace;
<mask> import com.facebook.systrace.SystraceMessage;
<mask> import javax.annotation.Nullable;
<mask> import javax.annotation.concurrent.NotThreadSafe;
<mask>
<mask> /**
<mask> * Delegate of {@link UIManagerModule} that owns the native view hierarchy and mapping between
<mask> * native view names used in JS and corresponding instances of {@link ViewManager}. The
<mask> * {@link UIManagerModule} communicates with this class by it's public interface methods:
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove import com.facebook.react.views.imagehelper.ResourceDrawableIdHelper;
</s> add </s> add import com.facebook.react.views.imagehelper.ResourceDrawableIdHelper;
import com.facebook.yoga.YogaConstants; </s> add import com.facebook.react.common.DebugServerException; </s> add import javax.annotation.Nullable;
import javax.annotation.concurrent.NotThreadSafe; </s> remove import okio.Buffer;
import okio.BufferedSource;
</s> add </s> remove import java.util.regex.Matcher;
import java.util.regex.Pattern;
</s> add
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> }
<mask> }
<mask>
<mask> /**
<mask> * See {@link UIManagerModule#addMeasuredRootView}.
<mask> */
<mask> /**
<mask> * See {@link UIManagerModule#addMeasuredRootView}.
<mask> */
<mask> public synchronized void addRootView(int tag, SizeMonitoringFrameLayout view, ThemedReactContext themedContext) {
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove * See {@link UIManagerModule#addMeasuredRootView}.
</s> add * See {@link UIManagerModule#addRootView}. </s> add public ReactInstanceManagerBuilder setMinNumShakes(int minNumShakes) {
mMinNumShakes = minNumShakes;
return this;
}
</s> add import com.facebook.react.common.DebugServerException; </s> remove import javax.annotation.Nullable;
import javax.annotation.concurrent.NotThreadSafe;
</s> add </s> add mMinNumShakes = minNumShakes; </s> add public BundleDownloader getBundleDownloader() {
return mBundleDownloader;
}
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> /**
<mask> * See {@link UIManagerModule#addMeasuredRootView}.
<mask> */
<mask> /**
<mask> * See {@link UIManagerModule#addMeasuredRootView}.
<mask> */
<mask> public synchronized void addRootView(int tag, SizeMonitoringFrameLayout view, ThemedReactContext themedContext) {
<mask> addRootViewGroup(tag, view, themedContext);
<mask> }
<mask>
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove * See {@link UIManagerModule#addMeasuredRootView}.
</s> add * See {@link UIManagerModule#addRootView}. </s> add public ReactInstanceManagerBuilder setMinNumShakes(int minNumShakes) {
mMinNumShakes = minNumShakes;
return this;
}
</s> add import com.facebook.react.common.DebugServerException; </s> remove import javax.annotation.Nullable;
import javax.annotation.concurrent.NotThreadSafe;
</s> add </s> add mMinNumShakes = minNumShakes; </s> add public BundleDownloader getBundleDownloader() {
return mBundleDownloader;
}
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> }
<mask>
<mask> protected final synchronized void addRootViewGroup(int tag, ViewGroup view, ThemedReactContext themedContext) {
<mask> if (view.getId() != View.NO_ID) {
<mask> throw new IllegalViewOperationException("Trying to add a root view with an explicit id already set. React Native uses " + "the id field to track react tags and will overwrite this field. If that is fine, " + "explicitly overwrite the id field to View.NO_ID before calling addMeasuredRootView.");
<mask> }
<mask> mTagsToViews.put(tag, view);
<mask> mTagsToViewManagers.put(tag, mRootViewManager);
<mask> mRootTags.put(tag, true);
<mask> view.setId(tag);
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove client.sendMessage(RequestBody.create(WebSocket.TEXT, message));
} catch (IOException | IllegalStateException e) {
</s> add client.send(message);
} catch (Exception e) { </s> remove client.sendMessage(
RequestBody.create(WebSocket.BINARY, ByteString.decodeBase64(base64String)));
} catch (IOException | IllegalStateException e) {
</s> add client.send(ByteString.decodeBase64(base64String));
} catch (Exception e) { </s> remove Buffer buffer = new Buffer();
client.sendPing(buffer);
} catch (IOException | IllegalStateException e) {
</s> add client.send(ByteString.EMPTY);
} catch (Exception e) { </s> remove * See {@link UIManagerModule#addMeasuredRootView}.
</s> add * See {@link UIManagerModule#addRootView}. </s> remove * See {@link UIManagerModule#addMeasuredRootView}.
</s> add * See {@link UIManagerModule#addRootView}. </s> remove // shouldn't have to jump through java.
</s> add // shouldn't have to jump through java. It should be enough to check if the
// attach state env* is set.
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java
|
keep add keep keep keep keep keep
|
<mask> @Override
<mask> public String toString() {
<mask> if (mYogaNode != null) {
<mask> result
<mask> .append(getLayoutWidth())
<mask> .append(",")
<mask> .append(getLayoutHeight());
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove return mYogaNode.toString();
</s> add result
.append(getLayoutWidth())
.append(",")
.append(getLayoutHeight());
} else {
result.append("(virtual node)");
}
result.append("\n");
if (getChildCount() == 0) {
return; </s> remove return getClass().getSimpleName() + " (virtual node)";
</s> add for (int i = 0; i < getChildCount(); i++) {
getChildAt(i).toStringWithIndentation(result, level + 1);
} </s> remove public synchronized void onClose(int code, String reason) {
</s> add public synchronized void onClosed(WebSocket webSocket, int code, String reason) { </s> remove public synchronized void onMessage(ResponseBody message) {
</s> add public synchronized void onMessage(WebSocket webSocket, String text) { </s> remove public synchronized void onPong(Buffer payload) { }
</s> add public synchronized void onMessage(WebSocket webSocket, ByteString bytes) {
if (mMessageCallback != null) {
mMessageCallback.onMessage(bytes);
}
} </s> add if (mContentSizeWatcher != null) {
mContentSizeWatcher.onLayout();
}
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.java
|
keep keep replace keep keep replace keep
|
<mask> public String toString() {
<mask> if (mYogaNode != null) {
<mask> return mYogaNode.toString();
<mask> }
<mask>
<mask> return getClass().getSimpleName() + " (virtual node)";
<mask> }
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> add StringBuilder sb = new StringBuilder();
toStringWithIndentation(sb, 0);
return sb.toString();
}
private void toStringWithIndentation(StringBuilder result, int level) {
// Spaces and tabs are dropped by IntelliJ logcat integration, so rely on __ instead.
for (int i = 0; i < level; ++i) {
result.append("__");
}
result
.append(getClass().getSimpleName())
.append(" "); </s> remove String toString() noexcept {
return String::adopt(context(), JSC_JSValueToStringCopy(context(), m_value, nullptr));
}
</s> add RN_EXPORT String toString() const; </s> remove private void handleConnect(JSONObject payload) throws JSONException, IOException {
</s> add private void handleConnect(JSONObject payload) throws JSONException { </s> remove public synchronized void onMessage(ResponseBody message) {
</s> add public synchronized void onMessage(WebSocket webSocket, String text) { </s> remove public void onMessage(ResponseBody response) throws IOException {
if (response.contentType() != WebSocket.TEXT) {
FLog.w(TAG, "Websocket received unexpected message with payload of type " + response.contentType());
return;
}
</s> add public void onMessage(WebSocket webSocket, String text) {
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.java
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> import java.util.Arrays;
<mask> import java.util.List;
<mask>
<mask> import com.facebook.common.logging.FLog;
<mask> import com.facebook.yoga.YogaDirection;
<mask> import com.facebook.infer.annotation.Assertions;
<mask> import com.facebook.react.animation.Animation;
<mask> import com.facebook.react.bridge.Arguments;
<mask> import com.facebook.react.bridge.Callback;
<mask> import com.facebook.react.bridge.ReactApplicationContext;
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove import java.lang.IllegalStateException;
import javax.annotation.Nullable;
</s> add import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit; </s> remove import java.util.regex.Matcher;
import java.util.regex.Pattern;
</s> add </s> add import android.webkit.CookieManager; </s> add import java.io.StringReader; </s> remove import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import javax.annotation.Nullable;
</s> add </s> add import javax.annotation.Nullable;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java
|
keep keep keep keep replace keep keep replace keep keep keep
|
<mask> import android.graphics.Bitmap;
<mask> import android.graphics.BitmapShader;
<mask> import android.graphics.Canvas;
<mask> import android.graphics.Color;
<mask> import android.graphics.Matrix;
<mask> import android.graphics.Paint;
<mask> import android.graphics.Path;
<mask> import android.graphics.Rect;
<mask> import android.graphics.RectF;
<mask> import android.graphics.Shader;
<mask> import android.graphics.drawable.Animatable;
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import javax.annotation.Nullable;
</s> add </s> remove import java.lang.IllegalStateException;
import javax.annotation.Nullable;
</s> add import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit; </s> add import javax.annotation.Nullable;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException; </s> remove import java.util.regex.Matcher;
import java.util.regex.Pattern;
</s> add </s> remove import com.facebook.react.packagerconnection.JSPackagerClient;
</s> add import com.facebook.react.packagerconnection.RequestHandler;
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageView.java
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> import android.net.Uri;
<mask> import android.widget.Toast;
<mask>
<mask> import com.facebook.common.util.UriUtil;
<mask> import com.facebook.react.common.build.ReactBuildConfig;
<mask> import com.facebook.yoga.YogaConstants;
<mask> import com.facebook.drawee.controller.AbstractDraweeControllerBuilder;
<mask> import com.facebook.drawee.controller.BaseControllerListener;
<mask> import com.facebook.drawee.controller.ControllerListener;
<mask> import com.facebook.drawee.controller.ForwardingControllerListener;
<mask> import com.facebook.drawee.drawable.AutoRotateDrawable;
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove import android.graphics.Rect;
</s> add </s> remove import com.facebook.react.uimanager.FloatUtil;
</s> add import com.facebook.react.common.build.ReactBuildConfig; </s> add import com.facebook.react.uimanager.FloatUtil; </s> remove import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import javax.annotation.Nullable;
</s> add </s> remove import java.lang.IllegalStateException;
import javax.annotation.Nullable;
</s> add import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit; </s> add import javax.annotation.Nullable;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageView.java
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> import com.facebook.imagepipeline.request.Postprocessor;
<mask> import com.facebook.react.bridge.ReactContext;
<mask> import com.facebook.react.bridge.ReadableArray;
<mask> import com.facebook.react.bridge.ReadableMap;
<mask> import com.facebook.react.uimanager.FloatUtil;
<mask> import com.facebook.react.modules.fresco.ReactNetworkImageRequest;
<mask> import com.facebook.react.uimanager.PixelUtil;
<mask> import com.facebook.react.uimanager.UIManagerModule;
<mask> import com.facebook.react.uimanager.events.EventDispatcher;
<mask> import com.facebook.react.views.imagehelper.ImageSource;
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> add import com.facebook.react.uimanager.FloatUtil; </s> add import com.facebook.react.common.DebugServerException; </s> remove import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.ReadableType;
import com.facebook.react.devsupport.interfaces.DevSupportManager;
</s> add </s> remove import com.facebook.react.views.imagehelper.ResourceDrawableIdHelper;
</s> add </s> remove import java.util.regex.Matcher;
import java.util.regex.Pattern;
</s> add </s> remove import java.lang.IllegalStateException;
import javax.annotation.Nullable;
</s> add import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageView.java
|
keep add keep keep keep keep
|
<mask> import com.facebook.react.common.build.ReactBuildConfig;
<mask> import com.facebook.react.modules.fresco.ReactNetworkImageRequest;
<mask> import com.facebook.react.uimanager.PixelUtil;
<mask> import com.facebook.react.uimanager.UIManagerModule;
<mask> import com.facebook.react.uimanager.events.EventDispatcher;
<mask> import com.facebook.react.views.imagehelper.ImageSource;
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove import com.facebook.react.uimanager.FloatUtil;
</s> add import com.facebook.react.common.build.ReactBuildConfig; </s> remove import com.facebook.react.views.imagehelper.ResourceDrawableIdHelper;
</s> add </s> remove import com.facebook.react.common.build.ReactBuildConfig;
import com.facebook.yoga.YogaConstants;
</s> add </s> remove import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import javax.annotation.Nullable;
</s> add </s> add import com.facebook.react.views.imagehelper.ResourceDrawableIdHelper;
import com.facebook.yoga.YogaConstants; </s> remove import java.lang.IllegalStateException;
import javax.annotation.Nullable;
</s> add import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageView.java
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> import com.facebook.react.uimanager.UIManagerModule;
<mask> import com.facebook.react.uimanager.events.EventDispatcher;
<mask> import com.facebook.react.views.imagehelper.ImageSource;
<mask> import com.facebook.react.views.imagehelper.MultiSourceHelper;
<mask> import com.facebook.react.views.imagehelper.ResourceDrawableIdHelper;
<mask> import com.facebook.react.views.imagehelper.MultiSourceHelper.MultiSourceResult;
<mask>
<mask> /**
<mask> * Wrapper class around Fresco's GenericDraweeView, enabling persisting props across multiple view
<mask> * update and consistent processing of both static and network images.
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> add import com.facebook.react.views.imagehelper.ResourceDrawableIdHelper;
import com.facebook.yoga.YogaConstants; </s> remove import javax.annotation.Nullable;
import javax.annotation.concurrent.NotThreadSafe;
</s> add </s> add import com.facebook.react.uimanager.FloatUtil; </s> remove import com.facebook.react.uimanager.FloatUtil;
</s> add import com.facebook.react.common.build.ReactBuildConfig; </s> remove import okhttp3.ResponseBody;
import okhttp3.ws.WebSocket;
import okhttp3.ws.WebSocketCall;
import okhttp3.ws.WebSocketListener;
import okio.Buffer;
</s> add import okhttp3.WebSocket;
import okhttp3.WebSocketListener;
import okio.ByteString; </s> remove import okhttp3.ResponseBody;
import okhttp3.ws.WebSocket;
import okhttp3.ws.WebSocketCall;
import okhttp3.ws.WebSocketListener;
import okio.Buffer;
</s> add import okhttp3.WebSocket;
import okhttp3.WebSocketListener;
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageView.java
|
keep keep add keep keep keep keep keep
|
<mask> import com.facebook.react.views.imagehelper.ImageSource;
<mask> import com.facebook.react.views.imagehelper.MultiSourceHelper;
<mask> import com.facebook.react.views.imagehelper.MultiSourceHelper.MultiSourceResult;
<mask>
<mask> /**
<mask> * Wrapper class around Fresco's GenericDraweeView, enabling persisting props across multiple view
<mask> * update and consistent processing of both static and network images.
<mask> */
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove import com.facebook.react.views.imagehelper.ResourceDrawableIdHelper;
</s> add </s> remove import javax.annotation.Nullable;
import javax.annotation.concurrent.NotThreadSafe;
</s> add </s> remove import okhttp3.ResponseBody;
import okhttp3.ws.WebSocket;
import okhttp3.ws.WebSocketCall;
import okhttp3.ws.WebSocketListener;
import okio.Buffer;
</s> add import okhttp3.WebSocket;
import okhttp3.WebSocketListener;
import okio.ByteString; </s> remove import okhttp3.ResponseBody;
import okhttp3.ws.WebSocket;
import okhttp3.ws.WebSocketCall;
import okhttp3.ws.WebSocketListener;
import okio.Buffer;
</s> add import okhttp3.WebSocket;
import okhttp3.WebSocketListener; </s> add import com.facebook.react.common.DebugServerException; </s> remove import okio.Buffer;
import okio.BufferedSource;
</s> add
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageView.java
|
keep keep replace replace keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace
|
<mask> * 'cover' mode, so we fall back to Fresco's normal implementation.
<mask> */
<mask> private static final Matrix sMatrix = new Matrix();
<mask> private static final Matrix sInverse = new Matrix();
<mask> private ImageResizeMethod mResizeMethod = ImageResizeMethod.AUTO;
<mask>
<mask> private class RoundedCornerPostprocessor extends BasePostprocessor {
<mask>
<mask> void getRadii(Bitmap source, float[] computedCornerRadii, float[] mappedRadii) {
<mask> mScaleType.getTransform(
<mask> sMatrix,
<mask> new Rect(0, 0, source.getWidth(), source.getHeight()),
<mask> source.getWidth(),
<mask> source.getHeight(),
<mask> 0.0f,
<mask> 0.0f);
<mask> sMatrix.invert(sInverse);
<mask>
<mask> mappedRadii[0] = sInverse.mapRadius(computedCornerRadii[0]);
<mask> mappedRadii[1] = mappedRadii[0];
<mask>
<mask> mappedRadii[2] = sInverse.mapRadius(computedCornerRadii[1]);
<mask> mappedRadii[3] = mappedRadii[2];
<mask>
<mask> mappedRadii[4] = sInverse.mapRadius(computedCornerRadii[2]);
<mask> mappedRadii[5] = mappedRadii[4];
<mask>
<mask> mappedRadii[6] = sInverse.mapRadius(computedCornerRadii[3]);
<mask> mappedRadii[7] = mappedRadii[6];
<mask> }
<mask>
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove float[] radii = new float[8];
getRadii(source, sComputedCornerRadii, radii);
</s> add </s> remove final public class ReconnectingWebSocket implements WebSocketListener {
</s> add final public class ReconnectingWebSocket extends WebSocketListener { </s> remove private class Connection implements WebSocketListener {
</s> add private class Connection extends WebSocketListener { </s> add // ~0 == 0xFFFFFFFF, all bits set to 1.
private static final int ALL_BITS_SET = ~0;
// 0 == 0x00000000, all bits set to 0.
private static final int ALL_BITS_UNSET = 0;
</s> remove mAccessibilityManager = (AccessibilityManager) getReactApplicationContext()
.getSystemService(Context.ACCESSIBILITY_SERVICE);
</s> add Context appContext = context.getApplicationContext();
mAccessibilityManager = (AccessibilityManager) appContext.getSystemService(Context.ACCESSIBILITY_SERVICE);
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageView.java
|
keep keep keep replace replace replace replace keep keep keep keep replace
|
<mask> paint.setShader(new BitmapShader(source, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP));
<mask> Canvas canvas = new Canvas(output);
<mask>
<mask> float[] radii = new float[8];
<mask>
<mask> getRadii(source, sComputedCornerRadii, radii);
<mask>
<mask> Path pathForBorderRadius = new Path();
<mask>
<mask> pathForBorderRadius.addRoundRect(
<mask> new RectF(0, 0, source.getWidth(), source.getHeight()),
<mask> radii,
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove void getRadii(Bitmap source, float[] computedCornerRadii, float[] mappedRadii) {
mScaleType.getTransform(
sMatrix,
new Rect(0, 0, source.getWidth(), source.getHeight()),
source.getWidth(),
source.getHeight(),
0.0f,
0.0f);
sMatrix.invert(sInverse);
mappedRadii[0] = sInverse.mapRadius(computedCornerRadii[0]);
mappedRadii[1] = mappedRadii[0];
mappedRadii[2] = sInverse.mapRadius(computedCornerRadii[1]);
mappedRadii[3] = mappedRadii[2];
mappedRadii[4] = sInverse.mapRadius(computedCornerRadii[2]);
mappedRadii[5] = mappedRadii[4];
mappedRadii[6] = sInverse.mapRadius(computedCornerRadii[3]);
mappedRadii[7] = mappedRadii[6];
}
</s> add </s> remove private static final Matrix sMatrix = new Matrix();
private static final Matrix sInverse = new Matrix();
</s> add </s> add mNumShakes = 0;
mLastShakeTimestamp = 0; </s> remove Matcher matcher = STACK_FRAME_PATTERN.matcher(stackTrace[i]);
if (!matcher.find()) {
throw new IllegalArgumentException(
</s> add if (stackTrace[i].equals("[native code]")) {
result[i] = new StackFrameImpl(null, stackTrace[i], -1, -1);
} else {
Matcher matcher = STACK_FRAME_PATTERN.matcher(stackTrace[i]);
if (!matcher.find()) {
throw new IllegalArgumentException( </s> remove JSONObject message = new JSONObject(response.string());
</s> add JSONObject message = new JSONObject(text);
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageView.java
|
keep keep keep keep replace keep keep keep keep keep
|
<mask>
<mask> protected int mNumberOfLines = UNSET;
<mask> protected int mFontSize = UNSET;
<mask> protected float mFontSizeInput = UNSET;
<mask> protected int mLineHeightInput = UNSET;
<mask> protected int mTextAlign = Gravity.NO_GRAVITY;
<mask> protected int mTextBreakStrategy = (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) ?
<mask> 0 : Layout.BREAK_STRATEGY_HIGH_QUALITY;
<mask>
<mask> private float mTextShadowOffsetDx = 0;
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove private boolean isBorderColorDifferentAtIntersectionPoints() {
return isFlagSet(BORDER_TOP_COLOR_SET) ||
isFlagSet(BORDER_BOTTOM_COLOR_SET) ||
isFlagSet(BORDER_LEFT_COLOR_SET) ||
isFlagSet(BORDER_RIGHT_COLOR_SET);
</s> add private static int fastBorderCompatibleColorOrZero(
float borderLeft,
float borderTop,
float borderRight,
float borderBottom,
int colorLeft,
int colorTop,
int colorRight,
int colorBottom) {
int andSmear = (borderLeft > 0 ? colorLeft : ALL_BITS_SET) &
(borderTop > 0 ? colorTop : ALL_BITS_SET) &
(borderRight > 0 ? colorRight : ALL_BITS_SET) &
(borderBottom > 0 ? colorBottom : ALL_BITS_SET);
int orSmear = (borderLeft > 0 ? colorLeft : ALL_BITS_UNSET) |
(borderTop > 0 ? colorTop : ALL_BITS_UNSET) |
(borderRight > 0 ? colorRight : ALL_BITS_UNSET) |
(borderBottom > 0 ? colorBottom : ALL_BITS_UNSET);
return andSmear == orSmear ? andSmear : 0; </s> add // ~0 == 0xFFFFFFFF, all bits set to 1.
private static final int ALL_BITS_SET = ~0;
// 0 == 0x00000000, all bits set to 0.
private static final int ALL_BITS_UNSET = 0;
</s> remove Map<String, RequestHandler> handlers = new HashMap<String, RequestHandler>();
</s> add Map<String, RequestHandler> handlers = new HashMap<>(); </s> remove float topWidth = resolveWidth(mBorderTopWidth, defaultWidth);
float bottomOfTheTop = top + topWidth;
</s> add float borderTop = resolveWidth(mBorderTopWidth, defaultWidth);
float topInset = top + borderTop; </s> remove float contentSizeWidth,
float contentSizeHeight,
</s> add </s> remove if (currentTimestamp - mTimestamps[index] < VISIBLE_TIME_RANGE_MS) {
</s> add if (currentTimestamp - mTimestamps[index] < VISIBLE_TIME_RANGE_NS) {
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> mNumberOfLines = numberOfLines == 0 ? UNSET : numberOfLines;
<mask> markUpdated();
<mask> }
<mask>
<mask> @ReactProp(name = ViewProps.LINE_HEIGHT, defaultInt = UNSET)
<mask> public void setLineHeight(int lineHeight) {
<mask> mLineHeightInput = lineHeight;
<mask> if (lineHeight == UNSET) {
<mask> mLineHeight = Float.NaN;
<mask> } else {
<mask> mLineHeight = mAllowFontScaling ?
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove protected int mLineHeightInput = UNSET;
</s> add protected float mLineHeightInput = UNSET; </s> remove public void onMessage(ResponseBody response) throws IOException {
String message;
try {
if (response.contentType() == WebSocket.BINARY) {
message = Base64.encodeToString(response.source().readByteArray(), Base64.NO_WRAP);
} else {
message = response.source().readUtf8();
}
} catch (IOException e) {
notifyWebSocketFailed(id, e.getMessage());
return;
}
try {
response.source().close();
} catch (IOException e) {
FLog.e(
ReactConstants.TAG,
"Could not close BufferedSource for WebSocket id " + id,
e);
}
</s> add public void onMessage(WebSocket webSocket, ByteString bytes) {
String text = bytes.utf8(); </s> remove const bool flexBasisOverflows =
measureModeMainDim == YGMeasureModeUndefined ? false : totalFlexBasis > availableInnerMainDim;
</s> add const bool flexBasisOverflows = measureModeMainDim == YGMeasureModeUndefined
? false
: totalOuterFlexBasis > availableInnerMainDim; </s> add @ReactProp(name = "thirdPartyCookiesEnabled")
public void setThirdPartyCookiesEnabled(WebView view, boolean enabled) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
CookieManager.getInstance().setAcceptThirdPartyCookies(view, enabled);
}
}
</s> add bool useRoundedComparison = config != NULL && config->pointScaleFactor != 0;
const float effectiveWidth = useRoundedComparison ? YGRoundValueToPixelGrid(width, config->pointScaleFactor, false, false) : width;
const float effectiveHeight = useRoundedComparison ? YGRoundValueToPixelGrid(height, config->pointScaleFactor, false, false) : height;
const float effectiveLastWidth = useRoundedComparison ? YGRoundValueToPixelGrid(lastWidth, config->pointScaleFactor, false, false) : lastWidth;
const float effectiveLastHeight = useRoundedComparison ? YGRoundValueToPixelGrid(lastHeight, config->pointScaleFactor, false, false) : lastHeight; </s> remove private boolean isBorderColorDifferentAtIntersectionPoints() {
return isFlagSet(BORDER_TOP_COLOR_SET) ||
isFlagSet(BORDER_BOTTOM_COLOR_SET) ||
isFlagSet(BORDER_LEFT_COLOR_SET) ||
isFlagSet(BORDER_RIGHT_COLOR_SET);
</s> add private static int fastBorderCompatibleColorOrZero(
float borderLeft,
float borderTop,
float borderRight,
float borderBottom,
int colorLeft,
int colorTop,
int colorRight,
int colorBottom) {
int andSmear = (borderLeft > 0 ? colorLeft : ALL_BITS_SET) &
(borderTop > 0 ? colorTop : ALL_BITS_SET) &
(borderRight > 0 ? colorRight : ALL_BITS_SET) &
(borderBottom > 0 ? colorBottom : ALL_BITS_SET);
int orSmear = (borderLeft > 0 ? colorLeft : ALL_BITS_UNSET) |
(borderTop > 0 ? colorTop : ALL_BITS_UNSET) |
(borderRight > 0 ? colorRight : ALL_BITS_UNSET) |
(borderBottom > 0 ? colorBottom : ALL_BITS_UNSET);
return andSmear == orSmear ? andSmear : 0;
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java
|
keep keep add keep keep keep keep keep
|
<mask> listener.onTextChanged(s, start, before, count);
<mask> }
<mask> }
<mask> }
<mask>
<mask> @Override
<mask> public void afterTextChanged(Editable s) {
<mask> if (!mIsSettingTextFromJS && mListeners != null) {
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove mMessageCallback.onMessage(message);
</s> add mMessageCallback.onMessage(text); </s> remove public synchronized void onMessage(ResponseBody message) {
</s> add public synchronized void onMessage(WebSocket webSocket, String text) { </s> remove public synchronized void onPong(Buffer payload) { }
</s> add public synchronized void onMessage(WebSocket webSocket, ByteString bytes) {
if (mMessageCallback != null) {
mMessageCallback.onMessage(bytes);
}
} </s> remove public synchronized void onFailure(IOException e, Response response) {
</s> add public synchronized void onFailure(WebSocket webSocket, Throwable t, Response response) { </s> remove abort("Websocket exception", e);
</s> add abort("Websocket exception", t); </s> remove abort("Websocket exception", e);
</s> add abort("Websocket exception", t);
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask>
<mask> public static final String EVENT_NAME = "topChange";
<mask>
<mask> private String mText;
<mask> private float mContentWidth;
<mask> private float mContentHeight;
<mask> private int mEventCount;
<mask>
<mask> public ReactTextChangedEvent(
<mask> int viewId,
<mask> String text,
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove float contentSizeWidth,
float contentSizeHeight,
</s> add </s> add // ~0 == 0xFFFFFFFF, all bits set to 1.
private static final int ALL_BITS_SET = ~0;
// 0 == 0x00000000, all bits set to 0.
private static final int ALL_BITS_UNSET = 0;
</s> add private OkHttpClient mHttpClient; </s> remove private class Connection implements WebSocketListener {
</s> add private class Connection extends WebSocketListener { </s> remove final public class ReconnectingWebSocket implements WebSocketListener {
</s> add final public class ReconnectingWebSocket extends WebSocketListener { </s> remove private String mConnectivity = "";
</s> add private String mConnectivity = CONNECTION_TYPE_UNKNOWN;
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextChangedEvent.java
|
keep keep keep keep replace replace keep keep keep replace replace keep keep keep keep
|
<mask>
<mask> public ReactTextChangedEvent(
<mask> int viewId,
<mask> String text,
<mask> float contentSizeWidth,
<mask> float contentSizeHeight,
<mask> int eventCount) {
<mask> super(viewId);
<mask> mText = text;
<mask> mContentWidth = contentSizeWidth;
<mask> mContentHeight = contentSizeHeight;
<mask> mEventCount = eventCount;
<mask> }
<mask>
<mask> @Override
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove private float mContentWidth;
private float mContentHeight;
</s> add </s> remove public void onClose(int code, String reason) {
</s> add public void onClosed(WebSocket webSocket, int code, String reason) { </s> remove protected int mLineHeightInput = UNSET;
</s> add protected float mLineHeightInput = UNSET; </s> remove float topWidth = resolveWidth(mBorderTopWidth, defaultWidth);
float bottomOfTheTop = top + topWidth;
</s> add float borderTop = resolveWidth(mBorderTopWidth, defaultWidth);
float topInset = top + borderTop; </s> remove float rightWidth = resolveWidth(mBorderRightWidth, defaultWidth);
float leftOfTheRight = right - rightWidth;
</s> add float borderRight = resolveWidth(mBorderRightWidth, defaultWidth);
float rightInset = right - borderRight;
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextChangedEvent.java
|
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
|
<mask>
<mask> private WritableMap serializeEventData() {
<mask> WritableMap eventData = Arguments.createMap();
<mask> eventData.putString("text", mText);
<mask>
<mask> WritableMap contentSize = Arguments.createMap();
<mask> contentSize.putDouble("width", mContentWidth);
<mask> contentSize.putDouble("height", mContentHeight);
<mask> eventData.putMap("contentSize", contentSize);
<mask> eventData.putInt("eventCount", mEventCount);
<mask>
<mask> eventData.putInt("target", getViewTag());
<mask> return eventData;
<mask> }
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove WebSocketCall.create(client, builder.build()).enqueue(new WebSocketListener() {
</s> add client.newWebSocket(builder.build(), new WebSocketListener() { </s> remove public void onClose(int code, String reason) {
</s> add public void onClosed(WebSocket webSocket, int code, String reason) { </s> remove public void onPong(Buffer buffer) {
</s> add public void onMessage(WebSocket webSocket, String text) {
WritableMap params = Arguments.createMap();
params.putInt("id", id);
params.putString("data", text);
params.putString("type", "text");
sendEvent("websocketMessage", params); </s> remove params.putString("data", message);
params.putString("type", response.contentType() == WebSocket.BINARY ? "binary" : "text");
</s> add params.putString("data", text);
params.putString("type", "binary"); </s> remove public void onMessage(ResponseBody response) throws IOException {
String message;
try {
if (response.contentType() == WebSocket.BINARY) {
message = Base64.encodeToString(response.source().readByteArray(), Base64.NO_WRAP);
} else {
message = response.source().readUtf8();
}
} catch (IOException e) {
notifyWebSocketFailed(id, e.getMessage());
return;
}
try {
response.source().close();
} catch (IOException e) {
FLog.e(
ReactConstants.TAG,
"Could not close BufferedSource for WebSocket id " + id,
e);
}
</s> add public void onMessage(WebSocket webSocket, ByteString bytes) {
String text = bytes.utf8(); </s> remove private class Connection implements WebSocketListener {
</s> add private class Connection extends WebSocketListener {
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextChangedEvent.java
|
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
|
<mask> if (count == before && newText.equals(oldText)) {
<mask> return;
<mask> }
<mask>
<mask> // TODO: remove contentSize from onTextChanged entirely now that onChangeContentSize exists?
<mask> int contentWidth = mEditText.getWidth();
<mask> int contentHeight = mEditText.getHeight();
<mask>
<mask> // Use instead size of text content within EditText when available
<mask> if (mEditText.getLayout() != null) {
<mask> contentWidth = mEditText.getCompoundPaddingLeft() + mEditText.getLayout().getWidth() +
<mask> mEditText.getCompoundPaddingRight();
<mask> contentHeight = mEditText.getCompoundPaddingTop() + mEditText.getLayout().getHeight() +
<mask> mEditText.getCompoundPaddingTop();
<mask> }
<mask>
<mask> // The event that contains the event counter and updates it must be sent first.
<mask> // TODO: t7936714 merge these events
<mask> mEventDispatcher.dispatchEvent(
<mask> new ReactTextChangedEvent(
<mask> mEditText.getId(),
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove int width = bounds.width();
int height = bounds.height();
// If the path drawn previously is of the same color,
// there would be a slight white space between borders
// with anti-alias set to true.
// Therefore we need to disable anti-alias, and
// after drawing is done, we will re-enable it.
mPaint.setAntiAlias(false);
if (mPathForBorder == null) {
mPathForBorder = new Path();
}
if (borderLeft > 0 && colorLeft != Color.TRANSPARENT) {
mPaint.setColor(colorLeft);
mPathForBorder.reset();
mPathForBorder.moveTo(left, top);
mPathForBorder.lineTo(left + borderLeft, top + borderTop);
mPathForBorder.lineTo(left + borderLeft, top + height - borderBottom);
mPathForBorder.lineTo(left, top + height);
mPathForBorder.lineTo(left, top);
canvas.drawPath(mPathForBorder, mPaint);
}
if (borderTop > 0 && colorTop != Color.TRANSPARENT) {
mPaint.setColor(colorTop);
mPathForBorder.reset();
mPathForBorder.moveTo(left, top);
mPathForBorder.lineTo(left + borderLeft, top + borderTop);
mPathForBorder.lineTo(left + width - borderRight, top + borderTop);
mPathForBorder.lineTo(left + width, top);
mPathForBorder.lineTo(left, top);
canvas.drawPath(mPathForBorder, mPaint);
}
if (borderRight > 0 && colorRight != Color.TRANSPARENT) {
mPaint.setColor(colorRight);
mPathForBorder.reset();
mPathForBorder.moveTo(left + width, top);
mPathForBorder.lineTo(left + width, top + height);
mPathForBorder.lineTo(left + width - borderRight, top + height - borderBottom);
mPathForBorder.lineTo(left + width - borderRight, top + borderTop);
mPathForBorder.lineTo(left + width, top);
canvas.drawPath(mPathForBorder, mPaint);
}
</s> add int top = bounds.top; </s> remove if (borderBottom > 0 && colorBottom != Color.TRANSPARENT) {
mPaint.setColor(colorBottom);
mPathForBorder.reset();
mPathForBorder.moveTo(left, top + height);
mPathForBorder.lineTo(left + width, top + height);
mPathForBorder.lineTo(left + width - borderRight, top + height - borderBottom);
mPathForBorder.lineTo(left + borderLeft, top + height - borderBottom);
mPathForBorder.lineTo(left, top + height);
canvas.drawPath(mPathForBorder, mPaint);
</s> add // Check for fast path to border drawing.
int fastBorderColor = fastBorderCompatibleColorOrZero(
borderLeft,
borderTop,
borderRight,
borderBottom,
colorLeft,
colorTop,
colorRight,
colorBottom);
if (fastBorderColor != 0) {
if (Color.alpha(fastBorderColor) != 0) {
// Border color is not transparent.
int right = bounds.right;
int bottom = bounds.bottom;
mPaint.setColor(fastBorderColor);
if (borderLeft > 0) {
int leftInset = left + borderLeft;
canvas.drawRect(left, top, leftInset, bottom - borderBottom, mPaint);
}
if (borderTop > 0) {
int topInset = top + borderTop;
canvas.drawRect(left + borderLeft, top, right, topInset, mPaint);
}
if (borderRight > 0) {
int rightInset = right - borderRight;
canvas.drawRect(rightInset, top + borderTop, right, bottom, mPaint);
}
if (borderBottom > 0) {
int bottomInset = bottom - borderBottom;
canvas.drawRect(left, bottomInset, right - borderRight, bottom, mPaint);
}
}
} else {
if (mPathForBorder == null) {
mPathForBorder = new Path();
}
// If the path drawn previously is of the same color,
// there would be a slight white space between borders
// with anti-alias set to true.
// Therefore we need to disable anti-alias, and
// after drawing is done, we will re-enable it.
mPaint.setAntiAlias(false);
int width = bounds.width();
int height = bounds.height();
if (borderLeft > 0 && colorLeft != Color.TRANSPARENT) {
mPaint.setColor(colorLeft);
mPathForBorder.reset();
mPathForBorder.moveTo(left, top);
mPathForBorder.lineTo(left + borderLeft, top + borderTop);
mPathForBorder.lineTo(left + borderLeft, top + height - borderBottom);
mPathForBorder.lineTo(left, top + height);
mPathForBorder.lineTo(left, top);
canvas.drawPath(mPathForBorder, mPaint);
}
if (borderTop > 0 && colorTop != Color.TRANSPARENT) {
mPaint.setColor(colorTop);
mPathForBorder.reset();
mPathForBorder.moveTo(left, top);
mPathForBorder.lineTo(left + borderLeft, top + borderTop);
mPathForBorder.lineTo(left + width - borderRight, top + borderTop);
mPathForBorder.lineTo(left + width, top);
mPathForBorder.lineTo(left, top);
canvas.drawPath(mPathForBorder, mPaint);
}
if (borderRight > 0 && colorRight != Color.TRANSPARENT) {
mPaint.setColor(colorRight);
mPathForBorder.reset();
mPathForBorder.moveTo(left + width, top);
mPathForBorder.lineTo(left + width, top + height);
mPathForBorder.lineTo(left + width - borderRight, top + height - borderBottom);
mPathForBorder.lineTo(left + width - borderRight, top + borderTop);
mPathForBorder.lineTo(left + width, top);
canvas.drawPath(mPathForBorder, mPaint);
}
if (borderBottom > 0 && colorBottom != Color.TRANSPARENT) {
mPaint.setColor(colorBottom);
mPathForBorder.reset();
mPathForBorder.moveTo(left, top + height);
mPathForBorder.lineTo(left + width, top + height);
mPathForBorder.lineTo(left + width - borderRight, top + height - borderBottom);
mPathForBorder.lineTo(left + borderLeft, top + height - borderBottom);
mPathForBorder.lineTo(left, top + height);
canvas.drawPath(mPathForBorder, mPaint);
}
// re-enable anti alias
mPaint.setAntiAlias(true); </s> remove private static String getHostForJSProxy() {
return AndroidInfoHelpers.DEVICE_LOCALHOST;
</s> add private String getHostForJSProxy() {
// Use custom port if configured. Note that host stays "localhost".
String host = Assertions.assertNotNull(mSettings.getPackagerConnectionSettings().getDebugServerHost());
int portOffset = host.lastIndexOf(':');
if (portOffset > -1) {
return "localhost" + host.substring(portOffset);
} else {
return AndroidInfoHelpers.DEVICE_LOCALHOST;
} </s> remove boolean isDrawPathRequired = isBorderColorDifferentAtIntersectionPoints();
if (isDrawPathRequired && mPathForBorder == null) {
mPathForBorder = new Path();
}
</s> add // Check for fast path to border drawing.
int fastBorderColor = fastBorderCompatibleColorOrZero(
borderLeft,
borderTop,
borderRight,
borderBottom,
leftColor,
topColor,
rightColor,
bottomColor);
if (fastBorderColor != 0) {
// Fast border color draw.
if (Color.alpha(fastBorderColor) != 0) {
// Border color is not transparent.
// Draw center.
if (Color.alpha(mBackgroundColor) != 0) {
PAINT.setColor(mBackgroundColor);
if (Color.alpha(fastBorderColor) == 255) {
// The border will draw over the edges, so only draw the inset background.
canvas.drawRect(leftInset, topInset, rightInset, bottomInset, PAINT);
} else {
// The border is opaque, so we have to draw the entire background color.
canvas.drawRect(left, top, right, bottom, PAINT);
}
}
PAINT.setColor(fastBorderColor);
if (borderLeft > 0) {
canvas.drawRect(left, top, leftInset, bottom - borderBottom, PAINT);
}
if (borderTop > 0) {
canvas.drawRect(left + borderLeft, top, right, topInset, PAINT);
}
if (borderRight > 0) {
canvas.drawRect(rightInset, top + borderTop, right, bottom, PAINT);
}
if (borderBottom > 0) {
canvas.drawRect(left, bottomInset, right - borderRight, bottom, PAINT);
}
}
} else {
if (mPathForBorder == null) {
mPathForBorder = new Path();
} </s> remove public void downloadBundleFromURL(final BundleDownloadCallback callback, final File outputFile, final String bundleURL) {
final Request request = new Request.Builder().url(bundleURL).addHeader("Accept", "multipart/mixed").build();
mDownloadBundleFromURLCall = Assertions.assertNotNull(mClient.newCall(request));
mDownloadBundleFromURLCall.enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
// ignore callback if call was cancelled
if (mDownloadBundleFromURLCall == null || mDownloadBundleFromURLCall.isCanceled()) {
mDownloadBundleFromURLCall = null;
return;
}
mDownloadBundleFromURLCall = null;
callback.onFailure(DebugServerException.makeGeneric("Could not connect to development server.", "URL: " + call.request().url().toString(), e));
}
@Override
public void onResponse(Call call, final Response response) throws IOException {
// ignore callback if call was cancelled
if (mDownloadBundleFromURLCall == null || mDownloadBundleFromURLCall.isCanceled()) {
mDownloadBundleFromURLCall = null;
return;
}
mDownloadBundleFromURLCall = null;
final String url = response.request().url().toString();
// Make sure the result is a multipart response and parse the boundary.
String contentType = response.header("content-type");
Pattern regex = Pattern.compile("multipart/mixed;.*boundary=\"([^\"]+)\"");
Matcher match = regex.matcher(contentType);
if (match.find()) {
String boundary = match.group(1);
MultipartStreamReader bodyReader = new MultipartStreamReader(response.body().source(), boundary);
boolean completed = bodyReader.readAllParts(new MultipartStreamReader.ChunkCallback() {
@Override
public void execute(Map<String, String> headers, Buffer body, boolean finished) throws IOException {
// encoded as JSON.
if (finished) {
// The http status code for each separate chunk is in the X-Http-Status header.
int status = response.code();
if (headers.containsKey("X-Http-Status")) {
status = Integer.parseInt(headers.get("X-Http-Status"));
}
processBundleResult(url, status, body, outputFile, callback);
} else {
if (!headers.containsKey("Content-Type") || !headers.get("Content-Type").equals("application/json")) {
return;
}
try {
JSONObject progress = new JSONObject(body.readUtf8());
String status = null;
if (progress.has("status")) {
status = progress.getString("status");
}
Integer done = null;
if (progress.has("done")) {
done = progress.getInt("done");
}
Integer total = null;
if (progress.has("total")) {
total = progress.getInt("total");
}
callback.onProgress(status, done, total);
} catch (JSONException e) {
FLog.e(ReactConstants.TAG, "Error parsing progress JSON. " + e.toString());
}
}
}
});
if (!completed) {
callback.onFailure(new DebugServerException("Error while reading multipart response.\n\nResponse code: " + response.code() + "\n\n" + "URL: " + call.request().url().toString() + "\n\n"));
}
} else {
/**
* In case the server doesn't support multipart/mixed responses,
* fallback to normal download.
*/
processBundleResult(url, response.code(), Okio.buffer(response.body().source()), outputFile, callback);
}
}
});
}
private void processBundleResult(String url, int statusCode, BufferedSource body, File outputFile, BundleDownloadCallback callback) throws IOException {
// Check for server errors. If the server error has the expected form, fail with more info.
if (statusCode != 200) {
String bodyString = body.readUtf8();
DebugServerException debugServerException = DebugServerException.parse(bodyString);
if (debugServerException != null) {
callback.onFailure(debugServerException);
} else {
StringBuilder sb = new StringBuilder();
sb.append("The development server returned response error code: ").append(statusCode).append("\n\n").append("URL: ").append(url).append("\n\n").append("Body:\n").append(bodyString);
callback.onFailure(new DebugServerException(sb.toString()));
}
return;
}
Sink output = null;
try {
output = Okio.sink(outputFile);
body.readAll(output);
callback.onSuccess();
} finally {
if (output != null) {
output.close();
}
}
}
public void cancelDownloadBundleFromURL() {
if (mDownloadBundleFromURLCall != null) {
mDownloadBundleFromURLCall.cancel();
mDownloadBundleFromURLCall = null;
}
}
</s> add </s> remove // If the file name of a stack frame is numeric (+ ".js"), we assume it's a lazily injected module
// coming from a "random access bundle". We are using special source maps for these bundles, so
// that we can symbolicate stack traces for multiple injected files with a single source map.
// We have to include the module id in the stack for that, though. The ".js" suffix is kept to
// avoid ambiguities between "module-id:line" and "line:column".
private static String stackFrameToModuleId(ReadableMap frame) {
if (frame.hasKey("file") && !frame.isNull("file") && frame.getType("file") == ReadableType.String) {
final Matcher matcher = mJsModuleIdPattern.matcher(frame.getString("file"));
if (matcher.find()) {
return matcher.group(1) + ":";
}
}
return "";
}
private String stackTraceToString(String message, ReadableArray stack) {
StringBuilder stringBuilder = new StringBuilder(message).append(", stack:\n");
for (int i = 0; i < stack.size(); i++) {
ReadableMap frame = stack.getMap(i);
stringBuilder.append(frame.getString("methodName")).append("@").append(stackFrameToModuleId(frame)).append(frame.getInt("lineNumber"));
if (frame.hasKey("column") && !frame.isNull("column") && frame.getType("column") == ReadableType.Number) {
stringBuilder.append(":").append(frame.getInt("column"));
}
stringBuilder.append("\n");
}
return stringBuilder.toString();
}
</s> add
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> mEventDispatcher.dispatchEvent(
<mask> new ReactTextChangedEvent(
<mask> mEditText.getId(),
<mask> s.toString(),
<mask> PixelUtil.toDIPFromPixel(contentWidth),
<mask> PixelUtil.toDIPFromPixel(contentHeight),
<mask> mEditText.incrementAndGetEventCounter()));
<mask>
<mask> mEventDispatcher.dispatchEvent(
<mask> new ReactTextInputEvent(
<mask> mEditText.getId(),
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove // TODO: remove contentSize from onTextChanged entirely now that onChangeContentSize exists?
int contentWidth = mEditText.getWidth();
int contentHeight = mEditText.getHeight();
// Use instead size of text content within EditText when available
if (mEditText.getLayout() != null) {
contentWidth = mEditText.getCompoundPaddingLeft() + mEditText.getLayout().getWidth() +
mEditText.getCompoundPaddingRight();
contentHeight = mEditText.getCompoundPaddingTop() + mEditText.getLayout().getHeight() +
mEditText.getCompoundPaddingTop();
}
</s> add </s> remove float[] radii = new float[8];
getRadii(source, sComputedCornerRadii, radii);
</s> add </s> remove float contentSizeWidth,
float contentSizeHeight,
</s> add </s> remove Map<String, RequestHandler> handlers = new HashMap<String, RequestHandler>();
</s> add Map<String, RequestHandler> handlers = new HashMap<>(); </s> remove private float mContentWidth;
private float mContentHeight;
</s> add </s> remove radii,
</s> add sComputedCornerRadii,
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java
|
keep add keep keep keep keep keep
|
<mask> private static final int DEFAULT_BORDER_RGB = 0x00FFFFFF & DEFAULT_BORDER_COLOR;
<mask> private static final int DEFAULT_BORDER_ALPHA = (0xFF000000 & DEFAULT_BORDER_COLOR) >>> 24;
<mask>
<mask> private static enum BorderStyle {
<mask> SOLID,
<mask> DASHED,
<mask> DOTTED;
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> add // ~0 == 0xFFFFFFFF, all bits set to 1.
private static final int ALL_BITS_SET = ~0;
// 0 == 0x00000000, all bits set to 0.
private static final int ALL_BITS_UNSET = 0;
</s> add private OkHttpClient mHttpClient; </s> remove final public class ReconnectingWebSocket implements WebSocketListener {
</s> add final public class ReconnectingWebSocket extends WebSocketListener { </s> remove private class Connection implements WebSocketListener {
</s> add private class Connection extends WebSocketListener { </s> remove private float mContentWidth;
private float mContentHeight;
</s> add </s> remove private boolean isBorderColorDifferentAtIntersectionPoints() {
return isFlagSet(BORDER_TOP_COLOR_SET) ||
isFlagSet(BORDER_BOTTOM_COLOR_SET) ||
isFlagSet(BORDER_LEFT_COLOR_SET) ||
isFlagSet(BORDER_RIGHT_COLOR_SET);
</s> add private static int fastBorderCompatibleColorOrZero(
float borderLeft,
float borderTop,
float borderRight,
float borderBottom,
int colorLeft,
int colorTop,
int colorRight,
int colorBottom) {
int andSmear = (borderLeft > 0 ? colorLeft : ALL_BITS_SET) &
(borderTop > 0 ? colorTop : ALL_BITS_SET) &
(borderRight > 0 ? colorRight : ALL_BITS_SET) &
(borderBottom > 0 ? colorBottom : ALL_BITS_SET);
int orSmear = (borderLeft > 0 ? colorLeft : ALL_BITS_UNSET) |
(borderTop > 0 ? colorTop : ALL_BITS_UNSET) |
(borderRight > 0 ? colorRight : ALL_BITS_UNSET) |
(borderBottom > 0 ? colorBottom : ALL_BITS_UNSET);
return andSmear == orSmear ? andSmear : 0;
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java
|
keep keep keep keep replace keep keep keep keep keep
|
<mask>
<mask> private void drawRoundedBackgroundWithBorders(Canvas canvas) {
<mask> updatePath();
<mask> int useColor = ColorUtil.multiplyColorAlpha(mColor, mAlpha);
<mask> if ((useColor >>> 24) != 0) { // color is not transparent
<mask> mPaint.setColor(useColor);
<mask> mPaint.setStyle(Paint.Style.FILL);
<mask> canvas.drawPath(mPathForBorderRadius, mPaint);
<mask> }
<mask> // maybe draw borders?
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove if ((useColor >>> 24) != 0) { // color is not transparent
</s> add if (Color.alpha(useColor) != 0) { // color is not transparent </s> remove boolean isDrawPathRequired = isBorderColorDifferentAtIntersectionPoints();
if (isDrawPathRequired && mPathForBorder == null) {
mPathForBorder = new Path();
}
</s> add // Check for fast path to border drawing.
int fastBorderColor = fastBorderCompatibleColorOrZero(
borderLeft,
borderTop,
borderRight,
borderBottom,
leftColor,
topColor,
rightColor,
bottomColor);
if (fastBorderColor != 0) {
// Fast border color draw.
if (Color.alpha(fastBorderColor) != 0) {
// Border color is not transparent.
// Draw center.
if (Color.alpha(mBackgroundColor) != 0) {
PAINT.setColor(mBackgroundColor);
if (Color.alpha(fastBorderColor) == 255) {
// The border will draw over the edges, so only draw the inset background.
canvas.drawRect(leftInset, topInset, rightInset, bottomInset, PAINT);
} else {
// The border is opaque, so we have to draw the entire background color.
canvas.drawRect(left, top, right, bottom, PAINT);
}
}
PAINT.setColor(fastBorderColor);
if (borderLeft > 0) {
canvas.drawRect(left, top, leftInset, bottom - borderBottom, PAINT);
}
if (borderTop > 0) {
canvas.drawRect(left + borderLeft, top, right, topInset, PAINT);
}
if (borderRight > 0) {
canvas.drawRect(rightInset, top + borderTop, right, bottom, PAINT);
}
if (borderBottom > 0) {
canvas.drawRect(left, bottomInset, right - borderRight, bottom, PAINT);
}
}
} else {
if (mPathForBorder == null) {
mPathForBorder = new Path();
} </s> remove if (borderBottom > 0 && colorBottom != Color.TRANSPARENT) {
mPaint.setColor(colorBottom);
mPathForBorder.reset();
mPathForBorder.moveTo(left, top + height);
mPathForBorder.lineTo(left + width, top + height);
mPathForBorder.lineTo(left + width - borderRight, top + height - borderBottom);
mPathForBorder.lineTo(left + borderLeft, top + height - borderBottom);
mPathForBorder.lineTo(left, top + height);
canvas.drawPath(mPathForBorder, mPaint);
</s> add // Check for fast path to border drawing.
int fastBorderColor = fastBorderCompatibleColorOrZero(
borderLeft,
borderTop,
borderRight,
borderBottom,
colorLeft,
colorTop,
colorRight,
colorBottom);
if (fastBorderColor != 0) {
if (Color.alpha(fastBorderColor) != 0) {
// Border color is not transparent.
int right = bounds.right;
int bottom = bounds.bottom;
mPaint.setColor(fastBorderColor);
if (borderLeft > 0) {
int leftInset = left + borderLeft;
canvas.drawRect(left, top, leftInset, bottom - borderBottom, mPaint);
}
if (borderTop > 0) {
int topInset = top + borderTop;
canvas.drawRect(left + borderLeft, top, right, topInset, mPaint);
}
if (borderRight > 0) {
int rightInset = right - borderRight;
canvas.drawRect(rightInset, top + borderTop, right, bottom, mPaint);
}
if (borderBottom > 0) {
int bottomInset = bottom - borderBottom;
canvas.drawRect(left, bottomInset, right - borderRight, bottom, mPaint);
}
}
} else {
if (mPathForBorder == null) {
mPathForBorder = new Path();
}
// If the path drawn previously is of the same color,
// there would be a slight white space between borders
// with anti-alias set to true.
// Therefore we need to disable anti-alias, and
// after drawing is done, we will re-enable it.
mPaint.setAntiAlias(false);
int width = bounds.width();
int height = bounds.height();
if (borderLeft > 0 && colorLeft != Color.TRANSPARENT) {
mPaint.setColor(colorLeft);
mPathForBorder.reset();
mPathForBorder.moveTo(left, top);
mPathForBorder.lineTo(left + borderLeft, top + borderTop);
mPathForBorder.lineTo(left + borderLeft, top + height - borderBottom);
mPathForBorder.lineTo(left, top + height);
mPathForBorder.lineTo(left, top);
canvas.drawPath(mPathForBorder, mPaint);
}
if (borderTop > 0 && colorTop != Color.TRANSPARENT) {
mPaint.setColor(colorTop);
mPathForBorder.reset();
mPathForBorder.moveTo(left, top);
mPathForBorder.lineTo(left + borderLeft, top + borderTop);
mPathForBorder.lineTo(left + width - borderRight, top + borderTop);
mPathForBorder.lineTo(left + width, top);
mPathForBorder.lineTo(left, top);
canvas.drawPath(mPathForBorder, mPaint);
}
if (borderRight > 0 && colorRight != Color.TRANSPARENT) {
mPaint.setColor(colorRight);
mPathForBorder.reset();
mPathForBorder.moveTo(left + width, top);
mPathForBorder.lineTo(left + width, top + height);
mPathForBorder.lineTo(left + width - borderRight, top + height - borderBottom);
mPathForBorder.lineTo(left + width - borderRight, top + borderTop);
mPathForBorder.lineTo(left + width, top);
canvas.drawPath(mPathForBorder, mPaint);
}
if (borderBottom > 0 && colorBottom != Color.TRANSPARENT) {
mPaint.setColor(colorBottom);
mPathForBorder.reset();
mPathForBorder.moveTo(left, top + height);
mPathForBorder.lineTo(left + width, top + height);
mPathForBorder.lineTo(left + width - borderRight, top + height - borderBottom);
mPathForBorder.lineTo(left + borderLeft, top + height - borderBottom);
mPathForBorder.lineTo(left, top + height);
canvas.drawPath(mPathForBorder, mPaint);
}
// re-enable anti alias
mPaint.setAntiAlias(true); </s> remove
// draw center
if (Color.alpha(mBackgroundColor) != 0) {
PAINT.setColor(mBackgroundColor);
canvas.drawRect(rightOfTheLeft, bottomOfTheTop, leftOfTheRight, topOfTheBottom, PAINT);
}
</s> add </s> remove // draw top
if (Color.alpha(topColor) != 0 && topWidth != 0) {
PAINT.setColor(topColor);
</s> add // Draw center. Any of the borders might be opaque or transparent, so we need to draw this.
if (Color.alpha(mBackgroundColor) != 0) {
PAINT.setColor(mBackgroundColor);
canvas.drawRect(left, top, right, bottom, PAINT);
} </s> remove } else {
canvas.drawRect(leftOfTheRight, bottomOfTheTop, right, topOfTheBottom, PAINT);
</s> add
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> }
<mask>
<mask> private void drawRectangularBackgroundWithBorders(Canvas canvas) {
<mask> int useColor = ColorUtil.multiplyColorAlpha(mColor, mAlpha);
<mask> if ((useColor >>> 24) != 0) { // color is not transparent
<mask> mPaint.setColor(useColor);
<mask> mPaint.setStyle(Paint.Style.FILL);
<mask> canvas.drawRect(getBounds(), mPaint);
<mask> }
<mask> // maybe draw borders?
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove if ((useColor >>> 24) != 0) { // color is not transparent
</s> add if (Color.alpha(useColor) != 0) { // color is not transparent </s> remove boolean isDrawPathRequired = isBorderColorDifferentAtIntersectionPoints();
if (isDrawPathRequired && mPathForBorder == null) {
mPathForBorder = new Path();
}
</s> add // Check for fast path to border drawing.
int fastBorderColor = fastBorderCompatibleColorOrZero(
borderLeft,
borderTop,
borderRight,
borderBottom,
leftColor,
topColor,
rightColor,
bottomColor);
if (fastBorderColor != 0) {
// Fast border color draw.
if (Color.alpha(fastBorderColor) != 0) {
// Border color is not transparent.
// Draw center.
if (Color.alpha(mBackgroundColor) != 0) {
PAINT.setColor(mBackgroundColor);
if (Color.alpha(fastBorderColor) == 255) {
// The border will draw over the edges, so only draw the inset background.
canvas.drawRect(leftInset, topInset, rightInset, bottomInset, PAINT);
} else {
// The border is opaque, so we have to draw the entire background color.
canvas.drawRect(left, top, right, bottom, PAINT);
}
}
PAINT.setColor(fastBorderColor);
if (borderLeft > 0) {
canvas.drawRect(left, top, leftInset, bottom - borderBottom, PAINT);
}
if (borderTop > 0) {
canvas.drawRect(left + borderLeft, top, right, topInset, PAINT);
}
if (borderRight > 0) {
canvas.drawRect(rightInset, top + borderTop, right, bottom, PAINT);
}
if (borderBottom > 0) {
canvas.drawRect(left, bottomInset, right - borderRight, bottom, PAINT);
}
}
} else {
if (mPathForBorder == null) {
mPathForBorder = new Path();
} </s> remove if (borderBottom > 0 && colorBottom != Color.TRANSPARENT) {
mPaint.setColor(colorBottom);
mPathForBorder.reset();
mPathForBorder.moveTo(left, top + height);
mPathForBorder.lineTo(left + width, top + height);
mPathForBorder.lineTo(left + width - borderRight, top + height - borderBottom);
mPathForBorder.lineTo(left + borderLeft, top + height - borderBottom);
mPathForBorder.lineTo(left, top + height);
canvas.drawPath(mPathForBorder, mPaint);
</s> add // Check for fast path to border drawing.
int fastBorderColor = fastBorderCompatibleColorOrZero(
borderLeft,
borderTop,
borderRight,
borderBottom,
colorLeft,
colorTop,
colorRight,
colorBottom);
if (fastBorderColor != 0) {
if (Color.alpha(fastBorderColor) != 0) {
// Border color is not transparent.
int right = bounds.right;
int bottom = bounds.bottom;
mPaint.setColor(fastBorderColor);
if (borderLeft > 0) {
int leftInset = left + borderLeft;
canvas.drawRect(left, top, leftInset, bottom - borderBottom, mPaint);
}
if (borderTop > 0) {
int topInset = top + borderTop;
canvas.drawRect(left + borderLeft, top, right, topInset, mPaint);
}
if (borderRight > 0) {
int rightInset = right - borderRight;
canvas.drawRect(rightInset, top + borderTop, right, bottom, mPaint);
}
if (borderBottom > 0) {
int bottomInset = bottom - borderBottom;
canvas.drawRect(left, bottomInset, right - borderRight, bottom, mPaint);
}
}
} else {
if (mPathForBorder == null) {
mPathForBorder = new Path();
}
// If the path drawn previously is of the same color,
// there would be a slight white space between borders
// with anti-alias set to true.
// Therefore we need to disable anti-alias, and
// after drawing is done, we will re-enable it.
mPaint.setAntiAlias(false);
int width = bounds.width();
int height = bounds.height();
if (borderLeft > 0 && colorLeft != Color.TRANSPARENT) {
mPaint.setColor(colorLeft);
mPathForBorder.reset();
mPathForBorder.moveTo(left, top);
mPathForBorder.lineTo(left + borderLeft, top + borderTop);
mPathForBorder.lineTo(left + borderLeft, top + height - borderBottom);
mPathForBorder.lineTo(left, top + height);
mPathForBorder.lineTo(left, top);
canvas.drawPath(mPathForBorder, mPaint);
}
if (borderTop > 0 && colorTop != Color.TRANSPARENT) {
mPaint.setColor(colorTop);
mPathForBorder.reset();
mPathForBorder.moveTo(left, top);
mPathForBorder.lineTo(left + borderLeft, top + borderTop);
mPathForBorder.lineTo(left + width - borderRight, top + borderTop);
mPathForBorder.lineTo(left + width, top);
mPathForBorder.lineTo(left, top);
canvas.drawPath(mPathForBorder, mPaint);
}
if (borderRight > 0 && colorRight != Color.TRANSPARENT) {
mPaint.setColor(colorRight);
mPathForBorder.reset();
mPathForBorder.moveTo(left + width, top);
mPathForBorder.lineTo(left + width, top + height);
mPathForBorder.lineTo(left + width - borderRight, top + height - borderBottom);
mPathForBorder.lineTo(left + width - borderRight, top + borderTop);
mPathForBorder.lineTo(left + width, top);
canvas.drawPath(mPathForBorder, mPaint);
}
if (borderBottom > 0 && colorBottom != Color.TRANSPARENT) {
mPaint.setColor(colorBottom);
mPathForBorder.reset();
mPathForBorder.moveTo(left, top + height);
mPathForBorder.lineTo(left + width, top + height);
mPathForBorder.lineTo(left + width - borderRight, top + height - borderBottom);
mPathForBorder.lineTo(left + borderLeft, top + height - borderBottom);
mPathForBorder.lineTo(left, top + height);
canvas.drawPath(mPathForBorder, mPaint);
}
// re-enable anti alias
mPaint.setAntiAlias(true); </s> remove
// draw center
if (Color.alpha(mBackgroundColor) != 0) {
PAINT.setColor(mBackgroundColor);
canvas.drawRect(rightOfTheLeft, bottomOfTheTop, leftOfTheRight, topOfTheBottom, PAINT);
}
</s> add </s> remove // draw top
if (Color.alpha(topColor) != 0 && topWidth != 0) {
PAINT.setColor(topColor);
</s> add // Draw center. Any of the borders might be opaque or transparent, so we need to draw this.
if (Color.alpha(mBackgroundColor) != 0) {
PAINT.setColor(mBackgroundColor);
canvas.drawRect(left, top, right, bottom, PAINT);
} </s> remove } else {
canvas.drawRect(leftOfTheRight, bottomOfTheTop, right, topOfTheBottom, PAINT);
</s> add
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java
|
keep replace keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep
|
<mask>
<mask> int top = bounds.top;
<mask> int left = bounds.left;
<mask> int width = bounds.width();
<mask> int height = bounds.height();
<mask>
<mask> // If the path drawn previously is of the same color,
<mask> // there would be a slight white space between borders
<mask> // with anti-alias set to true.
<mask> // Therefore we need to disable anti-alias, and
<mask> // after drawing is done, we will re-enable it.
<mask>
<mask> mPaint.setAntiAlias(false);
<mask>
<mask> if (mPathForBorder == null) {
<mask> mPathForBorder = new Path();
<mask> }
<mask>
<mask> if (borderLeft > 0 && colorLeft != Color.TRANSPARENT) {
<mask> mPaint.setColor(colorLeft);
<mask> mPathForBorder.reset();
<mask> mPathForBorder.moveTo(left, top);
<mask> mPathForBorder.lineTo(left + borderLeft, top + borderTop);
<mask> mPathForBorder.lineTo(left + borderLeft, top + height - borderBottom);
<mask> mPathForBorder.lineTo(left, top + height);
<mask> mPathForBorder.lineTo(left, top);
<mask> canvas.drawPath(mPathForBorder, mPaint);
<mask> }
<mask>
<mask> if (borderTop > 0 && colorTop != Color.TRANSPARENT) {
<mask> mPaint.setColor(colorTop);
<mask> mPathForBorder.reset();
<mask> mPathForBorder.moveTo(left, top);
<mask> mPathForBorder.lineTo(left + borderLeft, top + borderTop);
<mask> mPathForBorder.lineTo(left + width - borderRight, top + borderTop);
<mask> mPathForBorder.lineTo(left + width, top);
<mask> mPathForBorder.lineTo(left, top);
<mask> canvas.drawPath(mPathForBorder, mPaint);
<mask> }
<mask>
<mask> if (borderRight > 0 && colorRight != Color.TRANSPARENT) {
<mask> mPaint.setColor(colorRight);
<mask> mPathForBorder.reset();
<mask> mPathForBorder.moveTo(left + width, top);
<mask> mPathForBorder.lineTo(left + width, top + height);
<mask> mPathForBorder.lineTo(left + width - borderRight, top + height - borderBottom);
<mask> mPathForBorder.lineTo(left + width - borderRight, top + borderTop);
<mask> mPathForBorder.lineTo(left + width, top);
<mask> canvas.drawPath(mPathForBorder, mPaint);
<mask> }
<mask>
<mask> if (borderBottom > 0 && colorBottom != Color.TRANSPARENT) {
<mask> mPaint.setColor(colorBottom);
<mask> mPathForBorder.reset();
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove if (borderBottom > 0 && colorBottom != Color.TRANSPARENT) {
mPaint.setColor(colorBottom);
mPathForBorder.reset();
mPathForBorder.moveTo(left, top + height);
mPathForBorder.lineTo(left + width, top + height);
mPathForBorder.lineTo(left + width - borderRight, top + height - borderBottom);
mPathForBorder.lineTo(left + borderLeft, top + height - borderBottom);
mPathForBorder.lineTo(left, top + height);
canvas.drawPath(mPathForBorder, mPaint);
</s> add // Check for fast path to border drawing.
int fastBorderColor = fastBorderCompatibleColorOrZero(
borderLeft,
borderTop,
borderRight,
borderBottom,
colorLeft,
colorTop,
colorRight,
colorBottom);
if (fastBorderColor != 0) {
if (Color.alpha(fastBorderColor) != 0) {
// Border color is not transparent.
int right = bounds.right;
int bottom = bounds.bottom;
mPaint.setColor(fastBorderColor);
if (borderLeft > 0) {
int leftInset = left + borderLeft;
canvas.drawRect(left, top, leftInset, bottom - borderBottom, mPaint);
}
if (borderTop > 0) {
int topInset = top + borderTop;
canvas.drawRect(left + borderLeft, top, right, topInset, mPaint);
}
if (borderRight > 0) {
int rightInset = right - borderRight;
canvas.drawRect(rightInset, top + borderTop, right, bottom, mPaint);
}
if (borderBottom > 0) {
int bottomInset = bottom - borderBottom;
canvas.drawRect(left, bottomInset, right - borderRight, bottom, mPaint);
}
}
} else {
if (mPathForBorder == null) {
mPathForBorder = new Path();
}
// If the path drawn previously is of the same color,
// there would be a slight white space between borders
// with anti-alias set to true.
// Therefore we need to disable anti-alias, and
// after drawing is done, we will re-enable it.
mPaint.setAntiAlias(false);
int width = bounds.width();
int height = bounds.height();
if (borderLeft > 0 && colorLeft != Color.TRANSPARENT) {
mPaint.setColor(colorLeft);
mPathForBorder.reset();
mPathForBorder.moveTo(left, top);
mPathForBorder.lineTo(left + borderLeft, top + borderTop);
mPathForBorder.lineTo(left + borderLeft, top + height - borderBottom);
mPathForBorder.lineTo(left, top + height);
mPathForBorder.lineTo(left, top);
canvas.drawPath(mPathForBorder, mPaint);
}
if (borderTop > 0 && colorTop != Color.TRANSPARENT) {
mPaint.setColor(colorTop);
mPathForBorder.reset();
mPathForBorder.moveTo(left, top);
mPathForBorder.lineTo(left + borderLeft, top + borderTop);
mPathForBorder.lineTo(left + width - borderRight, top + borderTop);
mPathForBorder.lineTo(left + width, top);
mPathForBorder.lineTo(left, top);
canvas.drawPath(mPathForBorder, mPaint);
}
if (borderRight > 0 && colorRight != Color.TRANSPARENT) {
mPaint.setColor(colorRight);
mPathForBorder.reset();
mPathForBorder.moveTo(left + width, top);
mPathForBorder.lineTo(left + width, top + height);
mPathForBorder.lineTo(left + width - borderRight, top + height - borderBottom);
mPathForBorder.lineTo(left + width - borderRight, top + borderTop);
mPathForBorder.lineTo(left + width, top);
canvas.drawPath(mPathForBorder, mPaint);
}
if (borderBottom > 0 && colorBottom != Color.TRANSPARENT) {
mPaint.setColor(colorBottom);
mPathForBorder.reset();
mPathForBorder.moveTo(left, top + height);
mPathForBorder.lineTo(left + width, top + height);
mPathForBorder.lineTo(left + width - borderRight, top + height - borderBottom);
mPathForBorder.lineTo(left + borderLeft, top + height - borderBottom);
mPathForBorder.lineTo(left, top + height);
canvas.drawPath(mPathForBorder, mPaint);
}
// re-enable anti alias
mPaint.setAntiAlias(true); </s> remove
// re-enable anti alias
mPaint.setAntiAlias(true);
</s> add </s> remove boolean isDrawPathRequired = isBorderColorDifferentAtIntersectionPoints();
if (isDrawPathRequired && mPathForBorder == null) {
mPathForBorder = new Path();
}
</s> add // Check for fast path to border drawing.
int fastBorderColor = fastBorderCompatibleColorOrZero(
borderLeft,
borderTop,
borderRight,
borderBottom,
leftColor,
topColor,
rightColor,
bottomColor);
if (fastBorderColor != 0) {
// Fast border color draw.
if (Color.alpha(fastBorderColor) != 0) {
// Border color is not transparent.
// Draw center.
if (Color.alpha(mBackgroundColor) != 0) {
PAINT.setColor(mBackgroundColor);
if (Color.alpha(fastBorderColor) == 255) {
// The border will draw over the edges, so only draw the inset background.
canvas.drawRect(leftInset, topInset, rightInset, bottomInset, PAINT);
} else {
// The border is opaque, so we have to draw the entire background color.
canvas.drawRect(left, top, right, bottom, PAINT);
}
}
PAINT.setColor(fastBorderColor);
if (borderLeft > 0) {
canvas.drawRect(left, top, leftInset, bottom - borderBottom, PAINT);
}
if (borderTop > 0) {
canvas.drawRect(left + borderLeft, top, right, topInset, PAINT);
}
if (borderRight > 0) {
canvas.drawRect(rightInset, top + borderTop, right, bottom, PAINT);
}
if (borderBottom > 0) {
canvas.drawRect(left, bottomInset, right - borderRight, bottom, PAINT);
}
}
} else {
if (mPathForBorder == null) {
mPathForBorder = new Path();
} </s> remove float topWidth = resolveWidth(mBorderTopWidth, defaultWidth);
float bottomOfTheTop = top + topWidth;
</s> add float borderTop = resolveWidth(mBorderTopWidth, defaultWidth);
float topInset = top + borderTop; </s> remove private boolean isBorderColorDifferentAtIntersectionPoints() {
return isFlagSet(BORDER_TOP_COLOR_SET) ||
isFlagSet(BORDER_BOTTOM_COLOR_SET) ||
isFlagSet(BORDER_LEFT_COLOR_SET) ||
isFlagSet(BORDER_RIGHT_COLOR_SET);
</s> add private static int fastBorderCompatibleColorOrZero(
float borderLeft,
float borderTop,
float borderRight,
float borderBottom,
int colorLeft,
int colorTop,
int colorRight,
int colorBottom) {
int andSmear = (borderLeft > 0 ? colorLeft : ALL_BITS_SET) &
(borderTop > 0 ? colorTop : ALL_BITS_SET) &
(borderRight > 0 ? colorRight : ALL_BITS_SET) &
(borderBottom > 0 ? colorBottom : ALL_BITS_SET);
int orSmear = (borderLeft > 0 ? colorLeft : ALL_BITS_UNSET) |
(borderTop > 0 ? colorTop : ALL_BITS_UNSET) |
(borderRight > 0 ? colorRight : ALL_BITS_UNSET) |
(borderBottom > 0 ? colorBottom : ALL_BITS_UNSET);
return andSmear == orSmear ? andSmear : 0;
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java
|
keep keep keep keep replace replace replace replace replace replace replace replace replace keep replace replace replace keep keep
|
<mask> mPathForBorder.lineTo(left + width, top);
<mask> canvas.drawPath(mPathForBorder, mPaint);
<mask> }
<mask>
<mask> if (borderBottom > 0 && colorBottom != Color.TRANSPARENT) {
<mask> mPaint.setColor(colorBottom);
<mask> mPathForBorder.reset();
<mask> mPathForBorder.moveTo(left, top + height);
<mask> mPathForBorder.lineTo(left + width, top + height);
<mask> mPathForBorder.lineTo(left + width - borderRight, top + height - borderBottom);
<mask> mPathForBorder.lineTo(left + borderLeft, top + height - borderBottom);
<mask> mPathForBorder.lineTo(left, top + height);
<mask> canvas.drawPath(mPathForBorder, mPaint);
<mask> }
<mask>
<mask> // re-enable anti alias
<mask> mPaint.setAntiAlias(true);
<mask> }
<mask> }
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove int width = bounds.width();
int height = bounds.height();
// If the path drawn previously is of the same color,
// there would be a slight white space between borders
// with anti-alias set to true.
// Therefore we need to disable anti-alias, and
// after drawing is done, we will re-enable it.
mPaint.setAntiAlias(false);
if (mPathForBorder == null) {
mPathForBorder = new Path();
}
if (borderLeft > 0 && colorLeft != Color.TRANSPARENT) {
mPaint.setColor(colorLeft);
mPathForBorder.reset();
mPathForBorder.moveTo(left, top);
mPathForBorder.lineTo(left + borderLeft, top + borderTop);
mPathForBorder.lineTo(left + borderLeft, top + height - borderBottom);
mPathForBorder.lineTo(left, top + height);
mPathForBorder.lineTo(left, top);
canvas.drawPath(mPathForBorder, mPaint);
}
if (borderTop > 0 && colorTop != Color.TRANSPARENT) {
mPaint.setColor(colorTop);
mPathForBorder.reset();
mPathForBorder.moveTo(left, top);
mPathForBorder.lineTo(left + borderLeft, top + borderTop);
mPathForBorder.lineTo(left + width - borderRight, top + borderTop);
mPathForBorder.lineTo(left + width, top);
mPathForBorder.lineTo(left, top);
canvas.drawPath(mPathForBorder, mPaint);
}
if (borderRight > 0 && colorRight != Color.TRANSPARENT) {
mPaint.setColor(colorRight);
mPathForBorder.reset();
mPathForBorder.moveTo(left + width, top);
mPathForBorder.lineTo(left + width, top + height);
mPathForBorder.lineTo(left + width - borderRight, top + height - borderBottom);
mPathForBorder.lineTo(left + width - borderRight, top + borderTop);
mPathForBorder.lineTo(left + width, top);
canvas.drawPath(mPathForBorder, mPaint);
}
</s> add int top = bounds.top; </s> remove float topWidth = resolveWidth(mBorderTopWidth, defaultWidth);
float bottomOfTheTop = top + topWidth;
</s> add float borderTop = resolveWidth(mBorderTopWidth, defaultWidth);
float topInset = top + borderTop; </s> remove boolean isDrawPathRequired = isBorderColorDifferentAtIntersectionPoints();
if (isDrawPathRequired && mPathForBorder == null) {
mPathForBorder = new Path();
}
</s> add // Check for fast path to border drawing.
int fastBorderColor = fastBorderCompatibleColorOrZero(
borderLeft,
borderTop,
borderRight,
borderBottom,
leftColor,
topColor,
rightColor,
bottomColor);
if (fastBorderColor != 0) {
// Fast border color draw.
if (Color.alpha(fastBorderColor) != 0) {
// Border color is not transparent.
// Draw center.
if (Color.alpha(mBackgroundColor) != 0) {
PAINT.setColor(mBackgroundColor);
if (Color.alpha(fastBorderColor) == 255) {
// The border will draw over the edges, so only draw the inset background.
canvas.drawRect(leftInset, topInset, rightInset, bottomInset, PAINT);
} else {
// The border is opaque, so we have to draw the entire background color.
canvas.drawRect(left, top, right, bottom, PAINT);
}
}
PAINT.setColor(fastBorderColor);
if (borderLeft > 0) {
canvas.drawRect(left, top, leftInset, bottom - borderBottom, PAINT);
}
if (borderTop > 0) {
canvas.drawRect(left + borderLeft, top, right, topInset, PAINT);
}
if (borderRight > 0) {
canvas.drawRect(rightInset, top + borderTop, right, bottom, PAINT);
}
if (borderBottom > 0) {
canvas.drawRect(left, bottomInset, right - borderRight, bottom, PAINT);
}
}
} else {
if (mPathForBorder == null) {
mPathForBorder = new Path();
} </s> remove float bottomWidth = resolveWidth(mBorderBottomWidth, defaultWidth);
float topOfTheBottom = bottom - bottomWidth;
</s> add float borderBottom = resolveWidth(mBorderBottomWidth, defaultWidth);
float bottomInset = bottom - borderBottom; </s> remove YGNodeTrailingPosition(child, mainAxis, width);
</s> add YGNodeTrailingMargin(child, mainAxis, width) -
YGNodeTrailingPosition(child, mainAxis, isMainAxisRow ? width : height);
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java
|
keep keep keep add keep keep keep keep
|
<mask> import android.webkit.WebViewClient;
<mask> import android.webkit.JavascriptInterface;
<mask> import android.webkit.ValueCallback;
<mask> import android.webkit.WebSettings;
<mask>
<mask> import com.facebook.common.logging.FLog;
<mask> import com.facebook.react.common.ReactConstants;
<mask> import com.facebook.react.bridge.Arguments;
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove import com.facebook.yoga.YogaDirection;
</s> add </s> remove import java.lang.IllegalStateException;
import javax.annotation.Nullable;
</s> add import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit; </s> remove import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.ReadableType;
import com.facebook.react.devsupport.interfaces.DevSupportManager;
</s> add </s> add import com.facebook.react.common.DebugServerException; </s> remove import okhttp3.RequestBody;
</s> add </s> remove import java.util.regex.Matcher;
import java.util.regex.Pattern;
</s> add
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java
|
keep keep keep keep replace keep keep keep keep keep
|
<mask>
<mask> @Override
<mask> public boolean shouldOverrideUrlLoading(WebView view, String url) {
<mask> if (url.startsWith("http://") || url.startsWith("https://") ||
<mask> url.startsWith("file://")) {
<mask> return false;
<mask> } else {
<mask> try {
<mask> Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
<mask> intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> add @ReactProp(name = "thirdPartyCookiesEnabled")
public void setThirdPartyCookiesEnabled(WebView view, boolean enabled) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
CookieManager.getInstance().setAcceptThirdPartyCookies(view, enabled);
}
}
</s> remove public void downloadBundleFromURL(final BundleDownloadCallback callback, final File outputFile, final String bundleURL) {
final Request request = new Request.Builder().url(bundleURL).addHeader("Accept", "multipart/mixed").build();
mDownloadBundleFromURLCall = Assertions.assertNotNull(mClient.newCall(request));
mDownloadBundleFromURLCall.enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
// ignore callback if call was cancelled
if (mDownloadBundleFromURLCall == null || mDownloadBundleFromURLCall.isCanceled()) {
mDownloadBundleFromURLCall = null;
return;
}
mDownloadBundleFromURLCall = null;
callback.onFailure(DebugServerException.makeGeneric("Could not connect to development server.", "URL: " + call.request().url().toString(), e));
}
@Override
public void onResponse(Call call, final Response response) throws IOException {
// ignore callback if call was cancelled
if (mDownloadBundleFromURLCall == null || mDownloadBundleFromURLCall.isCanceled()) {
mDownloadBundleFromURLCall = null;
return;
}
mDownloadBundleFromURLCall = null;
final String url = response.request().url().toString();
// Make sure the result is a multipart response and parse the boundary.
String contentType = response.header("content-type");
Pattern regex = Pattern.compile("multipart/mixed;.*boundary=\"([^\"]+)\"");
Matcher match = regex.matcher(contentType);
if (match.find()) {
String boundary = match.group(1);
MultipartStreamReader bodyReader = new MultipartStreamReader(response.body().source(), boundary);
boolean completed = bodyReader.readAllParts(new MultipartStreamReader.ChunkCallback() {
@Override
public void execute(Map<String, String> headers, Buffer body, boolean finished) throws IOException {
// encoded as JSON.
if (finished) {
// The http status code for each separate chunk is in the X-Http-Status header.
int status = response.code();
if (headers.containsKey("X-Http-Status")) {
status = Integer.parseInt(headers.get("X-Http-Status"));
}
processBundleResult(url, status, body, outputFile, callback);
} else {
if (!headers.containsKey("Content-Type") || !headers.get("Content-Type").equals("application/json")) {
return;
}
try {
JSONObject progress = new JSONObject(body.readUtf8());
String status = null;
if (progress.has("status")) {
status = progress.getString("status");
}
Integer done = null;
if (progress.has("done")) {
done = progress.getInt("done");
}
Integer total = null;
if (progress.has("total")) {
total = progress.getInt("total");
}
callback.onProgress(status, done, total);
} catch (JSONException e) {
FLog.e(ReactConstants.TAG, "Error parsing progress JSON. " + e.toString());
}
}
}
});
if (!completed) {
callback.onFailure(new DebugServerException("Error while reading multipart response.\n\nResponse code: " + response.code() + "\n\n" + "URL: " + call.request().url().toString() + "\n\n"));
}
} else {
/**
* In case the server doesn't support multipart/mixed responses,
* fallback to normal download.
*/
processBundleResult(url, response.code(), Okio.buffer(response.body().source()), outputFile, callback);
}
}
});
}
private void processBundleResult(String url, int statusCode, BufferedSource body, File outputFile, BundleDownloadCallback callback) throws IOException {
// Check for server errors. If the server error has the expected form, fail with more info.
if (statusCode != 200) {
String bodyString = body.readUtf8();
DebugServerException debugServerException = DebugServerException.parse(bodyString);
if (debugServerException != null) {
callback.onFailure(debugServerException);
} else {
StringBuilder sb = new StringBuilder();
sb.append("The development server returned response error code: ").append(statusCode).append("\n\n").append("URL: ").append(url).append("\n\n").append("Body:\n").append(bodyString);
callback.onFailure(new DebugServerException(sb.toString()));
}
return;
}
Sink output = null;
try {
output = Okio.sink(outputFile);
body.readAll(output);
callback.onSuccess();
} finally {
if (output != null) {
output.close();
}
}
}
public void cancelDownloadBundleFromURL() {
if (mDownloadBundleFromURLCall != null) {
mDownloadBundleFromURLCall.cancel();
mDownloadBundleFromURLCall = null;
}
}
</s> add </s> remove public void send(JSONObject object) throws IOException {
if (mWebSocket == null) {
return;
}
mWebSocket.sendMessage(RequestBody.create(WebSocket.TEXT, object.toString()));
</s> add public void send(final JSONObject object) {
new AsyncTask<WebSocket, Void, Void>() {
@Override
protected Void doInBackground(WebSocket... sockets) {
if (sockets == null || sockets.length == 0) {
return null;
}
try {
sockets[0].send(object.toString());
} catch (Exception e) {
FLog.w(TAG, "Couldn't send event to packager", e);
}
return null;
}
}.execute(mWebSocket); </s> remove });
</s> add }, minNumShakes); </s> remove mDevServerHelper.downloadBundleFromURL(new DevServerHelper.BundleDownloadCallback() {
</s> add mDevServerHelper.getBundleDownloader().downloadBundleFromURL(new BundleDownloader.DownloadCallback() { </s> remove public void onMessage(ResponseBody message) throws IOException {
</s> add public void onMessage(WebSocket webSocket, String text) {
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java
|
keep add keep keep keep keep
|
<mask> }
<mask>
<mask> @ReactProp(name = "scalesPageToFit")
<mask> public void setScalesPageToFit(WebView view, boolean enabled) {
<mask> view.getSettings().setUseWideViewPort(!enabled);
<mask> }
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove @ReactProp(name = ViewProps.LINE_HEIGHT, defaultInt = UNSET)
public void setLineHeight(int lineHeight) {
</s> add @ReactProp(name = ViewProps.LINE_HEIGHT, defaultFloat = UNSET)
public void setLineHeight(float lineHeight) { </s> remove url.startsWith("file://")) {
</s> add url.startsWith("file://") || url.equals("about:blank")) { </s> remove public DevSupportManagerImpl(Context applicationContext, ReactInstanceDevCommandsHandler reactInstanceCommandsHandler, @Nullable String packagerPathForJSBundleName, boolean enableOnCreate) {
this(applicationContext, reactInstanceCommandsHandler, packagerPathForJSBundleName, enableOnCreate, null);
</s> add public DevSupportManagerImpl(Context applicationContext, ReactInstanceDevCommandsHandler reactInstanceCommandsHandler, @Nullable String packagerPathForJSBundleName, boolean enableOnCreate, int minNumShakes) {
this(applicationContext, reactInstanceCommandsHandler, packagerPathForJSBundleName, enableOnCreate, null, minNumShakes); </s> remove * See {@link UIManagerModule#addMeasuredRootView}.
</s> add * See {@link UIManagerModule#addRootView}. </s> remove * See {@link UIManagerModule#addMeasuredRootView}.
</s> add * See {@link UIManagerModule#addRootView}. </s> remove public DevSupportManagerImpl(Context applicationContext, ReactInstanceDevCommandsHandler reactInstanceCommandsHandler, @Nullable String packagerPathForJSBundleName, boolean enableOnCreate, @Nullable RedBoxHandler redBoxHandler) {
</s> add public DevSupportManagerImpl(Context applicationContext, ReactInstanceDevCommandsHandler reactInstanceCommandsHandler, @Nullable String packagerPathForJSBundleName, boolean enableOnCreate, @Nullable RedBoxHandler redBoxHandler, int minNumShakes) {
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java
|
keep keep add keep keep keep keep
|
<mask> public class YogaValue {
<mask> static final YogaValue UNDEFINED = new YogaValue(YogaConstants.UNDEFINED, YogaUnit.UNDEFINED);
<mask> static final YogaValue ZERO = new YogaValue(0, YogaUnit.POINT);
<mask>
<mask> public final float value;
<mask> public final YogaUnit unit;
<mask>
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove final public class ReconnectingWebSocket implements WebSocketListener {
</s> add final public class ReconnectingWebSocket extends WebSocketListener { </s> remove public static Pattern mJsModuleIdPattern = Pattern.compile("(?:^|[/\\\\])(\\d+\\.js)$");
</s> add </s> add // ~0 == 0xFFFFFFFF, all bits set to 1.
private static final int ALL_BITS_SET = ~0;
// 0 == 0x00000000, all bits set to 0.
private static final int ALL_BITS_UNSET = 0;
</s> remove private float mContentWidth;
private float mContentHeight;
</s> add </s> remove int rootTag = uiManager.addMeasuredRootView(rootView);
</s> add int rootTag = uiManager.addRootView(rootView); </s> remove public class JSDebuggerWebSocketClient implements WebSocketListener {
</s> add public class JSDebuggerWebSocketClient extends WebSocketListener {
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/java/com/facebook/yoga/YogaValue.java
|
keep keep add keep keep keep keep keep keep
|
<mask> namespace facebook {
<mask> namespace jni {
<mask>
<mask> // Keeps a thread-local reference to the current thread's JNIEnv.
<mask> struct Environment {
<mask> // May be null if this thread isn't attached to the JVM
<mask> FBEXPORT static JNIEnv* current();
<mask> static void initialize(JavaVM* vm);
<mask>
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove StaticInitialized<ThreadLocal<JNIEnv>> g_env;
JavaVM* g_vm = nullptr;
struct JThreadScopeSupport : JavaClass<JThreadScopeSupport> {
static auto constexpr kJavaDescriptor = "Lcom/facebook/jni/ThreadScopeSupport;";
// These reinterpret_casts are a totally dangerous pattern. Don't use them. Use HybridData instead.
static void runStdFunction(std::function<void()>&& func) {
static auto method = javaClassStatic()->getStaticMethod<void(jlong)>("runStdFunction");
method(javaClassStatic(), reinterpret_cast<jlong>(&func));
}
</s> add </s> remove void HybridData::setNativePointer(std::unique_ptr<BaseHybridClass> new_value) {
static auto pointerField = getClass()->getField<jlong>("mNativePointer");
auto* old_value = reinterpret_cast<BaseHybridClass*>(getFieldValue(pointerField));
if (new_value) {
// Modify should only ever be called once with a non-null
// new_value. If this happens again it's a programmer error, so
// blow up.
FBASSERTMSGF(old_value == 0, "Attempt to set C++ native pointer twice");
} else if (old_value == 0) {
return;
}
// delete on a null pointer is defined to be a noop.
delete old_value;
// This releases ownership from the unique_ptr, and passes the pointer, and
// ownership of it, to HybridData which is managed by the java GC. The
// finalizer on hybridData calls resetNative which will delete the object, if
// resetNative has not already been called.
setFieldValue(pointerField, reinterpret_cast<jlong>(new_value.release()));
}
BaseHybridClass* HybridData::getNativePointer() {
static auto pointerField = getClass()->getField<jlong>("mNativePointer");
auto* value = reinterpret_cast<BaseHybridClass*>(getFieldValue(pointerField));
if (!value) {
throwNewJavaException("java/lang/NullPointerException", "java.lang.NullPointerException");
}
return value;
}
</s> add </s> remove #include <sys/system_properties.h>
</s> add # include <fb/Build.h> </s> remove env = facebook::jni::Environment::ensureCurrentThreadIsAttached();
FBASSERT(env);
</s> add // Check if the thread is attached by someone else.
auto result = getEnv(&env);
if (result == JNI_OK) {
return;
}
// We don't know how to deal with anything other than JNI_OK or JNI_DETACHED.
FBASSERT(result == JNI_EDETACHED);
// If there's already a ThreadScope on the stack, then the thread should be attached.
FBASSERT(!previous_);
attachCurrentThread(); </s> remove static void runStdFunctionImpl(alias_ref<JClass>, jlong ptr) {
(*reinterpret_cast<std::function<void()>*>(ptr))();
}
static void OnLoad() {
// We need the javaClassStatic so that the class lookup is cached and that
// runStdFunction can be called from a ThreadScope-attached thread.
javaClassStatic()->registerNatives({
makeNativeMethod("runStdFunctionImpl", runStdFunctionImpl),
});
}
};
</s> add ThreadLocal<ThreadScope>& scopeStorage() {
// We don't want the ThreadLocal to delete the ThreadScopes.
static ThreadLocal<ThreadScope> scope([] (void*) {});
return scope; </s> remove static jniType toJniRet(global_ref<jniType> t) {
</s> add static jniType toJniRet(global_ref<jniType>&& t) {
// If this gets called, ownership the global_ref was passed in here. (It's
// probably a copy of a persistent global_ref made when a function was
// declared to return a global_ref, but it could moved out or otherwise not
// referenced elsewhere. Doesn't matter.) Either way, the only safe way
// to return it is to make a local_ref, release it, and return the
// underlying local jobject.
auto ret = make_local(t);
return ret.release();
}
static jniType toJniRet(const global_ref<jniType>& t) {
// If this gets called, the function was declared to return const&. We
// have a ref to a global_ref whose lifetime will exceed this call, so we
// can just get the underlying jobject and return it to java without
// needing to make a local_ref.
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/jni/first-party/fb/include/fb/Environment.h
|
keep add keep keep keep keep
|
<mask>
<mask> static void OnLoad();
<mask> private:
<mask> friend struct Environment;
<mask> ThreadScope* previous_;
<mask> // If the JNIEnv* is set, it is guaranteed to be valid at least through the
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> add friend struct Environment;
ThreadScope* previous_;
// If the JNIEnv* is set, it is guaranteed to be valid at least through the
// lifetime of this ThreadScope. The only case where that guarantee can be
// made is when there is a java frame in the stack below this.
JNIEnv* env_; </s> remove // shouldn't have to jump through java.
</s> add // shouldn't have to jump through java. It should be enough to check if the
// attach state env* is set. </s> remove // be thrown, it aborts the program. This is a noexcept function at C++ level.
FBEXPORT void translatePendingCppExceptionToJavaException() noexcept;
</s> add // be thrown, it aborts the program.
FBEXPORT void translatePendingCppExceptionToJavaException();
#ifndef FBJNI_NO_EXCEPTION_PTR
FBEXPORT local_ref<JThrowable> getJavaExceptionForCppException(std::exception_ptr ptr);
#endif
FBEXPORT local_ref<JThrowable> getJavaExceptionForCppBackTrace(); </s> add namespace internal {
struct CacheEnvTag {};
}
</s> remove static void runStdFunctionImpl(alias_ref<JClass>, jlong ptr) {
(*reinterpret_cast<std::function<void()>*>(ptr))();
}
static void OnLoad() {
// We need the javaClassStatic so that the class lookup is cached and that
// runStdFunction can be called from a ThreadScope-attached thread.
javaClassStatic()->registerNatives({
makeNativeMethod("runStdFunctionImpl", runStdFunctionImpl),
});
}
};
</s> add ThreadLocal<ThreadScope>& scopeStorage() {
// We don't want the ThreadLocal to delete the ThreadScopes.
static ThreadLocal<ThreadScope> scope([] (void*) {});
return scope; </s> add jsize length_;
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/jni/first-party/fb/include/fb/Environment.h
|
keep keep add keep keep keep keep
|
<mask> // This constructor is only used internally by fbjni.
<mask> ThreadScope(JNIEnv*, internal::CacheEnvTag);
<mask> private:
<mask> bool attachedWithThisScope_;
<mask> };
<mask> }
<mask> }
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> add // This constructor is only used internally by fbjni.
ThreadScope(JNIEnv*, internal::CacheEnvTag); </s> remove // Assumes that utf8 is null terminated
</s> add // Assumes that utf8 is nul-terminated </s> remove // space we've used is all space we need
</s> add // space we've used is all space we need. Root node also should be shrunk to minimum </s> remove return JSC_JSStringIsEqualToUTF8CString(m_context, m_string, utf8);
</s> add return m_string ? JSC_JSStringIsEqualToUTF8CString(m_context, m_string, utf8) : false; </s> remove };
</s> add } </s> remove void HybridData::setNativePointer(std::unique_ptr<BaseHybridClass> new_value) {
static auto pointerField = getClass()->getField<jlong>("mNativePointer");
auto* old_value = reinterpret_cast<BaseHybridClass*>(getFieldValue(pointerField));
if (new_value) {
// Modify should only ever be called once with a non-null
// new_value. If this happens again it's a programmer error, so
// blow up.
FBASSERTMSGF(old_value == 0, "Attempt to set C++ native pointer twice");
} else if (old_value == 0) {
return;
}
// delete on a null pointer is defined to be a noop.
delete old_value;
// This releases ownership from the unique_ptr, and passes the pointer, and
// ownership of it, to HybridData which is managed by the java GC. The
// finalizer on hybridData calls resetNative which will delete the object, if
// resetNative has not already been called.
setFieldValue(pointerField, reinterpret_cast<jlong>(new_value.release()));
}
BaseHybridClass* HybridData::getNativePointer() {
static auto pointerField = getClass()->getField<jlong>("mNativePointer");
auto* value = reinterpret_cast<BaseHybridClass*>(getFieldValue(pointerField));
if (!value) {
throwNewJavaException("java/lang/NullPointerException", "java.lang.NullPointerException");
}
return value;
}
</s> add
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/jni/first-party/fb/include/fb/Environment.h
|
keep add keep keep keep keep keep
|
<mask> #undef DEFINE_BOXED_PRIMITIVE
<mask>
<mask> inline local_ref<jobject> autobox(alias_ref<jobject> val) {
<mask> return make_local(val);
<mask> }
<mask>
<mask> }}
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove bool JByteBuffer::isDirect() {
</s> add bool JByteBuffer::isDirect() const { </s> remove registerNatives("com/facebook/jni/HybridData", {
makeNativeMethod("resetNative", resetNative),
</s> add registerNatives("com/facebook/jni/HybridData$Destructor", {
makeNativeMethod("deleteNative", deleteNative), </s> remove #define DEFINE_PRIMITIVE_CALL(TYPE, METHOD, CLASS) \
</s> add #define DEFINE_PRIMITIVE_CALL(TYPE, METHOD) \ </s> remove // jthrowable //////////////////////////////////////////////////////////////////////////////////////
inline local_ref<JThrowable> JThrowable::initCause(alias_ref<JThrowable> cause) {
static auto meth = javaClassStatic()->getMethod<javaobject(javaobject)>("initCause");
return meth(self(), cause.get());
}
</s> add </s> add // Root nodes flexGrow should always be 0
if (node->parent == NULL) {
return 0.0;
} </s> add #ifdef FBJNI_DEBUG_REFS
++internal::g_reference_stats.locals_created;
#endif
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/Boxed.h
|
keep keep keep replace keep replace replace keep keep
|
<mask>
<mask> static local_ref<JByteBuffer> wrapBytes(uint8_t* data, size_t size);
<mask>
<mask> bool isDirect();
<mask>
<mask> uint8_t* getDirectBytes();
<mask> size_t getDirectSize();
<mask> };
<mask>
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove size_t JByteBuffer::getDirectSize() {
</s> add size_t JByteBuffer::getDirectSize() const { </s> remove // jthrowable //////////////////////////////////////////////////////////////////////////////////////
inline local_ref<JThrowable> JThrowable::initCause(alias_ref<JThrowable> cause) {
static auto meth = javaClassStatic()->getMethod<javaobject(javaobject)>("initCause");
return meth(self(), cause.get());
}
</s> add </s> remove return JSC_JSStringIsEqualToUTF8CString(m_context, m_string, utf8);
</s> add return m_string ? JSC_JSStringIsEqualToUTF8CString(m_context, m_string, utf8) : false; </s> remove return JSC_JSStringGetLength(m_context, m_string);
</s> add return m_string ? JSC_JSStringGetLength(m_context, m_string) : 0; </s> remove // Length in bytes of a null-terminated utf8 encoded value
</s> add // Length in bytes of a nul-terminated utf8 encoded value
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/ByteBuffer.h
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> }
<mask>
<mask> inline bool JClass::isAssignableFrom(alias_ref<JClass> other) const noexcept {
<mask> const auto env = internal::getEnv();
<mask> const auto result = env->IsAssignableFrom(self(), other.get());
<mask> return result;
<mask> }
<mask>
<mask> template<typename F>
<mask> inline JConstructor<F> JClass::getConstructor() const {
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove // jthrowable //////////////////////////////////////////////////////////////////////////////////////
inline local_ref<JThrowable> JThrowable::initCause(alias_ref<JThrowable> cause) {
static auto meth = javaClassStatic()->getMethod<javaobject(javaobject)>("initCause");
return meth(self(), cause.get());
}
</s> add </s> remove auto length = env->GetStringLength(self());
return detail::utf16toUTF8(utf16String, length);
</s> add return detail::utf16toUTF8(utf16String.chars(), utf16String.length()); </s> remove #define DEFINE_PRIMITIVE_CALL(TYPE, METHOD, CLASS) \
</s> add #define DEFINE_PRIMITIVE_CALL(TYPE, METHOD) \ </s> add #ifdef FBJNI_DEBUG_REFS
++internal::g_reference_stats.locals_created;
#endif </s> remove auto cls = env->FindClass(name);
</s> add local_ref<jclass> cls = adopt_local(env->FindClass(name)); </s> remove bool JByteBuffer::isDirect() {
</s> add bool JByteBuffer::isDirect() const {
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/CoreClasses-inl.h
|
keep keep keep keep replace replace replace replace replace replace replace keep keep keep keep keep
|
<mask> }
<mask> };
<mask> }
<mask>
<mask> // jthrowable //////////////////////////////////////////////////////////////////////////////////////
<mask>
<mask> inline local_ref<JThrowable> JThrowable::initCause(alias_ref<JThrowable> cause) {
<mask> static auto meth = javaClassStatic()->getMethod<javaobject(javaobject)>("initCause");
<mask> return meth(self(), cause.get());
<mask> }
<mask>
<mask> // jtypeArray //////////////////////////////////////////////////////////////////////////////////////
<mask>
<mask> namespace detail {
<mask> inline size_t JArray::size() const noexcept {
<mask> const auto env = internal::getEnv();
</s> Update RN Android with SDK 19
fbshipit-source-id: fcb472a571 </s> remove const auto result = env->IsAssignableFrom(self(), other.get());
</s> add // Ths method has behavior compatible with the
// java.lang.Class#isAssignableFrom method. The order of the
// arguments to the JNI IsAssignableFrom C function is "opposite"
// from what some might expect, which makes this code look a little
// odd, but it is correct.
const auto result = env->IsAssignableFrom(other.get(), self()); </s> add #ifdef FBJNI_DEBUG_REFS
++internal::g_reference_stats.locals_created;
#endif </s> remove auto length = env->GetStringLength(self());
return detail::utf16toUTF8(utf16String, length);
</s> add return detail::utf16toUTF8(utf16String.chars(), utf16String.length()); </s> remove bool JByteBuffer::isDirect() {
</s> add bool JByteBuffer::isDirect() const { </s> remove auto cls = env->FindClass(name);
</s> add local_ref<jclass> cls = adopt_local(env->FindClass(name)); </s> remove #define DEFINE_PRIMITIVE_CALL(TYPE, METHOD, CLASS) \
</s> add #define DEFINE_PRIMITIVE_CALL(TYPE, METHOD) \
|
https://github.com/expo/expo/commit/7b58f4ab024999b96bc75072438f9d9cdc0bc7d2
|
android/ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/CoreClasses-inl.h
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.