`
daibalusu
  • 浏览: 344268 次
文章分类
社区版块
存档分类
最新评论

切换sd卡

 
阅读更多

/*..
....Start the switch process
...*/
private void switchStart(){
String primaryVolumePath = mVolumes.get(0).getPath();
String secondVolumePath = mVolumes.get(1).getPath();
if (mPrimaryVolumeExistBeforeSwitch) {
/*<DTS2012031903141 huangwen 20120315 begin */
//switch primary sdcard , but primary sd card is unmounted
if (EXTERNAL_SD.equals(SystemProperties.get("persist.sys.main_storage"))
&& (Environment.MEDIA_UNMOUNTED).equals(getVolumeState(primaryVolumePath))) {
Slog.i(TAG, "switch primary sdcard , but primary sd card is unmounted");
mSwitchMainCardStage = UNMOUNT_SECONDVOLUME;
unmountVolume(secondVolumePath, true, false);
} else {
mSwitchMainCardStage = UNMOUNT_PRIMARYVOLUME;
unmountVolume(primaryVolumePath, true, false);
}
/*<DTS2012031903141 huangwen 20120315 end */
} else {
mSwitchMainCardStage = UNMOUNT_SECONDVOLUME;
unmountVolume(secondVolumePath, true, false);
}
}
/*..
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics