如果没有,则初始化外部插入数据库的值。
private void sendExtAudPluginIntent(){
new Thread(new Runnable() {
public void run() {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Log.e("zcfdebug BootCompletedReceiver","we will send BTHW_STARTSTOP for extaudio in!");
Intent intent = new Intent(Intent.ACTION_EXTAUD_EVENT);
intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING);
intent.putExtra(Intent.EXTRA_EXTAUD_STATE, 1);
// Send the extaud event intent.
// There are many components in the system watching for this so as to
// adjust audio routing, screen orientation, etc.
ctx.sendBroadcast(intent);
}
}).start();
}
作者: zangcf 时间: 2016-4-5 22:18
验证上述代码:
第一步,验证如下代码是否运行
int extAudStatus=Ugpio.nativeGetExtAudStatus();
if(extAudStatus==1){
Log.e("zcfdebug BootCompletedReceiver","deyuntect extAudIn and we will send Intent.ACTION_EXTAUD_EVENT late!");
sendExtAudPluginIntent();
}else{
Log.e("zcfdebug BootCompletedReceiver","didnot detect extAudio Plugin in BootCompletedReceiver");
editor.putBoolean("ExtAudStatus", false);
editor.commit();
}
作者: zangcf 时间: 2016-4-5 23:01
int getExtAudStatus(){
int res=0;
printk(KERN_ALERT "zcfdebug in get GPIO 100!\n");
// mt_set_gpio_mode(GPIO100, GPIO_MODE_GPIO);
// mt_set_gpio_dir(GPIO100, GPIO_DIR_IN);
res=mt_get_gpio_in(GPIO100);
if(!res){
printk("zcfdebug the GPIO 100 is low\n");
return 1;
}