2017-04-19 36 views
0

我有一個Android應用程序,從藍牙和情節獲取數據該數據在osmroid MapView的持續,但一定時間後殺死OS這個應用程序,但這種情況只在某些設備喪生。Android應用得到由OS在某些設備

這種殺死不會發生在HTC,三星設備。

請幫我找出它在某些設備中發生的原因。也請爲我提供解決此問題的方法。

04-17 13:16:06.594 12536-12536/? I/ContextImpl: startServiceCommon service:Intent { cmp=com.google.android.gms/.checkin.EventLogService (has extras) }, user:UserHandle{0} 
04-17 13:16:06.603 1016-1016/? D/SettingsInterface: from settings cache , name = turn_silent , value = null 
04-17 13:16:06.603 1016-1016/? D/SettingsInterface: from settings cache , name = callsilent , value = null 
04-17 13:16:06.603 1016-1016/? D/SettingsInterface: from settings cache , name = alarmsilent , value = null 
04-17 13:16:06.603 1016-1016/? D/SettingsInterface: from settings cache , name = musicsilent , value = null 
04-17 13:16:06.603 1016-1016/? D/SettingsInterface: from settings cache , name = mediasilent , value = null 
04-17 13:16:06.603 1016-1016/? I/fanzhuan: onSensorChanged front----> 0.104 0.005 9.846 
04-17 13:16:06.612 1016-1026/? I/ActivityManager: startServiceLocked service:Intent { cmp=com.google.android.gms/.checkin.EventLogService (has extras) } 
04-17 13:16:06.644 1016-1772/? D/PowerManagerService: acquireWakeLockInternal: lock=249043682, flags=0x1, tag="wake:com.google.android.gms/.checkin.EventLogService", ws=null, uid=10011, pid=12536 
04-17 13:16:06.652 1016-1772/? I/muxinwu: PowerManagerService agoldReleaseWakelock mPackageName:android, mTag:WindowManager 
04-17 13:16:06.652 1016-1772/? I/muxinwu: PowerManagerService agoldReleaseWakelock package_name = com.google.android.gms, tag_name = *net_scheduler* 
04-17 13:16:06.652 1016-1772/? I/muxinwu: PowerManagerService agoldReleaseWakelock package_name = com.google.android.gms, tag_name = Checkin Service 
04-17 13:16:06.652 1016-1772/? I/muxinwu: PowerManagerService agoldReleaseWakelock mPackageName:android, mTag:*alarm* 
04-17 13:16:06.652 1016-1772/? I/muxinwu: PowerManagerService agoldReleaseWakelock package_name = com.google.android.gms, tag_name = *net_scheduler* 
04-17 13:16:06.653 1016-1772/? I/muxinwu: PowerManagerService agoldReleaseWakelock package_name = com.google.android.gms, tag_name = Checkin Service 
04-17 13:16:06.653 1016-1772/? D/PowerManagerService: updateWakeLockSummaryLocked: mWakefulness=Awake, mWakeLockSummary=0x23 
04-17 13:16:06.654 1016-1772/? D/PowerManagerService: updateUserActivitySummaryLocked: mWakefulness=Awake, mUserActivitySummary=0x1, nextTimeout=8355076 (in 1778733 ms) 
04-17 13:16:06.657 1016-1772/? D/DisplayPowerController: requestPowerState: policy=BRIGHT, useProximitySensor=false, screenBrightness=240, screenAutoBrightnessAdjustment=0.0, brightnessSetByUser=true, useAutoBrightness=false, blockScreenOn=false, lowPowerMode=false, boostScreenBrightness=false, dozeScreenBrightness=-1, dozeScreenState=UNKNOWN, waitForNegativeProximity=false 
04-17 13:16:06.658 1016-1772/? I/PowerManagerService: setBrightness mButtonLight 0. 
04-17 13:16:06.658 1016-1772/? D/PowerManagerService: updateDisplayPowerStateLocked: mDisplayReady=true, policy=3, mWakefulness=1, mWakeLockSummary=0x23, mUserActivitySummary=0x1, mBootCompleted=true, mScreenBrightnessBoostInProgress=false 
04-17 13:16:06.659 1016-1772/? D/PowerManagerNotifier: onWakeLockAcquired: flags=1, tag="wake:com.google.android.gms/.checkin.EventLogService", packageName=com.google.android.gms, ownerUid=10011, ownerPid=12536, workSource=null 
04-17 13:16:06.663 1016-1772/? D/AppOps: startOperation: allowing code 40 uid 10011 package com.google.android.gms 
04-17 13:16:06.679 12536-12536/? D/ActivityThread: BDC-RECEIVER handled : 0/ReceiverData{intent=Intent { flg=0x114 cmp=com.google.android.gms/.checkin.EventLogServiceReceiver (has extras) } packageName=com.google.android.gms resultCode=0 resultData=null resultExtras=null} 
04-17 13:16:06.686 1016-1016/? D/AlarmManager: onSendFinished begin 
04-17 13:16:06.691 1016-1016/? D/PowerManagerService: releaseWakeLockInternal: lock=141471969 [*alarm*], flags=0x0, total_time=2031ms 
04-17 13:16:06.694 12536-12536/? D/ActivityThread: SVC-Creating service: CreateServiceData{[email protected] className=com.google.android.gms.checkin.EventLogService packageName=com.google.android.gms intent=null} 
04-17 13:16:06.696 12536-12536/? D/ActivityThread: SVC-CREATE_SERVICE handled : 0/CreateServiceData{[email protected] className=com.google.android.gms.checkin.EventLogService packageName=com.google.android.gms intent=null} 
04-17 13:16:06.696 12536-12536/? D/ActivityThread: SVC-Calling onStartCommand: [email protected], flags=0, startId=1 
04-17 13:16:06.721 1016-1016/? D/PowerManagerNotifier: onWakeLockReleased: flags=1, tag="*alarm*", packageName=android, ownerUid=1000, ownerPid=1016, workSource=WorkSource{10011} 
04-17 13:16:06.722 1016-1016/? D/PowerManagerService: updateWakeLockSummaryLocked: mWakefulness=Awake, mWakeLockSummary=0x23 
04-17 13:16:06.722 1016-1016/? D/PowerManagerService: updateUserActivitySummaryLocked: mWakefulness=Awake, mUserActivitySummary=0x1, nextTimeout=8355076 (in 1778665 ms) 
04-17 13:16:06.722 1016-1016/? D/DisplayPowerController: requestPowerState: policy=BRIGHT, useProximitySensor=false, screenBrightness=240, screenAutoBrightnessAdjustment=0.0, brightnessSetByUser=true, useAutoBrightness=false, blockScreenOn=false, lowPowerMode=false, boostScreenBrightness=false, dozeScreenBrightness=-1, dozeScreenState=UNKNOWN, waitForNegativeProximity=false 
04-17 13:16:06.722 1016-1016/? I/PowerManagerService: setBrightness mButtonLight 0. 
04-17 13:16:06.722 1016-1016/? D/PowerManagerService: updateDisplayPowerStateLocked: mDisplayReady=true, policy=3, mWakefulness=1, mWakeLockSummary=0x23, mUserActivitySummary=0x1, mBootCompleted=true, mScreenBrightnessBoostInProgress=false 
04-17 13:16:06.727 1016-10160/? D/PowerManagerService: acquireWakeLockInternal: lock=117472883, flags=0x1, tag="Event Log Service", ws=WorkSource{10011 com.google.android.gms}, uid=10011, pid=12536 
04-17 13:16:06.727 1016-10160/? I/muxinwu: PowerManagerService agoldReleaseWakelock mPackageName:android, mTag:WindowManager 
04-17 13:16:06.727 1016-10160/? I/muxinwu: PowerManagerService agoldReleaseWakelock package_name = com.google.android.gms, tag_name = *net_scheduler* 
04-17 13:16:06.727 1016-10160/? I/muxinwu: PowerManagerService agoldReleaseWakelock package_name = com.google.android.gms, tag_name = Checkin Service 
04-17 13:16:06.728 1016-10160/? I/muxinwu: PowerManagerService agoldReleaseWakelock mPackageName:com.google.android.gms, mTag:wake:com.google.android.gms/.checkin.EventLogService 
04-17 13:16:06.728 1016-10160/? I/muxinwu: PowerManagerService agoldReleaseWakelock package_name = com.google.android.gms, tag_name = *net_scheduler* 
04-17 13:16:06.728 1016-10160/? I/muxinwu: PowerManagerService agoldReleaseWakelock package_name = com.google.android.gms, tag_name = Checkin Service 
04-17 13:16:06.728 1016-10160/? D/PowerManagerService: updateWakeLockSummaryLocked: mWakefulness=Awake, mWakeLockSummary=0x23 
04-17 13:16:06.728 1016-10160/? D/PowerManagerService: updateUserActivitySummaryLocked: mWakefulness=Awake, mUserActivitySummary=0x1, nextTimeout=8355076 (in 1778659 ms) 
04-17 13:16:06.728 1016-10160/? D/DisplayPowerController: requestPowerState: policy=BRIGHT, useProximitySensor=false, screenBrightness=240, screenAutoBrightnessAdjustment=0.0, brightnessSetByUser=true, useAutoBrightness=false, blockScreenOn=false, lowPowerMode=false, boostScreenBrightness=false, dozeScreenBrightness=-1, dozeScreenState=UNKNOWN, waitForNegativeProximity=false 
04-17 13:16:06.728 1016-10160/? I/PowerManagerService: setBrightness mButtonLight 0. 
04-17 13:16:06.728 1016-10160/? D/PowerManagerService: updateDisplayPowerStateLocked: mDisplayReady=true, policy=3, mWakefulness=1, mWakeLockSummary=0x23, mUserActivitySummary=0x1, mBootCompleted=true, mScreenBrightnessBoostInProgress=false 
04-17 13:16:06.728 1016-10160/? D/PowerManagerNotifier: onWakeLockAcquired: flags=1, tag="Event Log Service", packageName=com.google.android.gms, ownerUid=10011, ownerPid=12536, workSource=WorkSource{10011 com.google.android.gms} 
04-17 13:16:06.730 1016-1144/? D/PowerManagerService: releaseWakeLockInternal: lock=249043682 [wake:com.google.android.gms/.checkin.EventLogService], flags=0x0, total_time=77ms 
04-17 13:16:06.730 1016-1144/? D/PowerManagerNotifier: onWakeLockReleased: flags=1, tag="wake:com.google.android.gms/.checkin.EventLogService", packageName=com.google.android.gms, ownerUid=10011, ownerPid=12536, workSource=null 
04-17 13:16:06.730 1016-1144/? D/PowerManagerService: updateWakeLockSummaryLocked: mWakefulness=Awake, mWakeLockSummary=0x23 
04-17 13:16:06.730 1016-1144/? D/PowerManagerService: updateUserActivitySummaryLocked: mWakefulness=Awake, mUserActivitySummary=0x1, nextTimeout=8355076 (in 1778657 ms) 
04-17 13:16:06.730 1016-1144/? D/DisplayPowerController: requestPowerState: policy=BRIGHT, useProximitySensor=false, screenBrightness=240, screenAutoBrightnessAdjustment=0.0, brightnessSetByUser=true, useAutoBrightness=false, blockScreenOn=false, lowPowerMode=false, boostScreenBrightness=false, dozeScreenBrightness=-1, dozeScreenState=UNKNOWN, waitForNegativeProximity=false 
04-17 13:16:06.730 1016-1144/? I/PowerManagerService: setBrightness mButtonLight 0. 
04-17 13:16:06.730 1016-1144/? D/PowerManagerService: updateDisplayPowerStateLocked: mDisplayReady=true, policy=3, mWakefulness=1, mWakeLockSummary=0x23, mUserActivitySummary=0x1, mBootCompleted=true, mScreenBrightnessBoostInProgress=false 
04-17 13:16:06.755 12536-12536/? D/ActivityThread: SVC-SERVICE_ARGS handled : 0/ServiceArgsData{[email protected] startId=1 args=Intent { cmp=com.google.android.gms/.checkin.EventLogService (has extras) }} 
04-17 13:16:06.803 1016-1016/? D/SettingsInterface: from settings cache , name = turn_silent , value = null 
04-17 13:16:06.803 1016-1016/? D/SettingsInterface: from settings cache , name = callsilent , value = null 
04-17 13:16:06.803 1016-1016/? D/SettingsInterface: from settings cache , name = alarmsilent , value = null 
04-17 13:16:06.803 1016-1016/? D/SettingsInterface: from settings cache , name = musicsilent , value = null 
04-17 13:16:06.803 1016-1016/? D/SettingsInterface: from settings cache , name = mediasilent , value = null 
04-17 13:16:06.804 1016-1016/? I/fanzhuan: onSensorChanged front----> 0.089 0.005 9.853 
04-17 13:16:06.833 12536-12583/? I/ContextImpl: bindServiceCommon service:Intent { act=com.google.android.gms.usagereporting.service.START pkg=com.google.android.gms } 
04-17 13:16:06.835 1016-1716/? I/ActivityManager: bindServiceLocked service:Intent { act=com.google.android.gms.usagereporting.service.START pkg=com.google.android.gms } 
04-17 13:16:06.845 1016-1716/? W/PackageManager: checkUidPermission(): android.permission.WRITE_MEDIA_STORAGE of 10011 is denied. 
04-17 13:16:06.857 1016-1716/? I/ActivityManager: Start proc 12584:com.google.android.gms.persistent/u0a11 for service com.google.android.gms/.usagereporting.service.UsageReportingService 
04-17 13:16:06.857 1016-1716/? I/ActivityManager: [Background Service Priority Adjustment] Process.setProcessGroup to Process.THREAD_GROUP_BG_NONINTERACTIVE, app.pid: 12584 
04-17 13:16:07.003 1016-1016/? D/SettingsInterface: from settings cache , name = turn_silent , value = null 
04-17 13:16:07.003 1016-1016/? D/SettingsInterface: from settings cache , name = callsilent , value = null 
04-17 13:16:07.003 1016-1016/? D/SettingsInterface: from settings cache , name = alarmsilent , value = null 
04-17 13:16:07.003 1016-1016/? D/SettingsInterface: from settings cache , name = musicsilent , value = null 
04-17 13:16:07.003 1016-1016/? D/SettingsInterface: from settings cache , name = mediasilent , value = null 
04-17 13:16:07.003 1016-1016/? I/fanzhuan: onSensorChanged front----> 0.05 0.032 9.864 
04-17 13:16:07.030 12584-12591/? I/System: FinalizerDaemon: finalize objects = 1 
04-17 13:16:07.041 12584-12584/? I/LoadedApk: No resource references to update in package FFFFFFFFFFFFFFFFFFFFFF 
04-17 13:16:07.041 12584-12584/? D/ActivityThread: installProvider: context.getPackageName()=com.google.android.gms 
04-17 13:16:07.050 12584-12584/? D/ActivityThread: installProvider: context.getPackageName()=com.google.android.gms 
04-17 13:16:07.051 12584-12584/? D/ActivityThread: installProvider: context.getPackageName()=com.google.android.gms 
04-17 13:16:07.053 12584-12584/? D/ActivityThread: installProvider: context.getPackageName()=com.google.android.gms 
04-17 13:16:07.056 12584-12584/? D/ActivityThread: installProvider: context.getPackageName()=com.google.android.gms 
04-17 13:16:07.058 12584-12584/? D/ActivityThread: installProvider: context.getPackageName()=com.google.android.gms 
04-17 13:16:07.059 12584-12584/? D/ActivityThread: installProvider: context.getPackageName()=com.google.android.gms 
04-17 13:16:07.060 12584-12584/? D/ActivityThread: installProvider: context.getPackageName()=com.google.android.gms 
04-17 13:16:07.062 12584-12584/? D/ActivityThread: installProvider: context.getPackageName()=com.google.android.gms 

    tyManager: SVC-mBroadcastQueues: [email protected] 
04-17 13:16:04.882 1016-1016/? E/AppWidgetServiceImpl: Error clearing service interface 
                 android.os.DeadObjectException 
                  at android.os.BinderProxy.transactNative(Native Method) 
                  at android.os.BinderProxy.transact(Binder.java:511) 
                  at com.android.internal.widget.IRemoteViewsAdapterConnection$Stub$Proxy.onServiceDisconnected(IRemoteViewsAdapterConnection.java:95) 
                  at com.android.server.appwidget.AppWidgetServiceImpl$ServiceConnectionProxy.disconnect(AppWidgetServiceImpl.java:3546) 
                  at com.android.server.appwidget.AppWidgetServiceImpl$ServiceConnectionProxy.onServiceDisconnected(AppWidgetServiceImpl.java:3541) 
                  at android.app.LoadedApk$ServiceDispatcher.doDeath(LoadedApk.java:1269) 
                  at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1283) 
                  at android.os.Handler.handleCallback(Handler.java:815) 
                  at android.os.Handler.dispatchMessage(Handler.java:104) 
                  at android.os.Looper.loop(Looper.java:207) 
                  at com.android.server.SystemServer.run(SystemServer.java:371) 
                  at com.android.server.SystemServer.main(SystemServer.java:234) 
                  at java.lang.reflect.Method.invoke(Native Method) 
                  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888) 
                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:749) 
04-17 13:16:04.882 1605-1697/? D/ForegroundUtils: Process died; UID 10041 PID 12520 
04-17 13:16:04.883 1605-1697/? D/ForegroundUtils: foregroundPids.delete(pid) 12520 
04-17 13:16:04.883 1605-1697/? D/ForegroundUtils: mForegroundUidPids.remove uid:10041 
04-17 13:16:04.883 1605-1697/? D/ForegroundUtils: handleUidToBackground uid:10041 
04-17 13:16:04.883 1605-1697/? D/ForegroundUtils: Foreground changed, PID: 12520 UID: 10041 foreground: false 
04-17 13:16:04.883 1605-1697/? D/ForegroundUtils: Foreground UID/PID combinations: 
04-17 13:16:04.883 1605-1697/? D/ForegroundUtils: UID: 10188 PID: 7988 
+0

殺死了應用程序?你的意思是os會殺死你在後臺運行的服務? – ADM

+0

面對我的MI設備中的相同問題 –

+0

@ADM是的,我想,但它不是一個崩潰。 – RShenoy

回答

1

在奇巧的O的殺敵只是當你從最近app.So殺了它,這是OS具體問題我已經遇到過一個棘手的服務。我也嘗試重新啓動Service onTaskRemoved()。但似乎沒有運氣與奇巧(聯想設備)。

@Override 
public void onTaskRemoved(Intent rootIntent) { 
    Log.e("Task","Removed"); 
    Intent restartService = new Intent(getApplicationContext(), 
      this.getClass()); 
    restartService.setPackage(getPackageName()); 
    PendingIntent restartServicePI = PendingIntent.getService(
      getApplicationContext(), 1, restartService, 
      PendingIntent.FLAG_ONE_SHOT); 
    AlarmManager alarmService = (AlarmManager) getApplicationContext().getSystemService(Context.ALARM_SERVICE); 
    alarmService.set(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime() + 1000, restartServicePI); 

} 

雖然它的作品在其他設備上。所以最後我終於以AlarmManager來檢查服務是否在某個時間間隔運行。 但是在使用之前請閱讀關於電池優化和打盹模式的Android M和Android N規格here

+0

我在KitKat上進行的測試表明,START_STICKY服務將在其活動從最近幾次刷卡後幾秒鐘後自動重新啓動。 –

+0

是啊,這就是我說的,但不是在我所有的設備,我遇到的問題在聯想A系列設備。另請參閱Android N的文檔。你會驚訝。 – ADM

+0

@ADM我正在使用Android M將此工作原理相同,想要了解更多關於Android M中電池優化的信息。 – RShenoy

相關問題