无网络连接对话框

About "No network connection" popup:

This popup is shown by Browser when it "thinks" it detected that network is down (it also sets its field mIsNetworkUp = false then).
It is done on receiving intent CONNECTIVITY_ACTION.

this is where intent CONNECTIVITY_ACTION comes from:

telephony framework ->
PhoneBase.notifyDataConnection() -> DefaultPhoneNotifier.notifyDataConnection()  -> TelephonyRegistry.notifyDataConnection() ->
TelephonyRegistry.broadcastDataConnectionStateChanged() -> send intent ACTION_ANY_DATA_CONNECTION_STATE_CHANGED
MobileDataStateReceiver.onReceive ACTION_ANY_DATA_CONNECTION_STATE_CHANGED ->
NetworkStateTracker.setDetailedState() -> ConnectivityService.MyHandler.handleMessage() EVENT_STATE_CHANGED ->
ConnectivityManager.handleDisconnect() -> send intent CONNECTIVITY_ACTION

Browser shows "No network connection" popup if "EXTRA_NETWORK_INFO" from intent CONNECTIVITY_ACTION says it's unavailable (NetwotkInfo.isAvailable() returns false)

in documentation to ConnectivityManager.CONNECTIVITY_ACTION, one can read (please note marked fragment ***):
     51      * If this is a connection that was the result of failing over from a
     52      * disconnected network, then the FAILOVER_CONNECTION boolean extra is
     53      * set to true.
     54      * <p/>
     55      * For a loss of connectivity, if the connectivity manager is attempting
     56      * to connect (or has already connected) to another network, the
     57      * NetworkInfo for the new network is also passed as an extra. This lets
     58      * any receivers of the broadcast know that ***they should not necessarily
     59      * tell the user that no data traffic will be possible. Instead, the
     60      * reciever should expect another broadcast soon, indicating either that
     61      * the failover attempt succeeded (and so there is still overall data
     62      * connectivity), or that the failover attempt failed, meaning that all

     63      * connectivity has been lost.***

一半都是根据cs来判断的,ps一半不判断。据说htc是根据了ps来判断的,这要根据具体的运营商来定制了



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值