Program: 41195
Project: 41195
Buggy source:
/** 
 * Called as part of the activity lifecycle when an activity is going into the background, but has not (yet) been killed.  The counterpart to  {@link #onResume}. <p>When activity B is launched in front of activity A, this callback will be invoked on A.  B will not be created until A's   {@link #onPause} returns,so be sure to not do anything lengthy here. <p>This callback is mostly used for saving any persistent state the activity is editing, to present a "edit in place" model to the user and making sure nothing is lost if there are not enough resources to start the new activity without first killing this one.  This is also a good place to do things like stop animations and other things that consume a noticeable mount of CPU in order to make the switch to the next activity as fast as possible, or to close resources that are exclusive access such as the camera. <p>In situations where the system needs more memory it may kill paused processes to reclaim resources.  Because of this, you should be sure that all of your state is saved by the time you return from this function.  In general  {@link #onSaveInstanceState} is used to saveper-instance state in the activity and this method is used to store global persistent data (in content providers, files, etc.) <p>After receiving this call you will usually receive a following call to  {@link #onStop} (after the next activity has been resumed anddisplayed), however in some cases there will be a direct call back to {@link #onResume} without going through the stopped state.<p><em>Derived classes must call through to the super class's implementation of this method.  If they do not, an exception will be thrown.</em></p>
 * @see #onResume
 * @see #onSaveInstanceState
 * @see #onStop
 */
protected void onPause(){
  mCalled=true;
  QueuedWork.waitToFinish();
}

Fixed version (ground truth):
/** 
 * Called as part of the activity lifecycle when an activity is going into the background, but has not (yet) been killed.  The counterpart to  {@link #onResume}. <p>When activity B is launched in front of activity A, this callback will be invoked on A.  B will not be created until A's   {@link #onPause} returns,so be sure to not do anything lengthy here. <p>This callback is mostly used for saving any persistent state the activity is editing, to present a "edit in place" model to the user and making sure nothing is lost if there are not enough resources to start the new activity without first killing this one.  This is also a good place to do things like stop animations and other things that consume a noticeable mount of CPU in order to make the switch to the next activity as fast as possible, or to close resources that are exclusive access such as the camera. <p>In situations where the system needs more memory it may kill paused processes to reclaim resources.  Because of this, you should be sure that all of your state is saved by the time you return from this function.  In general  {@link #onSaveInstanceState} is used to saveper-instance state in the activity and this method is used to store global persistent data (in content providers, files, etc.) <p>After receiving this call you will usually receive a following call to  {@link #onStop} (after the next activity has been resumed anddisplayed), however in some cases there will be a direct call back to {@link #onResume} without going through the stopped state.<p><em>Derived classes must call through to the super class's implementation of this method.  If they do not, an exception will be thrown.</em></p>
 * @see #onResume
 * @see #onSaveInstanceState
 * @see #onStop
 */
protected void onPause(){
  mCalled=true;
}