Code example for Surface

Methods: release

    static void establishSurfaceTexturePeer(int pid, int type, SurfaceTexture st, int primaryID,
            int secondaryID) {
        Surface surface = new Surface(st);
        SandboxedProcessLauncher.establishSurfacePeer(pid, type, surface, primaryID, secondaryID);
        // We need to explicitly release the native resource of our newly created surface 
        // or the Surface class will print a warning message to the log in its finalizer. 
        // This should be ok to do since our caller is responsible for retaining a 
        // reference to the SurfaceTexture that is being sent across processes and the 
        // receiving end should have retained a reference before the binder call finished. 
     * @param context The application {@link Context}. 
     * @return Whether or not the device should be given a tablet UI.