Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 91
Registered: ‎05-13-2009
My Device: Not Specified
Accepted Solution

Application net_rim_bb_phone_app(64) is not responding; process terminated on Blackberry Javelin 8900 (Simulator)

[ Edited ]

Hi All.

I have custom PhoneListener (extends AbstractPhoneListener).

When call disconnected (callDisconnected) I show countdown animation. It works fine on Bold (simulator and device ) , but I am getting error Application net_rim_bb_phone_app(64) ... on 8900.

Animation is shown, but after few seconds it is crashed with error.

 

Please take a look of my code and tell what I do wrong, thanks.

 

  public void callDisconnected( int callId )
{
if( RedirectOptions.getInstance().isInjectingEndCall() )
{
// Reset
RedirectOptions.getInstance().setIsInjectingEndCall( false );

showCountdownAnimation();
}
}

private void showCountdownAnimation()
{
final AnimationPopup popup = new AnimationPopup();

CountdownBoardField countdownBoard = new CountdownBoardField();
countdownBoard.setAnimationListener( new AnimationListener()
{
public void onAnimationStart()
{
}

public void onAnimationEnd()
{
UiApplication.getUiApplication().invokeLater( new Runnable()
{
public void run()
{
if( popup.isDisplayed() )
{
UiApplication.getUiApplication().popScreen( popup );
}
};
} );

if( popup.isIsInterrupted() )
{
injectRedial();
}
else
{
runChirp();
}
}
} );

popup.add( countdownBoard );

UiApplication.getUiApplication().invokeLater( new Runnable()
{
public void run()
{
UiApplication.getUiApplication().pushGlobalScreen( popup, 0, UiEngine.GLOBAL_MODAL );
}
} );
}

 Animation Thread: (CoundownBoardField)

 

 

/**
* Handles the animation.
*/
private class AnimatorTimer extends Timer implements IAnimator
{
// #region Fields

private int mType;

private boolean mKeepGoing;

private boolean mEventsAllowed;

// #endregion

// #region Constructors

public AnimatorTimer()
{
super();

mEventsAllowed = true;
}

// #endregion

// #region Implementation

public synchronized void denyEvents()
{
mEventsAllowed = false;
}

public synchronized void allowEvents()
{
mEventsAllowed = true;
}

public synchronized void stopAnimation()
{
mKeepGoing = false;
}

public synchronized void startAnimation()
{
mKeepGoing = true;

run();

}

public boolean isAlive()
{
return mKeepGoing;
}

private void fireOnEndEvent()
{
CountdownBoardField.this.mAnimator = new AnimatorTimer();

if( mListener != null && mEventsAllowed )
{
mListener.onAnimationEnd();
}

}

public int getAnimationType()
{
return mType;
}

public void setAnimationType( int animationType )
{
int type = animationType;

if( animationType == Constants.ANIMATION_DEFAULT )
{
type = Constants.ANIMATION_PROGRESS;
}

mType = type;
}

private void doProgressAnimaion()
{
TimerTask task = new TimerTask()
{

public void run()
{
--mAngle;

if( mAngle <= 0 )
{
mKeepGoing = false;
}

if( !mKeepGoing )
{
// stop timer
cancel();

fireOnEndEvent();

return;
}

UiApplication.getUiApplication().invokeLater( new Runnable()
{
public void run()
{
invalidate();
}
} );
}
};

super.scheduleAtFixedRate( task, 0, mTimerInterval );
}

public void run()
{
switch( mType )
{
case Constants.ANIMATION_PROGRESS:
{
doProgressAnimaion();
}
break;

default:
{
throw new NotImplementedException( "Animation type: " + mType );
}
}

}
}

 * AnimationPopup starts animation when invokes:

 

 protected void onUiEngineAttached( boolean attached )
{
super.onUiEngineAttached( attached );

if( attached )
{
int count = getFieldCount();

for( int i = 0; i < count; i++ )
{
animate( getField( i ) );
}
}
}

 

 

 

Developer
Posts: 16,687
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Application net_rim_bb_phone_app(64) is not responding; process terminated on Blackberry Javelin 8900 (Simulator)

do not do any processing in the phone listener.

all code is executed in the context of the phone app.

synchronize to your app using global events or invokelater or runtimestore etc.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 91
Registered: ‎05-13-2009
My Device: Not Specified

Re: Application net_rim_bb_phone_app(64) is not responding; process terminated on Blackberry Javelin 8900 (Simulator)

Hi Simon.

 

Should operations, such as injectEndCall, injectRedial, also to be invoked in my app via global event?

Developer
Posts: 16,687
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Application net_rim_bb_phone_app(64) is not responding; process terminated on Blackberry Javelin 8900 (Simulator)

i start a new thread from the phonelistener if it does not interact with my application.

as long as you are aware of the behavior and do no blocking stuff on the listener you should be fine.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 91
Registered: ‎05-13-2009
My Device: Not Specified

Re: Application net_rim_bb_phone_app(64) is not responding; process terminated on Blackberry Javelin 8900 (Simulator)

Thanks for help.

I resolved the problem by adding Thread.yield() in animation thread loop.

 

The problem is simulator hung for a small time when disconnects phone call. I guess, it is problem only 8900 simultaor.

 

However, I modified my code and processing listener events throug global event.