question: private void sendVolumeKey ( int keyCode ) { assertTrue ( keyCode == KeyEvent . KEYCODE_VOLUME_UP || keyCode == KeyEvent . KEYCODE_VOLUME_DOWN ) ; long down = SystemClock . uptimeMillis ( ) ; KeyEvent keyDown = new KeyEvent ( down , down , KeyEvent . ACTION_DOWN , keyCode , 0 , 0 ) ; mTalkBack . onKeyEventShared ( keyDown ) ; long up = SystemClock . uptimeMillis ( ) ; KeyEvent keyUp = new KeyEvent ( down , up , KeyEvent . ACTION_UP , keyCode , 0 , 0 ) ; mTalkBack . onKeyEventShared ( keyUp ) ; }
target:  Volume button simulation needs to be handled separately from key event simulation because the normal Android system instrumentation will just change the system volume instead of delivering the volume key events to TalkBack.