Updated on 2023-08-02 GMT+08:00

Loading Pictures

Function

This function can be used in code scanning scenarios. For example, inject a QR code to the camera of a cloud phone.

How to Use

  1. Obtain the images released on and after October 9, 2020 from AOSP7 Cloud Phone Image Change History.
  2. Replace the image of the cloud phone with the obtained image ID. Restart the cloud phone and replace the image by clicking Restart on the CPH console or calling the Restarting Cloud Phones API.
  3. Upload the pictures to the /data/local/tmp/ directory of the cloud phone. Example: /data/local/tmp/pic.jpeg
  4. Set cloud phone attribute com.cph.cam_local_pic_path to /data/local/tmp/pic.jpeg (by running the adb shell command or call the Updating Cloud Phone Attributes API).

    The setting takes effect immediately.

  5. Open an application that invokes the camera to view the uploaded picture.

Constraints

  • The cloud phone image must be an image released on October 9, 2020 or later. Obtain the image ID from AOSP7 Cloud Phone Image Change History.
  • The width and height of the picture must be 480*640. If the resolution is not 480 x 640, the picture may be zoomed in or out.
  • Only pictures in JPEG and PNG formats are supported.
  • The pictures must be stored in the /data/local/tmp/ directory.
  • The picture permission must be at least 644 (rw-r--r--).