setup 阶段 屏蔽电话和短信

来电和接收到短信的流程, 在

基本原理都是,底层发广播上层接收处理

(手机管家的framework 层相关处理也可以在这里)

 

//在开机向导阶段,禁止电话接入

packages/services/Telephony/src/com/android/services/telephony/PstnIncomingCallNotifier.java


class PstnIncomingCallNotifier{

	private void sendIncomingCallIntent(){
         ...
	 //if(hanlde == null){ 
	 if(hanlde == null && !inSetup()){ 
            try{
	       connection.hangup();
	    }catch(){
	    
	    }
	 }
  }

}


//在开机向导阶段,禁止接收短信

framework/opt/telephony/src/java/com/android/internal/telephony/InboundSmsHandler.java

class InboundSmsHandler{


    //分发sms intent
    public void dispatchIntent(Intent intent,String permission,Int appOp, Bundle opts, BroadcastReceiver resultReceiver,){
 
	if(inSetup()){
           //如果再开机向导中
	   return;
	
	}
    }
}


 

你可能感兴趣的:(Setup)