I started testing my application on Nexus 5x with Android O.My targetSdkVersionis 22.On the developer's site I read about Background execution limits :Where:By default, these restrictions apply only to O-oriented applications. However, users can enable these restrictions for any application on the settings screen, even if the application is not configured to O.
targetSdkVersion
:
Context.startForegroundService() . Context.startForegroundService(), . , startForeground() . (startForeground )
Context.startForegroundService()
startForeground()
App info > Battery usage, .
App info > Battery usage
, :
W/BroadcastQueue: : Intent {act = android.intent.action. $ACTION dat = package: $APP_PACKAGE flg = 0x4000010 ( )} $APP_PACKAGE/$APP_RECEIVER
[UPDATE 27.09.2017]
"", , , .
( ignore allow)
ignore
allow
adb shell appops set your.application.id.here RUN_IN_BACKGROUND ignore
targetSdkVersion, , , , thats ., , targetSdkVersion, , , , appp shell appops, . , , , . , / // Play Store/candygrams , , .
targetSdkVersion, , , , thats .
, , targetSdkVersion, , , , appp shell appops, . , , , . , / // Play Store/candygrams , , .
. Android Oreo