Andrdoid built-in video file

Source: Internet
Author: User

Andrdoid built-in video file

This method is only suitable for scenarios with built-in storage.

1. Create a folder built_in_video under the vendor/sprd and place the built-in video file and copy steps.

Steps: 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 to the master mk.

Include vendor/sprd/built_in_video/internal_media.mk

 

2. Place the built-in USB flash drive in the preloadvideo folder created by vendor/sprd/open-source/tools, and copy the system/preloadvideo/Girs file to the built-in USB flash drive.

Android. mk is 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}; do
Cat $ {PRELOAD_SOURCE}/$ {I} >$ {PRELOAD_DEST}/$ {I}
Done
Echo "abcd" >$ {PRELOAD_FLAG}
Fi

Add

PRODUCT_PACKAGES + = \

Preloadvideo. sh

 

3. init. board. rc in 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 the notifyVolumeStateChange method

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 to run service preloadvideo when loading the internal storageCopy the video to the internal storage

 

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.