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