La captura de pantalla mediante programación no captura el contenido de surfaceVew

Tengo una aplicación que quiero poder capturar una captura de pantalla. El fondo del diseño es una vista de superficie que muestra el video de la cámara trasera. El siguiente código puede tomar una captura de pantalla, pero el contenido de la vista de superficie se guarda en negro. Aquí está el código:

btn.setOnClickListener(new OnClickListener()
{

public void onClick(View v)
{
    Random num = new Random();
    int nu=num.nextInt(1000);
    Bitmap bmp;
    CamView.setDrawingCacheEnabled(true); 
    CamView.buildDrawingCache(true);
    Bitmap bmp2 = Bitmap.createBitmap(CamView.getDrawingCache()); //Screenshot of the layout
    CamView.setDrawingCacheEnabled(false);

    SurView.setDrawingCacheEnabled(true); 
    SurView.buildDrawingCache(true);
    Bitmap bmp1 = Bitmap.createBitmap(SurView.getDrawingCache()); //Screenshot of the surfaceView
    SurView.setDrawingCacheEnabled(false);

    Bitmap bmOverlay = Bitmap.createBitmap(bmp1.getWidth(), bmp1.getHeight(),bmp1.getConfig());
    Canvas canvas = new Canvas(bmOverlay); //Overlaying the 2 bitmaps
    canvas.drawBitmap(bmp1, 0,0, null);
    canvas.drawBitmap(bmp2, 0,0, null);
    bmp=bmOverlay;

    //saving the file
    ByteArrayOutputStream bos = new ByteArrayOutputStream(); 
    bmp.compress(CompressFormat.JPEG, 100, bos); 
    byte[] bitmapdata = bos.toByteArray();
    ByteArrayInputStream fis = new ByteArrayInputStream(bitmapdata);

    String picId=String.valueOf(nu);
    String myfile="Ghost"+picId+".jpeg";

    File dir_image = new  File(Environment.getExternalStorageDirectory()+
            File.separator+"Ultimate Entity Detector");
    dir_image.mkdirs();

    try {
        File tmpFile = new File(dir_image,myfile); 
        FileOutputStream fos = new FileOutputStream(tmpFile);

         byte[] buf = new byte[1024];
            int len;
            while ((len = fis.read(buf)) > 0) {
                fos.write(buf, 0, len);
            }
                fis.close();
                fos.close();
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }
}
});

Actualicé el código. Ahora creo 2 mapas de bits, 1 para el diseño xml y 1 para surfaceView y luego los superpongo en un solo mapa de bits. Pero el mapa de bits de SurfaceView sigue siendo negro

Respuestas a la pregunta(2)

Su respuesta a la pregunta