Hello Michael, this forum is about App Engine 
<https://cloud.google.com/appengine/>, not the Android SDK. As such you are 
unlikely to get help regarding this question here.

You should instead check out Android's Developer Support Resources 
<https://developer.android.com/support.html> as well as community sites 
such as the XDA Forums <https://forum.xda-developers.com/> and Stack 
Overflow <https://stackoverflow.com/>.

On Sunday, January 14, 2018 at 4:45:45 AM UTC-5, Michael Ginzburg wrote:
>
> Hi,
>
>  
>
> We are trying to build our autoresponder app with the SDK 26 as a target 
> version 
>
>  
>
> We have 2 PhoneStateReceivers in our app. (see code below) 
>
> Also we are requesting
>
> android.permission.READ_SMS
>
> android.permission.READ_PHONE_STATE 
>
> Permissions
>
> And user accept it
>
>  
>
> But after phone restart and before user unlock device (lock screen) both 
> sms broadcast receivers don’t’ work
>
>  
>
> Could you please advise!!
>
>  
>
> Thanks you in advance
>
> Michael
>
> ===========================
>
>  
>
>  
>
> in AndroidManifest.xml
>
> <receiver 
> android:name="com.lemi.callsautoresponder.callreceiver.DynamicPhoneStateReceiver"
>  
> android:directBootAware="true" android:enabled="true" 
> android:exported="true" />
>
> <receiver 
> android:name="com.lemi.callsautoresponder.callreceiver.PhoneStateReceiver" 
> android:directBootAware="true" android:enabled="true" 
> android:exported="true">
>
>           <intent-filter android:priority="2147483647">
>
>               <action android:name="android.intent.action.PHONE_STATE"/>
>
>               <action 
> android:name="android.provider.Telephony.SMS_DELIVER"/>
>
>               <action 
> android:name="android.provider.Telephony.SMS_RECEIVED"/>
>
>           </intent-filter>
>
>           <intent-filter android:priority="2147483647">
>
>               <action 
> android:name="android.provider.Telephony.GSM_SMS_RECEIVED"/>
>
>               <category android:name="android.intent.category.DEFAULT"/>
>
>           </intent-filter>
>
>           <intent-filter android:priority="2147483647">                 
>
>               <action 
> android:name="android.provider.Telephony.WAP_PUSH_RECEIVED"/>
>
>               <data android:mimeType="application/vnd.wap.sic"/>
>
>           </intent-filter>        
>
> </receiver>
>
>  
>
>  
>
> in Application.java
>
>  
>
> public void registerPhoneStateReceiver() {
>
>    Log.i(TAG, "register PhoneState receiver");
>
>    _phoneReceiver = new DynamicPhoneStateReceiver();
>
>    IntentFilter intentFilter1 = new IntentFilter();
>
>    //intentFilter.addAction(PhoneStateReceiver.SMS_RECEIVED);
>
>    intentFilter1.addAction(TelephonyManager.ACTION_PHONE_STATE_CHANGED);
>
>    intentFilter1.addAction("android.intent.action.BOOT_COMPLETED");
>
>    intentFilter1.setPriority(0x7fffffff);
>
>    intentFilter1.addCategory("android.intent.category.DEFAULT");
>
>    appContext.registerReceiver(_phoneReceiver, intentFilter1);
>
>    
>
>        IntentFilter intentFilter2 = new 
> IntentFilter("android.provider.Telephony.SMS_RECEIVED");
>
>        intentFilter2.setPriority(0x7fffffff);
>
>        intentFilter2.addCategory("android.intent.category.DEFAULT");
>
>        appContext.registerReceiver(_phoneReceiver, intentFilter2, 
> "android.permission.BROADCAST_SMS", null);
>
>        
>
>        IntentFilter intentFilter3 = new 
> IntentFilter("android.provider.Telephony.GSM_SMS_RECEIVED");
>
>        intentFilter3.setPriority(0x7fffffff);
>
>        intentFilter3.addCategory("android.intent.category.DEFAULT");
>
>        appContext.registerReceiver(_phoneReceiver, intentFilter3, 
> "android.permission.BROADCAST_SMS", null);
>
>  
>
> }
>
>  
>
> public class PhoneStateReceiver extends BroadcastReceiver {
>
>  
>
>   @Override
>
>   public void onReceive(Context context, Intent intent) {
>
>  
>
>     Log.info(TAG, "received sms");
>
>  
>
>   }
>
> }
>
>  
>
> public class DynamicPhoneStateReceiver extends BroadcastReceiver { 
>
>  
>
>   @Override
>
>   public void onReceive(Context context, Intent intent) {
>
>  
>
>     Log.info(TAG, "received sms");
>
>  
>
>   }
>
> }
>
>  
>
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/40639f3d-6cd5-47a5-adb2-4922b688f116%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to