Buggy code:
public class MoSyncThread extends Thread { private static MoSyncThread sMoSyncThread ; public native boolean nativeInitRuntime ( ) { } public native boolean nativeLoad ( FileDescriptor program , long programOffset , FileDescriptor resource , long resourceOffset ) { } public native boolean nativeLoadResource ( ByteBuffer resource ) { } public native ByteBuffer nativeLoadCombined ( ByteBuffer combined ) { } public native void nativeRun ( ) { } public native void nativePostEvent ( int [ ] eventBuffer ) { } public native int nativeCreateBinaryResource ( int resourceIndex , int length ) { } public native int nativeCreatePlaceholder ( ) { } MoSyncNetwork mMoSyncNetwork ; MoSyncBluetooth mMoSyncBluetooth ; MoSyncSound mMoSyncSound ; MoSyncLocation mMoSyncLocation ; MoSyncHomeScreen mMoSyncHomeScreen ; MoSyncNativeUI mMoSyncNativeUI ; MoSyncFile mMoSyncFile ; MoSyncFont mMoSyncFont ; MoSyncCameraController mMoSyncCameraController ; MoSyncSMS mMoSyncSMS ; MoSyncSensor mMoSyncSensor ; MoSyncPIM mMoSyncPIM ; MoSyncNFC mMoSyncNFC ; static final String PROGRAM_FILE = "program.mp3" ; static final String RESOURCE_FILE = "resources.mp3" ; private static final int CHUNK_READ_SIZE = 1024 ; private final MoSync mContext ; private MoSyncView mMoSyncView ; private boolean mHasDied ; private final AtomicBoolean mIsSleepingInMaWait = new AtomicBoolean ( false ) ; private int cameraScreen ; private long mResourceOffset = 0 ; ByteBuffer mRecompilerCodeBlock ; ByteBuffer mRecompilerEntryBlock ; Hashtable < Integer , ByteBuffer > mBinaryResources = new Hashtable < Integer , ByteBuffer > ( ) ; Hashtable < Integer , MoSyncThread . UBinData > mUBinaryResources = new Hashtable < Integer , MoSyncThread . UBinData > ( ) ; Hashtable < Integer , MoSyncThread . ImageCache > mImageResources = new Hashtable < Integer , MoSyncThread . ImageCache > ( ) ; Hashtable < Integer , String > mStores = new Hashtable < Integer , String > ( ) ; public ByteBuffer mMemDataSection ; ByteBuffer mResourceFile ; Canvas mCanvas ; Bitmap mBitmap ; int mWidth ; int mHeight ; int mClipLeft ; int mClipTop ; int mClipWidth ; int mClipHeight ; boolean mUsingFrameBuffer ; int mFrameBufferAddress ; int mFrameBufferSize ; Bitmap mFrameBufferBitmap ; MoSyncThread . ImageCache mDrawTargetScreen = null ; MoSyncThread . ImageCache mDrawTarget = null ; int mDrawTargetHandle = 0 ; Paint mPaint = new Paint ( ) ; Paint mBlitPaint = new Paint ( ) ; int mTextConsoleHeight ; int mTextConsoleAscent ; Rect mTextSizeRect = new Rect ( ) ; private final Rect mMaDrawImageRegionTempSourceRect = new Rect ( ) ; private final Rect mMaDrawImageRegionTempDestRect = new Rect ( ) ; int mMaxStoreId = 0 ; public boolean mIsUpdatingScreen = false ; static final String storesPath = "MAStore" ; BroadcastReceiver mScreenActivatedReceiver = null ; public MoSyncThread ( Context context , Handler handler ) throws Exception { } public static MoSyncThread getInstance ( ) { } public void onResume ( ) { } public void onPause ( ) { <START_BUG> mMoSyncSensor . onResume ( ) ; <END_BUG> } public void onDestroy ( ) { } public Activity getActivity ( ) { } public boolean isBluetoothApiAvailable ( ) { } public void bluetoothTurnedOn ( ) { } public void bluetoothTurnedOff ( ) { } public boolean isFontApiAvailable ( ) { } public void setMoSyncView ( MoSyncView moSyncView ) { } public boolean isDead ( ) { } public synchronized void updateSurfaceSize ( int width , int height ) { } public synchronized ByteBuffer getMemorySlice ( int addr , int len ) { } public boolean generateDataSection ( ByteBuffer byteBuffer ) { } public void threadPanic ( int errorCode , String message ) { } public boolean loadProgram ( ) { } public FileDescriptor getResourceFileDesriptor ( ) { } public int getResourceStartOffset ( ) { } public ByteBuffer readInputStream ( InputStream is ) throws Exception { } public int createDataObject ( byte [ ] data ) { } void storeIfBinaryAudioResource ( int soundHandle ) { } Bitmap decodeImageFromData ( final byte [ ] data , final BitmapFactory . Options options ) { } void recycleImageData ( final Bitmap bitmap ) { } Bitmap createBitmap ( final int width , final int height ) { } Bitmap createBitmapFromData ( final int width , final int height , final int [ ] pixels ) { } public void updateScreen ( ) { } public synchronized void postEvent ( int [ ] event ) { } @ Override public void run ( ) { } public static void logError ( String message , Throwable t ) { } public static void logError ( String message ) { } public MoSyncThread . ImageCache getImageResource ( int handle ) { } public ByteBuffer getBinaryResource ( int handle ) { } public byte [ ] getUnloadedBinaryResourceAsByteArray ( int handle ) { } void initSyscalls ( ) { } int maSetColor ( int rgb ) { } void maSetClipRect ( int left , int top , int width , int height ) { } void maPlot ( int posX , int posY ) { } void maLine ( int startX , int startY , int endX , int endY ) { } void maFillRect ( int left , int top , int width , int height ) { } void maFillTriangleStrip ( int address , int count ) { } void maFillTriangleFan ( int address , int count ) { } int maGetTextSize ( final String str ) { } int maGetTextSizeW ( final String str ) { } int maFontLoadDefault ( int type , int style , int size ) { } int maFontSetCurrent ( int fontHandle ) { } int maFontGetCount ( ) { } int maFontGetName ( int index , final int memBuffer , final int memBufferSize ) { } int maFontLoadWithName ( final String postScriptName , int size ) { } int maFontDelete ( int fontHandle ) { } public MoSyncFontHandle getMoSyncFont ( int fontHandle ) { } void maDrawText ( int left , int top , final String str ) { } void maDrawTextW ( int left , int top , final String str ) { } synchronized void maUpdateScreen ( ) { } public int maGetScrSize ( ) { }

Fix:
mMoSyncSensor . onPause ( ) ;