Program: 191520
Project: 191520
Buggy source:
/** 
 * @hide 
 */
public ActivityOptions(Bundle opts){
  opts.setDefusable(true);
  mPackageName=opts.getString(KEY_PACKAGE_NAME);
  try {
    mUsageTimeReport=opts.getParcelable(KEY_USAGE_TIME_REPORT);
  }
 catch (  RuntimeException e) {
    Slog.w(TAG,e);
  }
  mLaunchBounds=opts.getParcelable(KEY_LAUNCH_BOUNDS);
  mAnimationType=opts.getInt(KEY_ANIM_TYPE);
switch (mAnimationType) {
case ANIM_CUSTOM:
    mCustomEnterResId=opts.getInt(KEY_ANIM_ENTER_RES_ID,0);
  mCustomExitResId=opts.getInt(KEY_ANIM_EXIT_RES_ID,0);
mAnimationStartedListener=IRemoteCallback.Stub.asInterface(opts.getBinder(KEY_ANIM_START_LISTENER));
break;
case ANIM_CUSTOM_IN_PLACE:
mCustomInPlaceResId=opts.getInt(KEY_ANIM_IN_PLACE_RES_ID,0);
break;
case ANIM_SCALE_UP:
case ANIM_CLIP_REVEAL:
mStartX=opts.getInt(KEY_ANIM_START_X,0);
mStartY=opts.getInt(KEY_ANIM_START_Y,0);
mWidth=opts.getInt(KEY_ANIM_WIDTH,0);
mHeight=opts.getInt(KEY_ANIM_HEIGHT,0);
break;
case ANIM_THUMBNAIL_SCALE_UP:
case ANIM_THUMBNAIL_SCALE_DOWN:
case ANIM_THUMBNAIL_ASPECT_SCALE_UP:
case ANIM_THUMBNAIL_ASPECT_SCALE_DOWN:
mThumbnail=(Bitmap)opts.getParcelable(KEY_ANIM_THUMBNAIL);
mStartX=opts.getInt(KEY_ANIM_START_X,0);
mStartY=opts.getInt(KEY_ANIM_START_Y,0);
mWidth=opts.getInt(KEY_ANIM_WIDTH,0);
mHeight=opts.getInt(KEY_ANIM_HEIGHT,0);
mAnimationStartedListener=IRemoteCallback.Stub.asInterface(opts.getBinder(KEY_ANIM_START_LISTENER));
break;
case ANIM_SCENE_TRANSITION:
mTransitionReceiver=opts.getParcelable(KEY_TRANSITION_COMPLETE_LISTENER);
mIsReturning=opts.getBoolean(KEY_TRANSITION_IS_RETURNING,false);
mSharedElementNames=opts.getStringArrayList(KEY_TRANSITION_SHARED_ELEMENTS);
mResultData=opts.getParcelable(KEY_RESULT_DATA);
mResultCode=opts.getInt(KEY_RESULT_CODE);
mExitCoordinatorIndex=opts.getInt(KEY_EXIT_COORDINATOR_INDEX);
break;
}
mLaunchStackId=opts.getInt(KEY_LAUNCH_STACK_ID,INVALID_STACK_ID);
mLaunchTaskId=opts.getInt(KEY_LAUNCH_TASK_ID,-1);
mAvoidMoveToFront=opts.getBoolean(KEY_DONT_MOVE_TO_FRONT,false);
mDockCreateMode=opts.getInt(KEY_DOCK_CREATE_MODE,DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT);
if (opts.containsKey(KEY_ANIM_SPECS)) {
Parcelable[] specs=opts.getParcelableArray(KEY_ANIM_SPECS);
mAnimSpecs=new AppTransitionAnimationSpec[specs.length];
for (int i=specs.length - 1; i >= 0; i--) {
mAnimSpecs[i]=(AppTransitionAnimationSpec)specs[i];
}
}
if (opts.containsKey(KEY_ANIMATION_FINISHED_LISTENER)) {
mAnimationFinishedListener=IRemoteCallback.Stub.asInterface(opts.getBinder(KEY_ANIMATION_FINISHED_LISTENER));
}
}

Fixed version (ground truth):
/** 
 * @hide 
 */
public ActivityOptions(Bundle opts){
  opts.setDefusable(true);
  mPackageName=opts.getString(KEY_PACKAGE_NAME);
  try {
    mUsageTimeReport=opts.getParcelable(KEY_USAGE_TIME_REPORT);
  }
 catch (  RuntimeException e) {
    Slog.w(TAG,e);
  }
  mLaunchBounds=opts.getParcelable(KEY_LAUNCH_BOUNDS);
  mAnimationType=opts.getInt(KEY_ANIM_TYPE);
switch (mAnimationType) {
case ANIM_CUSTOM:
    mCustomEnterResId=opts.getInt(KEY_ANIM_ENTER_RES_ID,0);
  mCustomExitResId=opts.getInt(KEY_ANIM_EXIT_RES_ID,0);
mAnimationStartedListener=IRemoteCallback.Stub.asInterface(opts.getBinder(KEY_ANIM_START_LISTENER));
break;
case ANIM_CUSTOM_IN_PLACE:
mCustomInPlaceResId=opts.getInt(KEY_ANIM_IN_PLACE_RES_ID,0);
break;
case ANIM_SCALE_UP:
case ANIM_CLIP_REVEAL:
mStartX=opts.getInt(KEY_ANIM_START_X,0);
mStartY=opts.getInt(KEY_ANIM_START_Y,0);
mWidth=opts.getInt(KEY_ANIM_WIDTH,0);
mHeight=opts.getInt(KEY_ANIM_HEIGHT,0);
break;
case ANIM_THUMBNAIL_SCALE_UP:
case ANIM_THUMBNAIL_SCALE_DOWN:
case ANIM_THUMBNAIL_ASPECT_SCALE_UP:
case ANIM_THUMBNAIL_ASPECT_SCALE_DOWN:
mThumbnail=(Bitmap)opts.getParcelable(KEY_ANIM_THUMBNAIL);
mStartX=opts.getInt(KEY_ANIM_START_X,0);
mStartY=opts.getInt(KEY_ANIM_START_Y,0);
mWidth=opts.getInt(KEY_ANIM_WIDTH,0);
mHeight=opts.getInt(KEY_ANIM_HEIGHT,0);
mAnimationStartedListener=IRemoteCallback.Stub.asInterface(opts.getBinder(KEY_ANIM_START_LISTENER));
break;
case ANIM_SCENE_TRANSITION:
mTransitionReceiver=opts.getParcelable(KEY_TRANSITION_COMPLETE_LISTENER);
mIsReturning=opts.getBoolean(KEY_TRANSITION_IS_RETURNING,false);
mSharedElementNames=opts.getStringArrayList(KEY_TRANSITION_SHARED_ELEMENTS);
mResultData=opts.getParcelable(KEY_RESULT_DATA);
mResultCode=opts.getInt(KEY_RESULT_CODE);
mExitCoordinatorIndex=opts.getInt(KEY_EXIT_COORDINATOR_INDEX);
break;
}
mLaunchStackId=opts.getInt(KEY_LAUNCH_STACK_ID,INVALID_STACK_ID);
mLaunchTaskId=opts.getInt(KEY_LAUNCH_TASK_ID,-1);
mTaskOverlay=opts.getBoolean(KEY_TASK_OVERLAY,false);
mDockCreateMode=opts.getInt(KEY_DOCK_CREATE_MODE,DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT);
if (opts.containsKey(KEY_ANIM_SPECS)) {
Parcelable[] specs=opts.getParcelableArray(KEY_ANIM_SPECS);
mAnimSpecs=new AppTransitionAnimationSpec[specs.length];
for (int i=specs.length - 1; i >= 0; i--) {
mAnimSpecs[i]=(AppTransitionAnimationSpec)specs[i];
}
}
if (opts.containsKey(KEY_ANIMATION_FINISHED_LISTENER)) {
mAnimationFinishedListener=IRemoteCallback.Stub.asInterface(opts.getBinder(KEY_ANIMATION_FINISHED_LISTENER));
}
}