android上拔出sd卡导致flash上媒体也消失问题解决方法
机器内部有一部分flash供客户使用,同时机器支持sd卡。当插入sd卡时候flash内部和sd卡内部的多媒体都可以被播放器识别,一旦拔掉sd卡,则flash内的媒体对播放器也不见了。
解决方法:
修改frameworks/base/services/java/com/android/server/MountService.java文件的函数:notifyMediaBadRemoval如下,红色为添加。
mContext.sendBroadcast(intent);
intent = new
Intent(Intent.ACTION_MEDIA_REMOVED,
Uri.parse("file://" +
path));
mContext.sendBroadcast(intent);
//添加下面几行
intent = new
Intent(Intent.ACTION_MEDIA_MOUNTED,Uri.parse("file://" +
"flash"));
intent.putExtra("read-only",
false);
mContext.sendBroadcast(intent);
}
同时也修改notifyMediaUnmounted(),在最后也加入上面几行
Intent intent = new Intent(Intent.ACTION_MEDIA_UNMOUNTED,
Uri.parse("file://" + path));
mContext.sendBroadcast(intent);
//添加开始
intent = new Intent(Intent.ACTION_MEDIA_MOUNTED,Uri.parse("file://" + "flash"));
intent.putExtra("read-only", false);
mContext.sendBroadcast(intent);
//添加结束
相关文档:
一、Nor flash(drivers\mtd\maps\at91rm9200_nor.c)
static struct mtd_partition partitions[] = {
{
.name = "Bootloader",
.size = 0x00040000,
.offset = 0,
.mask_flags = MTD_WRITEABLE /* force read-only */
......
package
{
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.system.fscommand;
import flash.display.StageDisplayState;
import flash.events.KeyboardEvent;
import flash.ui.Keyboard;
/**
* ...
* @author LittleSpace
*/
public class Main extends Sprite
{ ......
Apple has a long relationship with Adobe. In fact, we met Adobe’s founders when they were in their proverbial garage. Apple was their first big customer, adopting their Postscript language for our new Laserwriter printer. Apple invested in Adobe and owned around 20% of the company for many yea ......
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="WebApplication2.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="ser ......