Andrdoid built-in video files

Source: Internet
Author: User

This method is only suitable for situations with built-in storage, as far as peace partitioning is concerned.

1 Create a new folder under VENDOR/SPRD Built_in_video inside the video file to be built and copy footsteps

Footsteps are as follows: Internal_media.mk


local_path:= Vendor/sprd/built_in_video

Product_copy_files + = \
$ (Local_path)/media/girs_gee_0.mp4:system/preloadvideo/girs_gee_0.mp4


Include this internal_media.mk in the main MK

Include Vendor/sprd/built_in_video/internal_media.mk


2 Copy the System/preloadvideo/girs file into the internal USB flash drive after placing the internal USB flash drive inside the Vendor/sprd/open-source/tools new folder Preloadvideo

Android.mk as follows

Local_path:= $ (call My-dir)

Include $ (clear_vars)
Local_module_tags: = Optional
Local_module: = preloadvideo.sh
Local_module_class: = Executables
Local_module_path: = $ (target_out_optional_executables)
Local_src_files: = preloadvideo.sh
Include $ (build_prebuilt)

#!/system/bin/sh
Preload_dest=/storage/sdcard0/movies
Preload_flag=${preload_dest}/preloadvideo
Preload_source=/system/preloadvideo

if [!-D ${preload_dest}]
Then
Mkdir-p ${preload_dest}
Fi

if [!-f ${preload_flag}]
Then
files=$ (LS ${preload_source}/)
For i in ${files};d o
Cat ${preload_source}/${i} > ${preload_dest}/${i}
Done
echo "ABCD" > ${preload_flag}
Fi

Added in main engineering Master MK

Product_packages + = \

preloadvideo.sh


3 init.board.rc under the same folder as the Project Mk


Service preloadvideo/system/bin/logwrapper/system/xbin/preloadvideo.sh
Class Main
Disabled
OneShot

preloadvideo.sh


4 Frameworks/base/services/java/com/android/server/mountservice.java

In Method Notifyvolumestatechange

else if (newstate = = volumestate.mounted) {
if (debug_events) slog.i (TAG, "Updating volume State mounted");
Updatepublicvolumestate (volume, environment.media_mounted);
action = intent.action_media_mounted;
Android.os.SystemProperties.set ("Ctl.start", "Preloadvideo");

This is the time to load the built-in storage and run the service Preloadvideo to copy the video into the built-in storage


Andrdoid built-in video files

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.