Rate This Document
Findability
Accuracy
Completeness
Readability

Stopping the Instruction Stream Engine Object

Application Scenario

When you exit the cloud phone or reconnect to the cloud phone, you need to stop the started recvData thread and then call the stop API of the engine.

Prerequisites

The instruction stream engine has been started.

Development Process

  1. Stop logic threads such as recvData.
  2. Call the stop API of the instruction stream engine.

Encoding Instance

public class Activity implements BaseActivity {
    protected void StopCloudPhone() {
        threadPool.submit(new StopPhoneRunnable());
    }
}
public class StopPhoneRunnable implements Runnable  {
    @Override
    public void run() {
       // Stop logic threads such as the receive thread.
       upstreamReceiveDispatcher.stopBlocked();
       // Stop the engine.
       engine.stop();
       runOnUiThread(new Runnable() {
           @Override
           public void run() {
              finish();
              android.os.Process.killProcess(android.os.Process.myPid());
           }
       });
    }
}