mt6735 设置外置SD卡上的音频为铃声后重启,铃声恢复为默认
时间:10-02
整理:3721RD
点击:
[DESCRIPTION]
若ProjectConfig.mk中mtk_SHARED_SDCARD=yes
有可能导致设置外置SD卡上的音频为铃声后重启,铃声恢复为默认
[SOLUTION]
在MediaProvider.java中添加如下改动:
1.添加ACTION_SHUTDOWN_IPO的定义:
/// M: Add to receive IPO shutdown to unregister mUnmountReceiver in shared sdcard project to avoid
/// delete sdcard entries in database.
private static final String ACTION_SHUTDOWN_IPO = "android.intent.action.ACTION_SHUTDOWN_IPO";
2.在mUnmountReceiver的onReceive()中添加对ACTION_SHUTDOWN和ACTION_SHUTDOWN_IPO的处理:
} else if (action.equals(Intent.ACTION_MEDIA_MOUNTED)) {
attachVolume(EXTERNAL_VOLUME);
}
/************** Add Start ***************/
/// M: Add to receive shutdown action to unregister mUnmountReceiver in shared sdcard project
/// to avoid delete sdcard entries in database. {@
else if (action.equals(Intent.ACTION_SHUTDOWN) || action.equals(ACTION_SHUTDOWN_IPO)) {
context.unregisterReceiver(mUnmountReceiver);
MtkLog.v(TAG, "unregisterReceiver mUnmountReceiver");
}
/************** Add End ***************/
3.在onCreate()中注册ACTION_SHUTDOWN和ACTION_SHUTDOWN_IPO的BroADCastReceiver:
/// M: Add to receive shutdown action to unregister mUnmountReceiver in shared sdcard project
/// to avoid delete sdcard entries in database.
if (FeatureOption.MTK_SHARED_SDCARD) {
IntentFiLTEr shutdownFilter = new IntentFilter(Intent.ACTION_SHUTDOWN);
shutdownFilter.adDACtion(ACTION_SHUTDOWN_IPO);
context.registerReceiver(mUnmountReceiver, shutdownFilter);
}
若ProjectConfig.mk中mtk_SHARED_SDCARD=yes
有可能导致设置外置SD卡上的音频为铃声后重启,铃声恢复为默认
[SOLUTION]
在MediaProvider.java中添加如下改动:
1.添加ACTION_SHUTDOWN_IPO的定义:
/// M: Add to receive IPO shutdown to unregister mUnmountReceiver in shared sdcard project to avoid
/// delete sdcard entries in database.
private static final String ACTION_SHUTDOWN_IPO = "android.intent.action.ACTION_SHUTDOWN_IPO";
2.在mUnmountReceiver的onReceive()中添加对ACTION_SHUTDOWN和ACTION_SHUTDOWN_IPO的处理:
} else if (action.equals(Intent.ACTION_MEDIA_MOUNTED)) {
attachVolume(EXTERNAL_VOLUME);
}
/************** Add Start ***************/
/// M: Add to receive shutdown action to unregister mUnmountReceiver in shared sdcard project
/// to avoid delete sdcard entries in database. {@
else if (action.equals(Intent.ACTION_SHUTDOWN) || action.equals(ACTION_SHUTDOWN_IPO)) {
context.unregisterReceiver(mUnmountReceiver);
MtkLog.v(TAG, "unregisterReceiver mUnmountReceiver");
}
/************** Add End ***************/
3.在onCreate()中注册ACTION_SHUTDOWN和ACTION_SHUTDOWN_IPO的BroADCastReceiver:
/// M: Add to receive shutdown action to unregister mUnmountReceiver in shared sdcard project
/// to avoid delete sdcard entries in database.
if (FeatureOption.MTK_SHARED_SDCARD) {
IntentFiLTEr shutdownFilter = new IntentFilter(Intent.ACTION_SHUTDOWN);
shutdownFilter.adDACtion(ACTION_SHUTDOWN_IPO);
context.registerReceiver(mUnmountReceiver, shutdownFilter);
}