api-impl: misc APIs for WhatsApp media chooser Activities

This commit is contained in:
Julian Winkler
2025-04-23 18:21:19 +02:00
parent 69b742263a
commit e011092025
19 changed files with 123 additions and 26 deletions

View File

@@ -626,9 +626,9 @@ public class BitmapFactory {
Trace.traceBegin(Trace.TRACE_TAG_GRAPHICS, "decodeFileDescriptor");
try {
if (nativeIsSeekable(fd)) {
bm = nativeDecodeFileDescriptor(fd, outPadding, opts);
} else {
//if (nativeIsSeekable(fd)) {
// bm = nativeDecodeFileDescriptor(fd, outPadding, opts);
//} else {
FileInputStream fis = new FileInputStream(fd);
try {
bm = decodeStreamInternal(fis, outPadding, opts);
@@ -638,7 +638,7 @@ public class BitmapFactory {
} catch (Throwable t) { /* ignore */
}
}
}
//}
if (bm == null && opts != null && opts.inBitmap != null) {
throw new IllegalArgumentException("Problem decoding into existing bitmap");

View File

@@ -474,6 +474,10 @@ public class Canvas {
return save();
}
public int saveLayer(RectF bounds, Paint paint) {
return save();
}
public void drawOval(RectF oval, Paint paint) {
Log.w("Canvas", "STUB: drawOval");
}

View File

@@ -1,10 +1,20 @@
package android.graphics.drawable;
public class TransitionDrawable extends Drawable {
import android.graphics.Canvas;
public TransitionDrawable(Drawable[] layers) {}
public class TransitionDrawable extends LayerDrawable {
public TransitionDrawable(Drawable[] layers) {
super(layers);
}
public void setCrossFadeEnabled(boolean enabled) {}
public void startTransition(int duration) {}
@Override
public void draw(Canvas canvas) {
// always draw the target drawable
mLayerState.mChildren[1].mDrawable.draw(canvas);
}
}