IntentService scheduled by AlarmManager sometimes die - android

I have an app that every minute launches an IntentService that gets the UsageStats and UsageEvents on this period.
I used setExact() method of AlarmManager to set the moment that the IntentService is executed and on the onCreate method of the IntentService i call again to setExact() to schedule the execution of the IntentService the next minute. I did this because the method setRepeating() of AlarmManager didn't perform with accuracy on one minute periods. The code i use is:
alarmM.setExact(AlarmManager.ELAPSED_REALTIME,SystemClock.elapsedRealtime()+60000,alarmAppIntent);
This performs correctly most of times and when the device is charging. However, when the device is in normal use sometimes the service stops repeating every minute (i create a notification everytime the service executes to see if the service continues executing) and when the IntentService stops repeating Logcat says:
03-02 12:16:02.221 1173 12379 I ActivityManager: Process com.app.usage (pid 6390) has died
03-02 12:16:02.222 1173 1423 D DisplayManagerService: Display listener for pid 6390 died.
03-02 12:16:02.222 1173 12379 D ActivityManager: SVC-handleAppDiedLocked: app = ProcessRecord{73a4530 6390:com.app.usage/u0a251}, app.pid = 6390
03-02 12:16:02.222 1173 12379 D ActivityManager: cleanUpApplicationRecord -- 6390
03-02 12:16:02.222 1173 12379 D ActivityManager: SVC-mBroadcastQueues: com.android.server.am.BroadcastQueue#e800e85
03-02 12:16:02.222 1173 12379 D ActivityManager: SVC-mBroadcastQueues: com.android.server.am.BroadcastQueue#d0e4da
03-02 12:16:02.223 2049 2306 E WtProcessController: Error pid or pid not exist
03-02 12:16:02.315 1173 1378 D PerfServiceManager: [PerfService] MESSAGE_USER_DISABLE: 92
03-02 12:16:02.315 1173 1378 I libPerfService: [perfScnDisable] scenario:92
03-02 12:16:02.315 1173 1378 I libPerfService: 92: set max: -1, 0, -1,
03-02 12:16:02.316 1173 1378 I libPerfService: 92: set freq: -1, -1, 933000,
03-02 12:16:02.316 1173 1378 I libPerfService: 92: set gpu level: 0
03-02 12:16:02.447 3149 3166 I PerfService: PerfServiceNative_userEnableTimeoutMs:30, 1050
03-02 12:16:02.448 3149 3166 I PerfService: PerfServiceNative_notifyDisplayType:2
The device i am using is a Xiaomi Redmi Note 4 Pro with MIUI 9.2 (Android 6.0). I've tried to set no battery economizer to the app but the problem continues.
Is there some way to stop the app dying using other libraries or configuration?

Related

ANR and Activity reported stop, but no longer stopping

I have this problem on some devices and on some occasions, and I can't reproduce it 100%. Sometimes when the user switches away from my activity they get this error: Activity reported stop, but no longer stopping: ActivityRecord and usually it's followed by an ANR like:
02-26 19:43:31.187 I/InputDispatcher( 1062): Application is not responding: Window{8f7e457 u0 gb.xxy.hr/gb.xxy.hr.player}. It has been 5000.8ms since event, 5000.6ms since wait started. Reason: Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago. Wait queue length: 14. Wait queue head age: 6964.8ms.
02-26 19:43:31.208 I/WindowManager( 1062): Input event dispatching timed out sending to gb.xxy.hr/gb.xxy.hr.player. Reason: Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago. Wait queue length: 14. Wait queue head age: 6964.8ms.
02-26 19:43:31.270 E/ActivityManager( 1062): ANR in gb.xxy.hr (gb.xxy.hr/.player)
02-26 19:43:31.270 E/ActivityManager( 1062): PID: 14732
02-26 19:43:31.270 E/ActivityManager( 1062): Reason: Input dispatching timed out (Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago. Wait queue length: 14. Wait queue head age: 6964.8ms.)
02-26 19:43:31.270 E/ActivityManager( 1062): Load: 0.0 / 0.0 / 0.0
02-26 19:43:31.270 E/ActivityManager( 1062): CPU usage from 179169ms to 0ms ago (2019-02-26 19:40:32.074 to 2019-02-26 19:43:31.243):
My activity onstop has no code in it, but I do have some code which releases the surface:
#Override
public void surfaceDestroyed(SurfaceHolder holder) {
myLog.d(TAG,"Surface Destroyed.");
try {
holder.removeCallback(this);
holder.getSurface().release();
}
catch (Exception e)
{
myLog.e(TAG,e.getMessage());
}
videoexecutor.shutdownNow();
visible=false;
m_codec.stop();
m_codec.release();
m_codec=null;
}
I did had a look at a similar question: Android onStop times out despite doing no work and I do think that this is somehow caused by the surface but I cannot figure it out what is actually causing it, and why not on all devices and not all the time....
Any thoughts?

Problems streaming audio on Android 6.0.1 with mediaplayer

Since I updated my phone, a Samsung S6, to Android 6.0.1, mediaPlayer have started to behave strange.
I use the MediaPlayer to stream .mp3 audio over http and it has earlier worked without any problems.
Since this update almost all audio I stream which is longer than 1:30 will be stopped too early.
Example:
05-02 20:58:11.031 3119-26787/? V/MediaPlayerService: [1952] getDuration = 377496
05-02 20:58:11.031 15611-15611/com.test.test V/MediaPlayer-JNI: getDuration: 377496 (msec)
05-02 20:58:11.031 15611-15611/com.test.test V/MediaPlayer-JNI: getCurrentPosition: 119842 (msec)
05-02 20:58:11.041 15611-15611/com.test.test V/MediaPlayer-JNI: isPlaying: 1
05-02 20:58:11.041 15611-15611/com.test.test V/MediaPlayer-JNI: isPlaying: 1
05-02 20:58:11.061 3625-4927/? V/BroadcastQueue: [background] Process cur broadcast BroadcastRecord{d8b120b u0 null qIdx=4}, state= (APP_RECEIVE) DELIVERED for app ProcessRecord{436e057 16133:com.google.android.gms.persistent/u0a11}
05-02 20:58:11.151 3625-4936/? I/ActivityManager: Killing 16021:com.samsung.android.themecenter/1000 (adj 15): DHA:empty #31
05-02 20:58:11.171 3625-4951/? D/ActivityManager: isAutoRunBlockedApp:: com.samsung.android.themecenter, Auto Run ON
05-02 20:58:11.241 3119-16904/? I/NuPlayerDecoder: [audio] saw output EOS
05-02 20:58:11.241 3119-16903/? I/NuPlayerRenderer: onQueueEOS audio finalResult : -1011
05-02 20:58:11.371 3119-16903/? I/NuPlayerRenderer: [audio] notifyEOS() End of Stream, delayUs : 590370
05-02 20:58:11.371 3119-16903/? V/AudioSink: stop
05-02 20:58:11.681 3119-16896/? D/GenericSource: cachedDurationUs = 0.00 secs, eos=1
05-02 20:58:11.961 3119-16893/? I/NuPlayerRenderer: reachedAudioEOS (1)
05-02 20:58:11.961 3119-16893/? V/NuPlayer: reached audio EOS
As the log shows, a call to getDuration() is made (377496 ms).
Directly after a call to getCurrentPosition() is made (119842 ms).
After this NuPlayer seems to detect an EOS and the OnCompletionListener is performed and the audio is stopped.
Just before I updated to Android 6, this worked without any issues.
Does anybody have an idea what's going on and how this can be prevented?
Thanks in advance.

Shared Preferences deleted automatically

I'm developing an application in which I'm using a background service, and I save my data to shared preferences (as I know Android can kill services whenever there's low memory state). It works fine, and I periodically save my data to preferences. But as a rare scenario, I noticed as Android killed my service and restarted it (there was a gap of around 20-30 seconds between this), in this interval my preferences got automatically cleared. I checked up the dumpstate to infer the reason behind this, but I cannot understand why this happens.
Here's the relevant part of logs, which indicate data clearance from preferences:
06-25 17:30:34.848 2452 2966 V ApplicationPolicy: isApplicationStateBlocked userId 0 pkgname com.example.gaurav
06-25 17:30:34.863 2452 2966 D EnterpriseDeviceManager: ContainerId: 0
06-25 17:30:34.863 2452 2966 V ApplicationPolicy: isApplicationStateBlocked userId 0 pkgname com.example.gaurav
06-25 17:30:34.863 2452 2966 D PackageManager: START CLEAR APPLICATION USER DATA: observer{1126181288}
06-25 17:30:34.863 2452 2966 D PackageManager: pkg{<packageName>}
06-25 17:30:34.863 2452 2966 D PackageManager: user{0}
06-25 17:30:34.898 2831 2831 D ContainerEventsRelayManager: <<< Intent action is >>> : android.intent.action.PACKAGE_RESTARTED
06-25 17:30:34.898 2831 2831 D ContainerEventsRelayManager: <<< Intent data is >>> : package:com.example.gaurav
06-25 17:30:34.898 2695 2695 D ContexualWidgetMonitor: id = 0
06-25 17:30:34.898 2695 2695 D ContexualWidgetMonitor: action =android.intent.action.PACKAGE_RESTARTED
06-25 17:30:34.898 2695 2695 D ContexualWidgetMonitor: pkg =null
06-25 17:30:34.898 2695 2695 D ContexualWidgetMonitor: mCheckMissedEvent =false
06-25 17:30:34.903 2831 2831 D ContainerEventsRelayManager: <<< Intent action is >>> : android.intent.action.PACKAGE_DATA_CLEARED
06-25 17:30:34.903 2831 2831 D ContainerEventsRelayManager: <<< Intent data is >>> : package:com.example.gaurav
06-25 17:30:34.908 2452 2580 I PackageManager: remove MCS_UNBIND message and Posting MCS_UNBIND 10 secs later
Though this scenario didn't occur again, but I'd really like to know what's happening behind the scenes, and why does it happen.
I've searched other similar threads here, but they indicate the scenario where null key is inserted into preferences, so I guess this is entirely different.
Any help would be appreciated. Also, as an information, this problem occurred on Samsung Galaxy Note 2 device.
this happens because you are writing the Preferences in a background thread.
It is a known issue that when two threads access the same preferences file, the preferences get deleted.
You should not use SharedPreferences with processes, instead use a Database.
Here`s another SO question with the same problem.
I am going through the exact same problem, and I'm going for SQLite.

Android Testing - App works on one phone, but crashes on others

I created an app and it worked just fine on my phone, so I put it up on the market. My friend tried downloading it first, and it does not work on her phone. After the Splash Screen, it force closes.
I don't understand why this is happening. I was under the impression that the market only allowed users with the correct devices to download the app, so figured this wouldn't be an issue.
Has anyone had this happen? Also is there any way for me to test my app on all different phones to ensure that it will not crash again before re-posting it on the market?
**UPDATE - i had her run aLogCat and here is the result. It was too many characters, so I copied from the first E/
E/CameraService( 166): Invalid Burst Count setting burst count to 1
V/CameraHal( 166): camera_set_parameters
D/CameraHal( 166): (12785a0) hardware/ti/omap4xxx/camera/CameraHal.cpp:311 setParameters - White balance set auto
D/CameraHal( 166): (12785a0) hardware/ti/omap4xxx/camera/CameraHal.cpp:321 setParameters - Antibanding set auto
D/CameraHal( 166): (12785a0) hardware/ti/omap4xxx/camera/CameraHal.cpp:337 setParameters - Exposure compensation set 0
D/CameraHal( 166): (12785a0) hardware/ti/omap4xxx/camera/CameraHal.cpp:343 setParameters - Scene mode set auto
D/CameraHal( 166): (12785a0) hardware/ti/omap4xxx/camera/CameraHal.cpp:363 setParameters - Flash mode set on
D/CameraHalM( 166): Current battery Level, 3425000 uv
D/CameraHalM( 166): flashIntensity = 50
E/CameraHal( 166): (12785a0) hardware/ti/omap4xxx/camera/CameraHal.cpp:374 setParameters - Setting KEY_MOT_LEDFLASH--50
D/CameraHal( 166): (12785a0) hardware/ti/omap4xxx/camera/CameraHal.cpp:384 setParameters - Effect set none
D/CameraHal( 166): (12785a0) hardware/ti/omap4xxx/camera/CameraHal.cpp:402 setParameters - Jpeg quality set 90
D/CameraHal( 166): (12785a0) hardware/ti/omap4xxx/camera/CameraHal.cpp:409 setParameters - Thumbnail width set 160
D/CameraHal( 166): (12785a0) hardware/ti/omap4xxx/camera/CameraHal.cpp:416 setParameters - Thumbnail width set 120
D/CameraHal( 166): (12785a0) hardware/ti/omap4xxx/camera/CameraHal.cpp:423 setParameters - Thumbnail quality set 60
D/CameraHal( 166): (12785a0) hardware/ti/omap4xxx/camera/CameraHal.cpp:470 setParameters - Zoom set 0
D/CameraHal( 166): (12785a0) hardware/ti/omap4xxx/camera/CameraHal.cpp:483 setParameters - Auto Exposure Lock set false
D/CameraHal( 166): (12785a0) hardware/ti/omap4xxx/camera/CameraHal.cpp:492 setParameters - Auto WhiteBalance Lock set false
D/CameraHal( 166): (12785a0) hardware/ti/omap4xxx/camera/CameraHal.cpp:507 setParameters - Focus mode set auto
D/CameraHal( 166): (12785a0) hardware/ti/omap4xxx/camera/CameraHalM.cpp:124 setMotParameters - Checking Image Stabilization param, off
D/CameraHal( 166): (12785a0) hardware/ti/omap4xxx/camera/CameraHalM.cpp:144 setMotParameters - Disabling Image Stabilization capturing
D/CameraHal( 166): (12785a0) hardware/ti/omap4xxx/camera/CameraHalM.cpp:189 setMotParameters - Led Torch : 0
D/CameraHal( 166): (12785a0) hardware/ti/omap4xxx/camera/CameraHalM.cpp:289 setMotTcmdParametersIfNeeded - Checking Mot Test Mode param, off
D/CameraHal( 166): (12785a0) hardware/ti/omap4xxx/camera/CameraHalM.cpp:300 setMotTcmdParametersIfNeeded - Disabling Test Mode
D/CameraHal( 166): (12785a0) hardware/ti/omap4xxx/camera/CameraHal.cpp:566 setParameters - PreviewFormat set yuv420sp
D/CameraHal( 166): (12785a0) hardware/ti/omap4xxx/camera/CameraHal.cpp:578 setParameters - VNF true
D/CameraHal( 166): (12785a0) hardware/ti/omap4xxx/camera/CameraHal.cpp:596 setParameters - VSTAB false
D/CameraHal( 166): (12785a0) hardware/ti/omap4xxx/camera/CameraHal.cpp:617 setParameters - IPP mode set ldc-nsf
D/CameraHal( 166): (12785a0) hardware/ti/omap4xxx/camera/CameraHal.cpp:652 setParameters - Sensor Orientation is set to 0
E/CameraHal( 166): (12785a0) hardware/ti/omap4xxx/camera/CameraHal.cpp:662 setParameters - Invalid preview resolution 960 x 540
V/MotDrmPlugIn( 165): MotDrmPlugIn::onInitialize : 6579
D/MotDrmPlugIn( 165): MotDrmPlugIn::onSetOnInfoListener : 6579
D/MotDrmPlugIn( 165): MotDrmPlugIn::onOpenDecryptSession by fd : 11
D/ ( 165): filename = /system/media/audio/ui/camera_click.ogg
V/MotDrmPlugIn( 165): MotDrmPlugIn::onTerminate : 6579
V/MotDrmPlugIn( 165): MotDrmPlugIn::onInitialize : 6579
D/MotDrmPlugIn( 165): MotDrmPlugIn::onSetOnInfoListener : 6579
D/MotDrmPlugIn( 165): MotDrmPlugIn::onOpenDecryptSession by fd : 11
D/ ( 165): filename = /system/media/audio/ui/multishot_click.ogg
D/AndroidRuntime( 4594): Shutting down VM
W/dalvikvm( 4594): threadid=1: thread exiting with uncaught exception (group=0x40ac7210)
V/MotDrmPlugIn( 165): MotDrmPlugIn::onTerminate : 6579
V/MotDrmPlugIn( 165): MotDrmPlugIn::onInitialize : 6579
D/MotDrmPlugIn( 165): MotDrmPlugIn::onSetOnInfoListener : 6579
D/MotDrmPlugIn( 165): MotDrmPlugIn::onOpenDecryptSession by fd : 11
D/ ( 165): filename = /system/media/audio/ui/VideoRecord.ogg
I/OMXCodec( 166): isAudio=1, mMIME=audio/vorbis
V/MotDrmPlugIn( 165): MotDrmPlugIn::onTerminate : 6579
E/AndroidRuntime( 4594): FATAL EXCEPTION: main
E/AndroidRuntime( 4594): java.lang.RuntimeException: setParameters failed
E/AndroidRuntime( 4594): at android.hardware.Camera.native_setParameters(Native Method)
E/AndroidRuntime( 4594): at android.hardware.Camera.setParameters(Camera.java:1414)
E/AndroidRuntime( 4594): at sillyfidget.com.shakeitpolaroid.ShakeItLikeAPolaroidActivity.surfaceChanged(ShakeItLikeAPolaroidActivity.java:425)
E/AndroidRuntime( 4594): at android.view.SurfaceView.updateWindow(SurfaceView.java:544)
E/AndroidRuntime( 4594): at android.view.SurfaceView.access$000(SurfaceView.java:81)
E/AndroidRuntime( 4594): at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:169)
E/AndroidRuntime( 4594): at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:590)
E/AndroidRuntime( 4594): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1662)
E/AndroidRuntime( 4594): at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2558)
E/AndroidRuntime( 4594): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 4594): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 4594): at android.app.ActivityThread.main(ActivityThread.java:4697)
E/AndroidRuntime( 4594): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 4594): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 4594): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
E/AndroidRuntime( 4594): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)
E/AndroidRuntime( 4594): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager( 375): Force finishing activity sillyfidget.com.shakeitpolaroid/.ShakeItLikeAPolaroidActivity
I/OMXCodec( 166): isAudio=1, mMIME=audio/vorbis
I/OMXCodec( 166): isAudio=1, mMIME=audio/vorbis
I/AudioPlayer( 166): read from audio source returned: -1011
I/AudioPlayer( 166): read from audio source returned: -1011
I/AudioPlayer( 166): read from audio source returned: -1011
W/ApplicationContext( 375): Unable to create files directory files
D/ExtDispService( 667): onRotationChanged - rotation = 0
D/ExtDispService( 667): onRotationChanged! - PORTRAIT!!!
D/IExtDispIpcCB( 163): BnExtDispIpcCB NOTIFYCB: type:101; ext1:1; ext2:0;
D/HWC_HDMI_MOT( 163): IpcCB notifyCallback: type:101; ext1:1; ext2:0;
D/HWC_HDMI_MOT( 163): IpcCB notifyCallback: UI Orientation state change - rotation = 0
D/ti_hwc ( 163): hdmi_callback: UI Rotation = 0
I/InputReader( 375): Reconfiguring input devices. changes=0x00000004
I/InputReader( 375): Device reconfigured: id=2, name='atmxt-i2c', surface size is now 540x960, mode is 1
I/ActivityManager( 375): Config changed: {1.0 311mcc480mnc en_US layoutdir=0 sw360dp w360dp h614dp nrml long port finger -keyb/v/h -nav/h s.6}
D/Swype ( 703): checkEditorShowsCompletions(): shows: false
I/PortalService( 817): onConfigurationChanged
D/OpenGLRenderer( 498): Flushing caches (mode 0)
V/RecentsPanelView( 498): onVisibilityChanged(com.android.systemui.recent.RecentsPanelView#41c57358, 8)
I/SystemUIService( 498): onConfigurationChanged reached.
I/SystemUIService( 498): isLayoutXLarge = false
D/EvbridgeService( 817): handleIntent() android.intent.action.CONFIGURATION_CHANGED handled by com.android.portal.EvbridgeService#413f4738
D/RecentsPanelView( 498): panelHeight=0
D/StatusBar.NetworkController( 498): Intent.ACTION_CONFIGURATION_CHANGED Received
D/ConnectivityService( 375): getMobileDataEnabled returning true
D/ConnectivityService( 375): getMobileDataEnabled returning true
D/OpenGLRenderer( 874): Flushing caches (mode 0)
D/OpenGLRenderer( 874): Flushing caches (mode 1)
D/Launcher.Model( 874): onReceive intent=Intent { act=android.intent.action.CONFIGURATION_CHANGED flg=0x60000010 }
W/ActivityManager( 375): Activity pause timeout for ActivityRecord{414bfdd8 sillyfidget.com.shakeitpolaroid/.ShakeItLikeAPolaroidActivity}
D/Launcher.Model( 874): onReceive intent=Intent { act=android.intent.action.CONFIGURATION_CHANGED flg=0x60000010 }
W/InputManagerService( 375): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#41af34d0
W/Launcher( 874): localizable app group not found: Verizon Wireless
W/Launcher( 874): localizable app group not found: Verizon Wireless
W/Launcher( 874): localizable app group not found: Verizon Wireless
W/Launcher( 874): localizable app group not found: Verizon Wireless
I/ActivityManager( 375): No longer want com.google.android.talk (pid 4266): hidden #21
I/AlarmManager( 375): sending alarm Alarm{41ae30a0 type 2 com.android.phone}, PendingIntent{41b402e8: PendingIntentRecord{41d51cb8 com.android.phone broadcastIntent}}
V/AlarmManager( 375): sending alarm OnFinished PendingIntent{41b402e8: PendingIntentRecord{41d51cb8 com.android.phone broadcastIntent}}
D/AudioHardwareMot( 166): AudioStreamOutMot::standby called for 0x129c140
D/AudioHardwareMot( 166): Changed Min CPU Frequency to 300000 KHz
D/AudioHardwareMot( 166): Output 0x129c140 standby complete
D/dalvikvm( 375): GC_EXPLICIT freed 445K, 33% free 17236K/25635K, paused 9ms+7ms
I/Process ( 4594): Sending signal. PID: 4594 SIG: 9
W/InputManagerService( 375): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#420a4e80
W/InputDispatcher( 375): channel '420f92e8 sillyfidget.com.shakeitpolaroid/sillyfidget.com.shakeitpolaroid.ShakeItLikeAPolaroidActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x8
E/InputDispatcher( 375): channel '420f92e8 sillyfidget.com.shakeitpolaroid/sillyfidget.com.shakeitpolaroid.ShakeItLikeAPolaroidActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
W/InputDispatcher( 375): Attempted to unregister already unregistered input channel '420f92e8 sillyfidget.com.shakeitpolaroid/sillyfidget.com.shakeitpolaroid.ShakeItLikeAPolaroidActivity (server)'
W/AudioFlinger( 166): session id 16 not found for pid 166
I/ActivityManager( 375): Process sillyfidget.com.shakeitpolaroid (pid 4594) has died.
I/WindowManager( 375): WIN DEATH: Window{419c0168 sillyfidget.com.shakeitpolaroid/sillyfidget.com.shakeitpolaroid.SplashScreen paused=false}
I/WindowManager( 375): WIN DEATH: Window{420f92e8 sillyfidget.com.shakeitpolaroid/sillyfidget.com.shakeitpolaroid.ShakeItLikeAPolaroidActivity paused=false}
W/WindowManager( 375): Force-removing child win Window{417dc440 SurfaceView paused=false} from container Window{420f92e8 sillyfidget.com.shakeitpolaroid/sillyfidget.com.shakeitpolaroid.ShakeItLikeAPolaroidActivity paused=false}
V/CameraHal( 166): camera_disable_msg_type
D/CameraHal( 166): (12ca020) hardware/ti/omap4xxx/camera/CameraHal.cpp:225 disableMsgType - Disabling Preview Callback
V/CameraHal( 166): camera_stop_preview
V/CameraHal( 166): camera_cancel_picture
E/CameraHal( 166): (12ca020) hardware/ti/omap4xxx/camera/BaseCameraAdapter.cpp:1791 setState - Adapter state switch INTIALIZED_STATE Invalid Op! event = 0x5
V/CameraHal( 166): camera_release
D/CameraHal( 166): (12ca020) hardware/ti/omap4xxx/camera/SensorListener.cpp:223 disableSensor - orientation = 0x12e1518 (LIS3DH 3-axis Accelerometer)
D/CameraHal( 166): (12ca020) hardware/ti/omap4xxx/camera/SensorListener.cpp:108 ~SensorListener - Kill looper thread
D/CameraHal( 166): (12ca020) hardware/ti/omap4xxx/camera/SensorListener.cpp:120 ~SensorListener - Kill looper
D/CameraHal( 166): (12ca020) hardware/ti/omap4xxx/camera/SensorListener.cpp:126 ~SensorListener - SensorListener destroyed
I/CameraService( 166): Destroying camera 0
V/CameraHal( 166): camera_device_close
D/CameraHal( 166): (12ca020) hardware/ti/omap4xxx/camera/AppCallbackNotifier.cpp:1797 stop - --> AppCallbackNotifier NOTIFIER_STOPPED
D/CameraHal( 166): (12e35b8) hardware/ti/omap4xxx/camera/AppCallbackNotifier.cpp:287 notificationThread - Notification Thread received message from Camera HAL
D/CameraHal( 166): (12e35b8) hardware/ti/omap4xxx/camera/AppCallbackNotifier.cpp:1236 processMessage - +Msg get...
D/CameraHal( 166): (12e35b8) hardware/ti/omap4xxx/camera/AppCallbackNotifier.cpp:1238 processMessage - -Msg get...
I/CameraHal( 166): Received NOTIFIER_EXIT command from Camera HAL
D/CameraHal( 166): (12e35b8) hardware/ti/omap4xxx/camera/AppCallbackNotifier.cpp:290 notificationThread - Notification Thread exiting.
D/CameraHal( 166): (12ca020) hardware/ti/omap4xxx/camera/AppCallbackNotifier.cpp:1301 ~AppCallbackNotifier - Stopping Event Provider
D/CameraHal( 166): (12ca020) hardware/ti/omap4xxx/camera/AppCallbackNotifier.cpp:1309 ~AppCallbackNotifier - Stopping Frame Provider
D/CameraHal( 166): (12ca020) hardware/ti/omap4xxx/camera/OMXCameraAdapter/OMXCameraAdapter.cpp:1389 switchToLoaded - Already in OMX_Loaded state or OMX_StateInvalid state
W/WindowManager( 375): Failed looking up window
W/WindowManager( 375): java.lang.IllegalArgumentException: Requested window android.os.BinderProxy#41af7900 does not exist
W/WindowManager( 375): at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:7606)
W/WindowManager( 375): at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:7597)
W/WindowManager( 375): at com.android.server.wm.WindowState$DeathRecipient.binderDied(WindowState.java:1579)
W/WindowManager( 375): at android.os.BinderProxy.sendDeathNotice(Binder.java:433)
W/WindowManager( 375): at dalvik.system.NativeStart.run(Native Method)
I/WindowManager( 375): WIN DEATH: null
I/WindowManager( 375): WINDOW DIED Window{420f92e8 sillyfidget.com.shakeitpolaroid/sillyfidget.com.shakeitpolaroid.ShakeItLikeAPolaroidActivity paused=false}
D/CameraHal( 166): (12d76d0) hardware/ti/omap4xxx/camera/OMXCameraAdapter/OMXCameraAdapter.cpp:3571 Handler - msg.command = -1
D/CameraHal( 166): (12d76d0) hardware/ti/omap4xxx/camera/OMXCameraAdapter/OMXCameraAdapter.cpp:3585 Handler - Exiting command handler
D/CameraHal( 166): (12d2c40) hardware/ti/omap4xxx/camera/OMXCameraAdapter/OMXCameraAdapter.cpp:3628 Handler - Exiting OMX callback handler
I/AlarmManager( 375): sending alarm Alarm{41b2e7d8 type 3 android}, PendingIntent{42116fc0: PendingIntentRecord{421063c0 android broadcastIntent}}
V/AlarmManager( 375): sending alarm OnFinished PendingIntent{42116fc0: PendingIntentRecord{421063c0 android broadcastIntent}}
D/PortalService( 817): Portal onReceive:
I/PortalService( 817): onHandleIntent() action android.intent.action.CLOSE_SYSTEM_DIALOGS
I/ActivityManager( 375): START {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10200000 cmp=com.motorola.blur.home/.Launcher} from pid 375
I/ActivityManager( 375): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=org.jtb.alogcat cmp=org.jtb.alogcat/.LogActivity bnds=[8,65][137,245]} from pid 874
D/OpenGLRenderer( 874): Flushing caches (mode 1)
D/Swype ( 703): checkEditorShowsCompletions(): shows: false
I/ActivityManager( 375): Resumed Activity: org.jtb.alogcat/.LogActivity totalTime: 91 ms
W/IInputConnectionWrapper( 874): showStatusIcon on inactive InputConnection
D/OpenGLRenderer( 874): Flushing caches (mode 0)
D/dalvikvm( 4564): GC_CONCURRENT freed 666K, 5% free 11986K/12579K, paused 1ms+17ms
D/Swype ( 703): checkEditorShowsCompletions(): shows: false
W/ActivityManager( 375): Activity destroy timeout for ActivityRecord{414930d8 sillyfidget.com.shakeitpolaroid/.SplashScreen}
W/ActivityManager( 375): Activity destroy timeout for ActivityRecord{414bfdd8 sillyfidget.com.shakeitpolaroid/.ShakeItLikeAPolaroidActivity}
The problem is that you're passing invalid parameters in Camera.setParameters, not all cameras support the same features so you should be querying the camera for it's capabilities before calling that method. However if I were you I'd maybe start a bit smaller because it appears that you are a little over your head here. At the very least you should know how to recognize relevant log info and debug basic problems like this.
FYI: http://developer.android.com/reference/android/hardware/Camera.Parameters.html
May be your friend mobile android level is different with your mobile android level.
Some times the app does not work in all Android phones. If you want to check it you must follow these steps
1) Change your app target in manifest as minsdkversion 8 and target sdk version 15.
2) test your app in all emulators.
3) test each module (working of each activity) in all emulators.
You will definitely find some errors if you do like this. Good luck

Android intent takes a long time to be received

In my app I am sending an intent to update an appWidget. The problem is, from the logcat I can see that the intent is taking on average ten seconds to be received.
05-16 18:12:54.070: DEBUG/PHCA_Variable(7580): Broadcast sent
05-16 18:12:54.080: INFO/ActivityManager(274): Starting: Intent { flg=0x10000000 cmp=com.skipmorrow.phca/.WidgetDialogResponseActivity (has extras) } from pid 7580
05-16 18:12:54.100: WARN/ActivityManager(274): Trying to launch com.skipmorrow.phca/.WidgetDialogResponseActivity
05-16 18:12:54.170: DEBUG/InputTransport(274): Input channel constructed: name='40832a98 com.skipmorrow.phca/com.skipmorrow.phca.WidgetDialogResponseActivity (server)', ashmemFd=299, receivePipeFd=311, sendPipeFd=310
05-16 18:12:54.170: DEBUG/InputTransport(274): Input channel constructed: name='40832a98 com.skipmorrow.phca/com.skipmorrow.phca.WidgetDialogResponseActivity (client)', ashmemFd=304, receivePipeFd=309, sendPipeFd=313
05-16 18:12:54.170: DEBUG/InputTransport(274): Input channel destroyed: name='40832a98 com.skipmorrow.phca/com.skipmorrow.phca.WidgetDialogResponseActivity (client)', ashmemFd=304, receivePipeFd=309, sendPipeFd=313
05-16 18:12:54.180: DEBUG/InputTransport(7580): Input channel constructed: name='40832a98 com.skipmorrow.phca/com.skipmorrow.phca.WidgetDialogResponseActivity (client)', ashmemFd=66, receivePipeFd=67, sendPipeFd=68
05-16 18:12:54.460: INFO/ActivityManager(274): Displayed com.skipmorrow.phca/.WidgetDialogResponseActivity: +362ms
05-16 18:12:56.140: INFO/InputDispatcher(274): Delivering key to current input target: action: 0, channel '40832a98 com.skipmorrow.phca/com.skipmorrow.phca.WidgetDialogResponseActivity (server)'
05-16 18:12:56.260: INFO/InputDispatcher(274): Delivering key to current input target: action: 1, channel '40832a98 com.skipmorrow.phca/com.skipmorrow.phca.WidgetDialogResponseActivity (server)'
05-16 18:12:56.390: DEBUG/InputTransport(7580): Input channel destroyed: name='40832a98 com.skipmorrow.phca/com.skipmorrow.phca.WidgetDialogResponseActivity (client)', ashmemFd=66, receivePipeFd=67, sendPipeFd=68
05-16 18:13:03.350: DEBUG/PHCA_PhcaAppWidgetProvider(7580): onReceive(); action = android.appwidget.action.APPWIDGET_UPDATE
The only thing I see that looks a little fishy is a warning that an activity is starting. Why would that be a warning? Other than that, everything seems ok.
The code to send the intent is nothing special:
Log.d(MY_DEBUG_TAG, "UpdateAppWidgets()");
Intent i = new Intent();
i.setAction(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
ComponentName phcaWidget = new ComponentName(ctx, PhcaAppWidgetProvider.class);
i.putExtra("appWidgetIds", AppWidgetManager.getInstance(ctx).getAppWidgetIds(phcaWidget));
ctx.sendBroadcast(i);
Log.d(MY_DEBUG_TAG, "Broadcast sent");
And the onReceive in the appWidgetProvider is nothing special either. The Log statement is the first command.
What could cause an intent to take upwards of ten seconds to be received?
Skip
If the Activity you are sending the intent to does not yet exist, it has to be started. 10 seconds seems like a long time for starting an app, but not insane.
I have apps which run 5 times or more slower when in debug mode. If you are in debug mode, it could be that it will run much faster if not in debug mode. Generally, you can see logcat messages when not in debug mode, for a device connected to PC running eclipse IDE. If you can get that working, you should try running that way and see if it is faster. Also try running with phone unplugged from Eclipse entirely, it will be harder to tell if its faster but it might be.

Categories

Resources