When playing media, I am able to place media image onto a lockscreen via
RemoteControlClient.MetadataEditor editor = remoteControlClient.editMetadata(true);
editor.putBitmap(RemoteControlClient.MetadataEditor.BITMAP_KEY_ARTWORK, bitmap);
or
MediaMetadataCompat.Builder builder = new MediaMetadataCompat.Builder();
builder.putBitmap(MediaMetadataCompat.METADATA_KEY_ART, bitmap);
however, if I use landscape source image (16:9) and lockscreen orientation is potrait, the background image is zoomed (pan and scan) instead of letter boxed. Is there any api I can use to force the scaling method, or the system will render the image only this way?
I have faced the same issue (on phone lockscreen and on Android Auto), I have not found the solution yet but I think that you can do a trick :
Add a transparent padding on top and above to your Bitmap to fit the lock screen, here is the code which makes your bitmap square, you can inspire from it to make your bitmap fit the screen ratio :
public static Bitmap createSquaredBitmap(Bitmap srcBmp) {
int dim = Math.max(srcBmp.getWidth(), srcBmp.getHeight());
Bitmap dstBmp = Bitmap.createBitmap(dim, dim, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(dstBmp);
canvas.drawColor(Color.TRANSPARENT);
canvas.drawBitmap(srcBmp, (dim - srcBmp.getWidth()) / 2, (dim - srcBmp.getHeight()) / 2, null);
return dstBmp;
}