Skip to content

Commit

Permalink
fix(🤖): Fix regression with PictureView on Android (#2813)
Browse files Browse the repository at this point in the history
A user could inject the deprecated mode property directly which would cause a crash
  • Loading branch information
wcandillon authored Dec 16, 2024
1 parent b72c441 commit 84a3b3a
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ public void onSurfaceDestroyed() {

protected abstract void surfaceDestroyed();

protected abstract void setMode(String mode);

protected abstract void setDebugMode(boolean show);

protected abstract void registerView(int nativeId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ public void setNativeId(@NonNull ReactViewGroup view, @Nullable String nativeId)
((SkiaBaseView)view).registerView(nativeIdResolved);
}

@ReactProp(name = "mode")
public void setMode(T view, String mode) {
((SkiaBaseView)view).setMode(mode);
}

@ReactProp(name = "debug")
public void setDebug(T view, boolean show) {
((SkiaBaseView)view).setDebugMode(show);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ protected void finalize() throws Throwable {

protected native void setBgColor(int color);

protected native void setMode(String mode);

protected native void setDebugMode(boolean show);

protected native void registerView(int nativeId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ protected void finalize() throws Throwable {

protected native void setBgColor(int color);

protected native void setMode(String mode);

protected native void setDebugMode(boolean show);

protected native void registerView(int nativeId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ public SkiaPictureViewManagerDelegate(U viewManager) {
@Override
public void setProperty(T view, String propName, @Nullable Object value) {
switch (propName) {
case "mode":
mViewManager.setMode(view, value == null ? null : (String) value);
break;
case "opaque":
mViewManager.setOpaque(view, value != null && (boolean) value);
case "debug":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import androidx.annotation.Nullable;

public interface SkiaPictureViewManagerInterface<T extends View> {
void setMode(T view, @Nullable String value);
void setDebug(T view, boolean value);
void setOpaque(T view, boolean value);
}

0 comments on commit 84a3b3a

Please sign in to comment.