1

앱이 메모리에없는 경우 일부 장치에서 알람 관리자 브로드 캐스트가 수신되지 않습니다 (앱 트레이에서 스 와이프). 작동하지 않는 장치는 API 25로 실행되며 ONE PLUS 3 장치입니다. 그러나 Nexus 6에서도 동일한 기능을 사용할 수 있습니다 (API 25 포함).앱이 메모리에 없을 때 알람 관리자 브로드 캐스트가 수신되지 않음 (One Plus 3)

이상한 것은 시스템 로그에서 알람이 실행되고 있음을 알 수 있습니다. 알람이 울릴 때 로그를 볼 수 있습니다. 그 광대 한 방송은받지 못했습니다. 다시 말하지만, 앱이 메모리에없는 경우에만 발생합니다. 앱이 메모리에있을 때 브로드 캐스트가 제대로 수신됩니다. 다음

<receiver android:name="com.intapp.receivers.ReminderReceiver" 
       android:exported="false" 
       android:enabled="true"> 
     <intent-filter> 
      <action android:name="com.intapp.receivers.NOTIFICATION_ALARM" /> 
     </intent-filter> 
</receiver> 

과 내가 알람을 설정하려는 경우 :

public static final String ACTION = "com.intapp.receivers.NOTIFICATION_ALARM"; 

AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); 
Intent intent = new Intent(context, ReminderReceiver.class); 
intent.setAction(ACTION); 
int randomNum = new Random().nextInt(Integer.MAX_VALUE - 1 + 1); 
PendingIntent alarmIntent = PendingIntent.getBroadcast(context, randomNum, intent, PendingIntent.FLAG_ONE_SHOT); 
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { 
    alarmManager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), alarmIntent); // I get time from calendar instance in my function 
    } else { 
      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { 
       alarmManager.setExact(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), alarmIntent); 
      } else { 
       alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), alarmIntent); 
      } 
} 

가 여기 내 구현의 내가 매니페스트에 알람

을하고 있어요 방법은 다음과

V/AlarmManager: Triggering alarm #0: 0 when =1508843147121 package=net.IntAppoperation =*walarm*:com.intapp.receivers.NOTIFICATION_ALARM

입니다 수신자 :

,363,210
public class ReminderReceiver extends BroadcastReceiver { 
     @Override 
     public void onReceive(Context context, Intent intent) { 
     Log.d(TAG, "Receiver called "); 
     // my implementation 
    } 
} 

편집 :

이 문제처럼 보인다

조금 크다. 또한 CALL_STATE에 등록하여 수신/발신 통화를들을 수 있습니다. 그 방송 수신기는 앱이 메모리에 없을 때도 발사되지 않습니다. 또한 API 25에서 실행중인 삼성 기기에서도 발생합니다. 일부 기기에서는이 (매니페스트 방송이 작동하지 않음) 알려진 문제가 API 25에 알려져 있습니까?

답변

0

나는 OnePlus 3도 가지고 있습니다. 그렇습니다. 이것은 나에게도 많이 일어납니다. 내가 BootReceiver에 등록 할 때에도. 내 응용 프로그램을 제거하고 다시 설치하여 문제를 해결했습니다.

기기가 기기를 죽이지 않도록하기 위해 ApplicationWakeLock을 구현하면 BroadcastReceiver이 활성 상태로 유지됩니다.

앞으로 OnePlus가 더 나을 것이기를 바랍니다.

관련 문제