I faced the same problem. The problem is you are not allocating size of the buffer for depth and stencil in configAttribslist. So its not calculating the depth even when you specify DepthTest.
solution: add the following lines to eglChooseConfig attribs list. EGL10.EGL_DEPTH_SIZE, 8, EGL10.EGL_STENCIL_SIZE, 8, this fixed the issue for me.
Code:
private static int[] s_configAttribs2 = {
EGL10.EGL_RED_SIZE, 4,
EGL10.EGL_GREEN_SIZE, 4,
EGL10.EGL_BLUE_SIZE, 4,
EGL10.EGL_DEPTH_SIZE, 8,
EGL10.EGL_STENCIL_SIZE, 8,
EGL10.EGL_SAMPLE_BUFFERS, 1,
EGL10.EGL_RENDERABLE_TYPE,
EGL_OPENGL_ES2_BIT,
EGL10.EGL_NONE
};
egl.eglChooseConfig(display, s_configAttribs2, configs, numConfigs, num_config);