Enabling SMS support in Hangouts 2.0 breaks the BroadcastReceiver of SMS_RECEIVED in my app

前端 未结 5 1596
感动是毒
感动是毒 2020-12-03 04:44

I just received the update for Hangouts 2.0, installed it and enabled SMSTurn on SMS. Now my application, running under Android 4.3, is una

5条回答
  •  抹茶落季
    2020-12-03 05:33

    According to the most recent Google Hangouts Manifest, they have an AbortSmsReceiver set with a priority of "3" - so it seems that any app that wants to receive the SMS_RECEIVED broadcast on API 18 or lower should use a priority higher than 3:

    
        
            
        
    
    

    You can use a build target of API 19. Apps on a device running API 19 (KitKat) will not be able to abort the broadcast as in prior API's. This prevents apps from performing a premature abort.

    I assume they included this abort to prevent stock messaging apps from posting duplicate notifications. Stock messaging apps should process at priority 0 prior to KitKat - but any application that does not set a priority is processed at 0 also. IntentFilter objects are created with a default priority value of "0":

    public IntentFilter() {
            mPriority = 0;
            mActions = new ArrayList();
    }
    

提交回复
热议问题