how to show activity while in call - android

When i'm calling i would like to have an activity to be started from a background service.
I can get the activity to start while i'm calling and the phone is of my head (something to do with the proximity sensor I asume)
But when the proximity sensor detects something and i try to start the activty, the onStart of that activity is called, and directly after that the onStop is called.
Does anyone know how to start an activity while in call and the proximity sensor detects something?
01-02 15:42:14.829: I/KeepAliveService(5985): show pager call from Service
01-02 15:42:14.849: I/ActivityManager(167): Starting: Intent { flg=0x14050004 cmp=com.clb.clbmobile/.NewMessage (has extras) } from pid 5985
01-02 15:42:14.849: W/ActivityManager(167): Trying to launch com.clb.clbmobile/.NewMessage
01-02 15:42:14.859: D/KeyguardViewMediator(167): adjustUserActivityLocked mShowing: false mHidden: false
01-02 15:42:14.859: D/PowerManagerService(167): enableUserActivity true
01-02 15:42:14.859: D/StatusBarManagerService(167): manageDisableList what=0x0 pkg=android
01-02 15:42:14.859: D/InCallScreen(242): onWindowFocusChanged(false)...
01-02 15:42:14.859: D/InCallScreen(242): - onWindowFocusChanged: faking onDialerKeyUp()...
01-02 15:42:14.859: D/DTMFTwelveKeyDialer(242): Notifying dtmf key up.
01-02 15:42:14.889: I/KeepAliveService(5985): activity started
01-02 15:42:14.939: I/ClbActivity(5985): getting shared prefs
01-02 15:42:14.939: I/ClbActivity(5985): end shared prefs
01-02 15:42:14.939: I/AlertDialog(5985): Starting Alert Dialog
01-02 15:42:15.019: I/AlertDialog(5985): Done with init
01-02 15:42:15.079: D/BatteryService(167): update start
01-02 15:42:15.079: D/BatteryService(167): update start
01-02 15:42:15.079: D/BatteryService(167): update start
01-02 15:42:15.099: E/PlayerDriver(95): Creating Non-Tunnel mode playback - uncompressed MIO
01-02 15:42:15.099: W/MediaPlayer(5985): info/warning (1, 44)
01-02 15:42:15.109: I/AlertDialog(5985): Current volume = 15
01-02 15:42:15.109: E/MediaPlayer(5985): prepareAsync called in state 8
01-02 15:42:15.109: I/AlertDialog(5985): cant prepare Media Player
01-02 15:42:15.109: V/AudioPolicyManager(95): startOutput() output 1, stream 3, session 241
01-02 15:42:15.109: V/AudioPolicyManager(95): getDeviceForStrategy() from cache strategy 1, device 1
01-02 15:42:15.109: V/AudioPolicyManager(95): getNewDevice() selected device 1
01-02 15:42:15.109: V/AudioPolicyManager(95): setOutputDevice() output 1 device 1 delayMs 0
01-02 15:42:15.109: V/AudioPolicyManager(95): setOutputDevice() setting same device 1 or null device for output 1
01-02 15:42:15.109: V/AudioHardwareMSM72XX(95): open driver
01-02 15:42:15.109: V/AudioHardwareMSM72XX(95): get config
01-02 15:42:15.109: V/AudioHardwareMSM72XX(95): set config
01-02 15:42:15.109: V/AudioHardwareMSM72XX(95): buffer_size: 4800
01-02 15:42:15.109: V/AudioHardwareMSM72XX(95): buffer_count: 2
01-02 15:42:15.109: V/AudioHardwareMSM72XX(95): channel_count: 2
01-02 15:42:15.109: V/AudioHardwareMSM72XX(95): sample_rate: 44100
01-02 15:42:15.109: V/AudioHardwareMSM72XX(95): count : 4800
01-02 15:42:15.139: I/AlertDialog(5985): start pausing
01-02 15:42:15.149: I/MediaPlayer(5985): Info (1,44)
01-02 15:42:15.369: I/ActivityManager(167): Displayed com.clb.clbmobile/.NewMessage: +517ms
01-02 15:42:15.489: W/IInputConnectionWrapper(5985): showStatusIcon on inactive InputConnection
01-02 15:42:15.489: W/IInputConnectionWrapper(5985): getExtractedText on inactive InputConnection
01-02 15:42:15.499: D/InCallScreen(242): onStop()...
01-02 15:42:15.499: D/InCallScreen(242): onStop: state = OFFHOOK
01-02 15:42:15.509: D/InCallScreen(242): onResume()...
01-02 15:42:15.519: D/PhoneApp(242): setIgnoreTouchUserActivity(true)...
01-02 15:42:15.519: D/DTMFTwelveKeyDialer(242): startDialerSession()... this = com.android.phone.DTMFTwelveKeyDialer#4055e2a0
01-02 15:42:15.519: D/DTMFTwelveKeyDialer(242): - startDialerSession: mDTMFToneEnabled = true
01-02 15:42:15.519: D/InCallScreen(242): - onResume: initial status = SUCCESS
01-02 15:42:15.519: D/InCallScreen(242): isBluetoothAudioConnected: ==> isAudioOn = false
01-02 15:42:15.519: D/InCallScreen(242): setInCallScreenMode: NORMAL
01-02 15:42:15.519: D/InCallScreen(242): [okToDialDTMFTones] foreground state: ACTIVE, ringing state: false, call screen mode: NORMAL, result: true
01-02 15:42:15.519: D/InCallScreen(242): isBluetoothAudioConnected: ==> isAudioOn = false
01-02 15:42:15.519: D/StatusBarManagerService(167): manageDisableList what=0x1 pkg=com.android.phone
01-02 15:42:15.519: D/PowerManagerService(167): setPokeLock pokey=16 tag=PhoneApp
01-02 15:42:15.519: D/PowerManagerService(167): setScreenOffTimeouts mKeylightDelay=3000 mDimDelay=7000 mScreenOffDelay=20000 mDimScreen=true
01-02 15:42:15.519: D/StatusBarManagerService(167): manageDisableList what=0x1 pkg=com.android.phone
01-02 15:42:15.519: I/CallOnGoingView(229): onDetachedFromWindow
01-02 15:42:15.669: D/InCallScreen(242): Handler: handling message { what=101 when=-48ms obj=android.os.AsyncResult#406d01b8 } while not in foreground
01-02 15:42:15.669: D/InCallScreen(242): onPhoneStateChanged()...
01-02 15:42:15.669: D/PhoneApp(242): updateWakeState: callscreen false, dialer false, speaker false, state OFFHOOK...
01-02 15:42:15.669: D/PhoneApp(242): setScreenTimeout(DEFAULT)...
01-02 15:42:15.669: D/PhoneApp(242): requestWakeState(SLEEP)...
01-02 15:42:15.669: D/InCallScreen(242): onPhoneStateChanged: Activity not in foreground! Bailing out...
01-02 15:42:15.669: I/StatusBarManagerService(167): UPDATE-null , 0x7f020143
01-02 15:42:15.669: I/StatusBarService(229): REMOVE:MiniCon-1
01-02 15:42:15.689: I/AlertDialog(5985): start stopping
01-02 15:42:15.699: I/StatusBarService(229): ADD:MiniCon-1

I fixed this problem in a different way.
- First I check if the person is in a call
- Then I check if the proximity sensor is activated
If these two are the case, then a sound is being played from a service.
I then keep checking if the proximity sensor has deactived (eg. the phone is of the head). If this is the case, my acitivity is shown.

Related

VideoView and ViewPager 1 'Can't play this video' Error (Decoder Issue?)

I'm experiencing a 'Can't Play this Video' pop-up error when using the ViewPager 1 with VideoView. The popup message only happens when the user waits about an hour and a half and then navigates away to another video page that's adjacent to it. Looking at the logs, there seems to be a native crash with 'OMX.google.h264.decoder'. I'd like to figure out the root cause of this since I've recently migrated to ViewPager 2 and the issue seems to be fixed (not sure why). I'm using SDK version 25 with a custom ROM (if it matters). Also, I haven't been able to reproduce this issue on an emulator.
Steps to Reproduce:
Navigate to a video page that has an adjacent video page
Wait an hour and a half
Navigate to the adjacent video page
Expected Result:
Can't play this video error doesn't appear
Actual Result:
Can't play this video error appears
01-02 17:55:40.320 511 574 E SoundPool: Error creating AudioTrack
01-02 17:55:40.638 251 685 D NuPlayerDriver: pause(0xb060c060)
01-02 17:55:40.638 251 685 D NuPlayerDriver: notifyListener_l(0xb060c060), (7, 0, 0), loop setting(0, 0)
01-02 17:55:40.639 251 251 D NuPlayerDriver: seekTo(0xb060c060) 0 ms at state 6
01-02 17:55:40.639 251 251 D NuPlayerDriver: notifyListener_l(0xb060c060), (7, 0, 0), loop setting(0, 0)
01-02 17:55:40.642 251 296 D NuPlayerDriver: start(0xb1e2ac00), state is 6, eos is 0
01-02 17:55:40.649 251 2163 D NuPlayerDriver: notifyListener_l(0xb1e2ac00), (6, 0, 0), loop setting(0, 0)
01-02 17:55:40.652 248 2169 F libc : Fatal signal 6 (SIGABRT), code -6 in tid 2169 (le.h264.decoder)
01-02 17:55:40.653 222 222 W : debuggerd: handling request: pid=248 uid=1046 gid=1006 tid=2169
01-02 17:55:40.707 1964 1975 I art : Background sticky concurrent mark sweep GC freed 53604(4MB) AllocSpace objects, 37(740KB) LOS objects, 26% free, 11MB/16MB, paused 1.070ms total 160.419ms
01-02 17:55:40.748 17200 17200 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-02 17:55:40.750 17200 17200 F DEBUG : Build fingerprint: 'Android/pico_7d/pico_7d:7.1.2/dev-keys'
01-02 17:55:40.750 17200 17200 F DEBUG : Revision: '0'
01-02 17:55:40.750 17200 17200 F DEBUG : ABI: 'arm'
01-02 17:55:40.750 17200 17200 F DEBUG : pid: 248, tid: 2169, name: le.h264.decoder >>> media.codec <<<
01-02 17:55:40.750 17200 17200 F DEBUG : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
01-02 17:55:40.751 17200 17200 F DEBUG : r0 00000000 r1 00000879 r2 00000006 r3 00000008
01-02 17:55:40.751 17200 17200 F DEBUG : r4 aa2ef978 r5 00000006 r6 aa2ef920 r7 0000010c
01-02 17:55:40.751 17200 17200 F DEBUG : r8 aacadbe0 r9 000f4240 sl aaa140a0 fp aaa6e0d0
01-02 17:55:40.751 17200 17200 F DEBUG : ip 00000016 sp aa2ef4b8 lr ab2de257 pc ab2e0ab4 cpsr 200f0010
01-02 17:55:40.796 17200 17200 F DEBUG :
01-02 17:55:40.796 17200 17200 F DEBUG : backtrace:
01-02 17:55:40.797 17200 17200 F DEBUG : #00 pc 00049ab4 /system/lib/libc.so (tgkill+12)
01-02 17:55:40.797 17200 17200 F DEBUG : #01 pc 00047253 /system/lib/libc.so (pthread_kill+34)
01-02 17:55:40.797 17200 17200 F DEBUG : #02 pc 0001d525 /system/lib/libc.so (raise+10)
01-02 17:55:40.797 17200 17200 F DEBUG : #03 pc 00019071 /system/lib/libc.so (__libc_android_abort+34)
01-02 17:55:40.797 17200 17200 F DEBUG : #04 pc 00017034 /system/lib/libc.so (abort+4)
01-02 17:55:40.797 17200 17200 F DEBUG : #05 pc 0000b50b /system/lib/libstagefright_soft_avcdec.so (_ZN7android7SoftAVC13onQueueFilledEj+1334)
01-02 17:55:40.797 17200 17200 F DEBUG : #06 pc 00023175 /system/lib/libstagefright_omx.so (_ZN7android22SimpleSoftOMXComponent17onMessageReceivedERKNS_2spINS_8AMessageEEE+272)
01-02 17:55:40.797 17200 17200 F DEBUG : #07 pc 000241ad /system/lib/libstagefright_omx.so
01-02 17:55:40.797 17200 17200 F DEBUG : #08 pc 0000f505 /system/lib/libstagefright_foundation.so (_ZN7android8AHandler14deliverMessageERKNS_2spINS_8AMessageEEE+24)
01-02 17:55:40.797 17200 17200 F DEBUG : #09 pc 00011795 /system/lib/libstagefright_foundation.so (_ZN7android8AMessage7deliverEv+60)
01-02 17:55:40.798 17200 17200 F DEBUG : #10 pc 0001006d /system/lib/libstagefright_foundation.so (_ZN7android7ALooper4loopEv+380)
01-02 17:55:40.798 17200 17200 F DEBUG : #11 pc 0000e3c1 /system/lib/libutils.so (_ZN7android6Thread11_threadLoopEPv+264)
01-02 17:55:40.798 17200 17200 F DEBUG : #12 pc 00046d23 /system/lib/libc.so (_ZL15__pthread_startPv+22)
01-02 17:55:40.798 17200 17200 F DEBUG : #13 pc 00019abd /system/lib/libc.so (__start_thread+6)
01-02 17:55:41.120 511 604 W NativeCrashListener: Couldn't find ProcessRecord for pid 248
01-02 17:55:41.121 17200 17200 E : debuggerd: failed to kill process 248: No such process
01-02 17:55:41.124 511 529 I BootReceiver: Copying /data/tombstones/tombstone_07 to DropBox (SYSTEM_TOMBSTONE)
01-02 17:55:41.137 222 222 W : debuggerd: resuming target 248
01-02 17:55:41.194 251 2168 E ACodec : OMX/mediaserver died, signalling error!
01-02 17:55:41.194 251 2168 E ACodec : signalError(omxError 0x8000100d, internalError -32)
01-02 17:55:41.194 251 2214 E ACodec : OMX/mediaserver died, signalling error!
01-02 17:55:41.194 251 2214 E ACodec : signalError(omxError 0x8000100d, internalError -32)
01-02 17:55:41.196 1964 1977 E MediaPlayer: error (100, 2)
01-02 17:55:41.196 1964 1964 E MediaPlayer: Error (100,2)
01-02 17:55:41.196 1964 1964 D VideoView: Error: 100,2
01-02 17:55:41.197 251 2167 E MediaCodec: Codec reported err 0xffffffe0, actionCode 0, while in state 6
01-02 17:55:41.197 251 2166 E NuPlayerDecoder: Decoder (video) reported error : 0xffffffe0
01-02 17:55:41.197 251 2213 E MediaCodec: Codec reported err 0xffffffe0, actionCode 0, while in state 7
01-02 17:55:41.197 251 2163 E NuPlayer: received error(0xffffffe0) from video decoder, flushing(0), now shutting down
01-02 17:55:41.197 251 2163 D NuPlayerDriver: notifyListener_l(0xb1e2ac00), (100, 1, -32), loop setting(0, 0)
01-02 17:55:41.207 1964 1976 E MediaPlayer: error (100, 2)
01-02 17:55:41.217 1964 1977 E MediaPlayer: error (1, -32)
01-02 17:55:41.218 251 2166 E NuPlayerDecoder: failed to flush OMX.google.h264.decoder (err=-38)
01-02 17:55:41.218 251 2163 E NuPlayer: received error(0xffffffda) from video decoder, flushing(2), now shutting down
01-02 17:55:41.218 251 2163 D NuPlayerDriver: notifyListener_l(0xb1e2ac00), (100, 1, -38), loop setting(0, 0)
01-02 17:55:41.225 251 2166 W AMessage: failed to post message as target looper for handler 0 is gone.
01-02 17:55:41.237 238 238 I ServiceManager: service 'media.codec' died
01-02 17:55:41.239 1964 1976 E MediaPlayer: error (1, -38)
01-02 17:55:41.258 1964 1964 E MediaPlayer: Error (100,2)
01-02 17:55:41.258 1964 1964 D VideoView: Error: 100,2
01-02 17:55:41.304 1964 1964 E MediaPlayer: Error (1,-32)
01-02 17:55:41.304 1964 1964 D VideoView: Error: 1,-32
01-02 17:55:41.351 1964 1964 E MediaPlayer: Error (1,-38)
01-02 17:55:41.351 1964 1964 D VideoView: Error: 1,-38
01-02 17:55:41.361 251 2212 E NuPlayerDecoder: failed to flush OMX.google.h264.decoder (err=-32)
01-02 17:55:41.361 251 2204 E NuPlayer: received error(0xffffffe0) from video decoder, flushing(1), now shutting down
01-02 17:55:41.361 251 2204 D NuPlayerDriver: notifyListener_l(0xb060c060), (100, 1, -32), loop setting(0, 0)
01-02 17:55:41.361 1964 1977 E MediaPlayer: error (1, -32)
01-02 17:55:41.367 251 2204 W AMessage: failed to post message as target looper for handler 0 is gone.
01-02 17:55:41.368 250 677 D FslExtractor: HandleSeekOperation do seek index=0
01-02 17:55:41.369 250 677 D FslExtractor: HandleSeekOperation index=0,ts=0,flag=2
01-02 17:55:41.371 251 2204 D NuPlayerDriver: notifyListener_l(0xb060c060), (4, 0, 0), loop setting(0, 0)
01-02 17:55:41.547 1964 1964 E MediaPlayer: Error (1,-32)
01-02 17:55:41.547 1964 1964 D VideoView: Error: 1,-32
01-02 17:55:41.587 17205 17205 I mediacodec: ### mediacodecservice starting
01-02 17:55:41.587 17205 17205 W /system/bin/mediacodec: libminijail: allowing syscall: clock_gettime
01-02 17:55:41.587 17205 17205 W /system/bin/mediacodec: libminijail: allowing syscall: connect
01-02 17:55:41.587 17205 17205 W /system/bin/mediacodec: libminijail: allowing syscall: fcntl64
01-02 17:55:41.587 17205 17205 W /system/bin/mediacodec: libminijail: allowing syscall: socket
01-02 17:55:41.588 17205 17205 W /system/bin/mediacodec: libminijail: allowing syscall: writev
01-02 17:55:41.588 17205 17205 W /system/bin/mediacodec: libminijail: logging seccomp filter failures
01-02 17:55:46.147 1964 2000 I nativePoll: Call timed out and no file descriptors were ready for GPIO
01-02 17:55:49.343 582 589 I art : Debugger is no longer active
01-02 17:55:49.344 582 589 I art : Starting a blocking GC Instrumentation
01-02 17:55:49.344 1964 1971 I art : Debugger is no longer active
01-02 17:55:49.344 1964 1971 I art : Starting a blocking GC Instrumentation
01-02 17:55:49.344 781 789 I art : Debugger is no longer active
01-02 17:55:49.344 897 904 I art : Debugger is no longer active
01-02 17:55:49.344 897 904 I art : Starting a blocking GC Instrumentation
01-02 17:55:49.344 781 789 I art : Starting a blocking GC Instrumentation
01-02 17:55:49.345 838 847 I art : Debugger is no longer active
01-02 17:55:49.345 511 517 I art : Debugger is no longer active
01-02 17:55:49.345 838 847 I art : Starting a blocking GC Instrumentation
01-02 17:55:49.345 511 517 I art : Starting a blocking GC Instrumentation
01-02 17:55:49.345 626 643 I art : Debugger is no longer active
01-02 17:55:49.345 626 643 I art : Starting a blocking GC Instrumentation
01-02 17:55:49.348 975 982 I art : Debugger is no longer active
01-02 17:55:49.348 975 982 I art : Starting a blocking GC Instrumentation
01-02 17:55:49.348 880 888 I art : Debugger is no longer active
01-02 17:55:49.348 880 888 I art : Starting a blocking GC Instrumentation
01-02 17:55:49.348 1136 1143 I art : Debugger is no longer active
01-02 17:55:49.348 1136 1143 I art : Starting a blocking GC Instrumentation
01-02 17:55:49.349 596 606 I art : Debugger is no longer active
01-02 17:55:49.349 596 606 I art : Starting a blocking GC Instrumentation
01-02 17:55:49.349 925 931 I art : Debugger is no longer active
01-02 17:55:49.349 925 931 I art : Starting a blocking GC Instrumentation
01-02 17:55:49.349 990 997 I art : Debugger is no longer active
01-02 17:55:49.349 990 997 I art : Starting a blocking GC Instrumentation
01-02 17:55:49.354 17126 17126 D StudioTransport: Profiler:Signal received 1
01-02 17:55:49.354 17126 17126 D StudioTransport: Profiler:TerminationService shutting down with signal 1
01-02 17:55:49.830 17210 17210 I getprop : type=1400 audit(0.0:690): avc: denied { open } for path="/dev/__properties__/u:object_r:safemode_prop:s0" dev="tmpfs" ino=6854 scontext=u:r:shell:s0 tcontext=u:object_r:safemode_prop:s0 tclass=file permissive=1
01-02 17:55:49.850 17210 17210 I getprop : type=1400 audit(0.0:691): avc: denied { getattr } for path="/dev/__properties__/u:object_r:safemode_prop:s0" dev="tmpfs" ino=6854 scontext=u:r:shell:s0 tcontext=u:object_r:safemode_prop:s0 tclass=file permissive=1
01-02 17:55:49.850 17210 17210 I getprop : type=1400 audit(0.0:692): avc: denied { open } for path="/dev/__properties__/u:object_r:mmc_prop:s0" dev="tmpfs" ino=6855 scontext=u:r:shell:s0 tcontext=u:object_r:mmc_prop:s0 tclass=file permissive=1
01-02 17:55:49.850 17210 17210 I getprop : type=1400 audit(0.0:693): avc: denied { getattr } for path="/dev/__properties__/u:object_r:mmc_prop:s0" dev="tmpfs" ino=6855 scontext=u:r:shell:s0 tcontext=u:object_r:mmc_prop:s0 tclass=file permissive=1
01-02 17:55:49.850 17210 17210 I getprop : type=1400 audit(0.0:694): avc: denied { open } for path="/dev/__properties__/u:object_r:device_logging_prop:s0" dev="tmpfs" ino=6857 scontext=u:r:shell:s0 tcontext=u:object_r:device_logging_prop:s0 tclass=file permissive=1
01-02 17:55:49.850 17210 17210 I getprop : type=1400 audit(0.0:695): avc: denied { getattr } for path="/dev/__properties__/u:object_r:device_logging_prop:s0" dev="tmpfs" ino=6857 scontext=u:r:shell:s0 tcontext=u:object_r:device_logging_prop:s0 tclass=file permissive=1
01-02 17:55:51.290 17267 17267 V StudioTransport: Server listening on 127.0.0.1:12389 port:12389
01-02 17:55:56.157 1964 2000 I nativePoll: Call timed out and no file descriptors were ready for GPIO
01-02 17:56:06.167 1964 2000 I nativePoll: Call timed out and no file descriptors were ready for GPIO
01-02 17:56:15.070 1964 1996 I BatteryMonitor: Battery voltage (V) current (mA), 4.5757, 522
01-02 17:56:15.073 1964 1981 I TemperatureLogger: Unit temperature (deg C), 71.00
01-02 17:56:16.177 1964 2000 I nativePoll: Call timed out and no file descriptors were ready for GPIO
01-02 17:56:26.187 1964 2000 I nativePoll: Call timed out and no file descriptors were ready for GPIO
01-02 17:56:36.197 1964 2000 I nativePoll: Call timed out and no file descriptors were ready for GPIO
01-02 17:56:46.206 1964 2000 I nativePoll: Call timed out and no file descriptors were ready for GPIO

Play the ToneGenerator cause ANR

When click the dialerpad, play the ToneGenerator, but cause ANR。
The log:
01-02 04:02:48.209 392 2548 E audio_hw_primary: out_write: error -5, cannot write stream data: I/O error
01-02 04:02:48.209 392 2548 D audio_hw_primary: out_standby: enter: stream (0xae38a800) usecase(0: deep-buffer-playback)
01-02 04:02:48.249 392 3038 E audio_hw_primary: out_write: error -5, cannot write stream data: I/O error
01-02 04:02:48.249 392 3038 D audio_hw_primary: out_standby: enter: stream (0xae3ed000) usecase(1: low-latency-playback)
01-02 04:02:48.772 423 1116 W AudioFlinger: write blocked for 10554 msecs, 50 delayed writes, thread 0xae883ec0
01-02 04:02:48.772 423 1116 D AudioFlinger: mixer(0xae883ec0) throttle end: throttle time(19)
01-02 04:02:49.579 1767 1767 E ToneGenerator: — Stop timed out
01-02 04:02:52.639 1767 1767 E ToneGenerator: — Delayed start timed out, status -110
01-02 04:02:52.639 1767 1767 W ToneGenerator: Tone start failed!!!, time 8178550
You can check the code: DialpadFragment.java--ToneGenerator:
private void playTone(int tone, int durationMs)
private void stopTone()
The ToneGenerator stop timed out cause the ANR. But what did ToneGenerator cause to stop timed out? How to analyze and fix this issue?
you can simply use and its work for me
ToneGenerator toneG = new ToneGenerator(AudioManager.STREAM_ALARM, 100);
toneG.startTone(ToneGenerator.TONE_CDMA_ALERT_CALL_GUARD, 200);

Bluetooth keeps disconnecting after being connected to another Android device for a while

I have an Xperia Z3C, Android 5.1.1 and I'm trying to connect it to a Nexus 4 Android 6.0.1 via Bluetooth. Pairing them is OK, but when I try to connect them, it says 'Connected' for less than a second and automatically disconnects.
Is this a known issue? I haven't found anything about this.
Here's what logcat says:
03-14 17:25:55.308: E/bt-btif(14245): bte_scan_filt_param_cfg_evt, 1
03-14 17:25:55.308: E/bt-btif(14245): bte_scan_filt_param_cfg_evt, 1
03-14 17:25:55.990: E/bt-btm(14245): new address: xx:xx:xx:xx:xx:xx
03-14 17:25:55.990: E/bt-btm(14245): new address: xx:xx:xx:xx:xx:xx
03-14 17:25:56.712: E/bt-btm(14245): new address: xx:xx:xx:xx:xx:xx
03-14 17:25:57.464: E/bt-btif(14245): bte_scan_filt_param_cfg_evt, 1
03-14 17:25:57.814: E/bt-btm(14245): Ignoring RNR as the state is not BTM_SEC_STATE_GETTING_NAME
03-14 17:25:57.933: E/NetlinkEvent(318): Unknown ifindex 41 in RTM_DELADDR
03-14 17:25:57.963: E/dhcpcd(15974): bt-pan: interface not found or invalid
03-14 17:25:57.986: E/BluetoothPanServiceJni(14245): ## ERROR : disconnectPanNative(L224): Failed disconnect pan channel, status: 1##
03-14 17:25:58.139: E/BluetoothTetheringNetworkFactory(14245): DHCP request error:DHCP result was failed
03-14 17:26:01.382: E/bt-btm(14245): btm_sec_disconnected - Clearing Pending flag
I had the same problem while trying to scan for Bluetooth devices from my Android application. The interesting thing is that it does not throw any exception (caught or uncaught) and fails silently! The problem occurs for devices with API Level >= 23 (Android 6.0). Here is an extract of my Logcat logs :
03-30 14:07:52.099 192-211/? I/BufferQueueProducer: [org.manios.testbt/org.manios.testbt.printing.BluetoothPrinterDiscovery](this:0x7fa16de400,id:1467,api:1,p:26262,c:192) queueBuffer: fps=0.19 dur=5154.29 max=5154.29 min=5154.29
03-30 14:07:52.114 192-192/? I/SurfaceFlinger: [Built-in Screen (type:0)] fps:1.091767,dur:1831.89,max:999.66,min:832.23
03-30 14:07:52.137 774-1001/? D/InputReader: AP_PROF:AppLaunch_dispatchPtr:Up:89556864, ID:0, Index:2056797440
03-30 14:07:52.137 774-1001/? I/PerfService: PerfServiceNative_boostEnableTimeoutMsAsync:3, 100
03-30 14:07:52.138 26262-26262/org.manios.testbt D/SettingsInterface: from settings cache , name = sound_effects_enabled , value = 0
03-30 14:07:52.138 26262-26262/org.manios.testbt D/BluetoothAdapter: isEnabled
03-30 14:07:52.140 26262-26262/org.manios.testbt D/BluetoothAdapter: getName
03-30 14:07:52.141 774-1636/? D/BluetoothManagerService: checkIfCallerIsForegroundUser: valid=true callingUser=0 parentUser=-10000 foregroundUser=0
03-30 14:07:52.142 21807-21818/? D/BluetoothAdapterProperties: getName: mName = Lenovo TAB3 8
03-30 14:07:52.144 26262-666/org.manios.testbt D/BluetoothAdapter: isEnabled
03-30 14:07:52.146 26262-666/org.manios.testbt D/BluetoothAdapter: isDiscovering
03-30 14:07:52.148 26262-666/org.manios.testbt D/BluetoothAdapter: 109507751: getState(). Returning 12
03-30 14:07:52.152 21807-21817/? D/BluetoothAdapterProperties: isDiscovering: mDiscovering = false
03-30 14:07:52.156 26262-666/org.manios.testbt D/BluetoothAdapter: startDiscovery
03-30 14:07:52.158 26262-666/org.manios.testbt D/BluetoothAdapter: 109507751: getState(). Returning 12
03-30 14:07:52.160 21807-21830/? W/bt_btif: bta_dm_check_av:0
03-30 14:07:52.172 21807-21830/? E/bt_btif: bte_scan_filt_param_cfg_evt, 1
03-30 14:07:52.181 21807-21823/? I/BluetoothAdapterProperties: Callback:discoveryStateChangeCallback with state:1
03-30 14:07:52.182 774-2924/? V/ActivityManager: Broadcast: Intent { act=android.bluetooth.adapter.action.DISCOVERY_STARTED flg=0x10 } ordered=false userid=0 callerApp=ProcessRecord{c376192 21807:com.android.bluetooth/1002}
03-30 14:07:52.184 1057-1265/? V/BluetoothEventManager: Received android.bluetooth.adapter.action.DISCOVERY_STARTED
03-30 14:07:52.185 1057-1265/? D/BluetoothEventManager: scanning state change to true
03-30 14:07:52.186 21983-21983/? D/ActivityThread: BDC-Calling onReceive: intent=Intent { act=android.bluetooth.adapter.action.DISCOVERY_STARTED flg=0x10 cmp=com.android.settings/.bluetooth.BluetoothDiscoveryReceiver }, receiver=com.android.settings.bluetooth.BluetoothDiscoveryReceiver#b02fe63
03-30 14:07:52.186 21983-21983/? V/BluetoothDiscoveryReceiver: Received: android.bluetooth.adapter.action.DISCOVERY_STARTED
03-30 14:07:52.187 21983-21983/? D/ActivityThread: BDC-RECEIVER handled : 0 / ReceiverData{intent=Intent { act=android.bluetooth.adapter.action.DISCOVERY_STARTED flg=0x10 cmp=com.android.settings/.bluetooth.BluetoothDiscoveryReceiver } packageName=com.android.settings resultCode=-1 resultData=null resultExtras=null}
03-30 14:07:52.218 774-1001/? D/InputReader: AP_PROF:AppLaunch_dispatchPtr:Down:89556946, ID:0, Index:2056794048
03-30 14:07:52.219 774-1001/? I/PerfService: PerfServiceNative_boostEnableAsync:3
I found after some searching using this issue, that in API Level >= 23 (Android 6.0) we have to add the following permission to AndroidManifext.xml
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
so that scanning and other Bluetooth actions function properly.
In Android documentation it states in BluetoothAdapter.startDiscovery() that it requires BLUETOOTH_ADMIN permission with no further details. But if we take a look into BluetoothLeScanner.startScan(),it states clearly that:
Requires BLUETOOTH_ADMIN permission. An app must hold ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission in order to get results.
Hope this helps!
So two things can be going on here. Either the second device that you are trying to maintain a connection with is having an issue maintaining a connection or there is an interference being caused between the two just long enough to break the connection but not long enough to terminate it completely.

Android app suddenly stops - in-app purchase

After I implemented in-app purchase in my android app, it suddenly stops when I close it. And Im struggling to see what the problem is in log cat. Im receiving the error
Permission Denial: get/set setting for user asks to run as user -2 but is calling from
user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL
But I have received this error before, and the application still worked fine. Here is my log cat, I was uncertain for how much I needed to add so sorry if it is a lot. Please let me know if I need to add some more, thanks!
D/SSRMv2:Monitor( 2347): SIOP:: AP = 450 (read only)
I/InputReader( 2347): Touch event's action is 0x0 (deviceType=0) [pCnt=1, s=0.16208 ] when=116815167044000
I/InputDispatcher( 2347): Delivering touch to: action: 0x0
I/InputReader( 2347): Touch event's action is 0x1 (deviceType=0) [pCnt=1, s=] when=116815315918000
I/InputDispatcher( 2347): Delivering touch to: action: 0x1
D/BatteryService( 2347): update start
D/BatteryService( 2347): level:80, scale:100, status:2, health:2, present:true, voltage: 4085, temperature: 467, technology: Li-ion, AC powered:false, USB powered:true, Wireless powered:false, icon:17303550, invalid charger:0, online:4, charge type:1, current avg:460
D/SSRMv2:Monitor( 2347): SIOP:: AP = 450, Prev AP = 450, Duration = 10006
D/SSRMv2:Monitor( 2347): SIOP:: AP = 450 (read only)
I/InputReader( 2347): Touch event's action is 0x0 (deviceType=0) [pCnt=1, s=0.16209 ] when=116820660525000
D/InputDispatcher( 2347): Waiting for application to become ready for input: xxxx Reason: Waiting because the touched window has not finished processing the input events that were previously delivered to it.
D/PowerManagerService( 2347): [api] userActivityFromNative : 50 (event: 2 flags: 0)
D/SensorService( 2347): 0.4 9.9 -0.1
I/InputReader( 2347): Touch event's action is 0x1 (deviceType=0) [pCnt=1, s=] when=116820774347000
D/SSRMv2:Monitor( 2347): SIOP:: AP = 450 (read only)
I/dumpstate(29002): done
D/BatteryService( 2347): Sending ACTION_BATTERY_CHANGED.
D/SSRMv2:CustomFrequencyManagerService( 2347): acquireDVFSLockLocked : type : DVFS_MIN_LIMIT frequency : 1200000 uid : 1000 pid : 2347 pkgName : ACTIVITY_RESUME_BOOSTER#5
I/power ( 2347): *** acquire_dvfs_lock : lockType : 1 freq : 1200000
W/ActivityManager( 2347): mDVFSHelper.acquire()
D/dalvikvm( 2347): GC_FOR_ALLOC freed 201K, 17% free 52076K/62236K, paused 330ms, total 331ms
I/ActivityManager( 2347): Process com.jb.gosms.emoji (pid 28888) (adj 11) has died.
D/InputDispatcher( 2347): Waiting for application to become ready for input: xxxx Reason: Waiting because the touched window is paused.
I/InputDispatcher( 2347): Window spent 8210.1ms processing the last input event: MotionEvent(action=0, deviceId=5, source=0x00001002, displayId=0)
I/InputDispatcher( 2347): Window spent 8061.8ms processing the last input event: MotionEvent(action=1, deviceId=5, source=0x00001002, displayId=0)
I/ActivityManager( 2347): Process com.google.android.apps.plus (pid 28904) (adj 9) has died.
W/Choreographer(28777): Already have a pending vsync event. There should only be one at a time.
I/ActivityManager( 2347): Process com.facebook.katana (pid 28332) (adj 8) has died.
D/MoPub (28777): Third-party network timed out.
D/STATUSBAR-NetworkController( 8423): onSignalStrengthsChanged signalStrength=SignalStrength: 11 -1 -1 -1 -1 -1 -1 99 -140 -20 -200 -1 2147483647 gsm|lte 0x4 level=4
D/SSRMv2:Monitor( 2347): SIOP:: AP = 450 (read only)
D/STATUSBAR-NetworkController( 8423): onSignalStrengthsChanged signalStrength=SignalStrength: 11 -1 -1 -1 -1 -1 -1 99 -140 -20 -200 -1 2147483647 gsm|lte 0x3 level=3
D/STATUSBAR-NetworkController( 8423): refreshSignalCluster: data=2 bt=false
V/MoPub (28777): MoPubErrorCode: Third-party network failed to respond in a timely manner.
D/MoPub (28777): Loading failover url: http://ads.mopub.com/m/ad?v=6&id=9228ebfca6504982941c5601765f658a&nv=1.17.2.0&dn=samsung%2CGT-I9300%2Cm0xx&udid=sha%3A32bc9016036e33b67730c1fadad5c452541e38a5&q=FBATTRID%3Aa3f781d2-2ba6-4265-9690-e4fe0b244cda&z=%2B0200&o=p&sc_a=2.0&mr=1&mcc=242&mnc=05&iso=no&cn=One%20Call&ct=3&av=1.3.8&android_perms_ext_storage=1&request_id=08889b4ab90911e3af000025907c4175&exclude=fbab69084c5611e381c11231392559e4
D/MoPub (28777): Loading url: http://ads.mopub.com/m/ad?v=6&id=9228ebfca6504982941c5601765f658a&nv=1.17.2.0&dn=samsung%2CGT-I9300%2Cm0xx&udid=sha%3A32bc9016036e33b67730c1fadad5c452541e38a5&q=FBATTRID%3Aa3f781d2-2ba6-4265-9690-e4fe0b244cda&z=%2B0200&o=p&sc_a=2.0&mr=1&mcc=242&mnc=05&iso=no&cn=One%20Call&ct=3&av=1.3.8&android_perms_ext_storage=1&request_id=08889b4ab90911e3af000025907c4175&exclude=fbab69084c5611e381c11231392559e4
I/MoPub (28777): Fetching ad for task #1
D/STATUSBAR-NetworkController( 8423): onSignalStrengthsChanged signalStrength=SignalStrength: 10 -1 -1 -1 -1 -1 -1 99 -140 -20 -200 -1 2147483647 gsm|lte 0x3 level=3
D/STATUSBAR-IconMerger( 8423): checkOverflow(240), More:false, Req:false Child:2
D/STATUSBAR-NetworkController( 8423): onSignalStrengthsChanged signalStrength=SignalStrength: 9 -1 -1 -1 -1 -1 -1 99 -140 -20 -200 -1 2147483647 gsm|lte 0x3 level=3
V/WindowManager( 2347): Window{43202888 u0 Keyguard}mOrientationRequetedFromKeyguard=false
D/STATUSBAR-StatusBarManagerService( 2347): manageDisableList what=0x0 pkg=WindowManager.LayoutParams
D/CrashAnrDetector( 2347): processName: com.guessSound.guessSound
D/CrashAnrDetector( 2347): broadcastEvent : com.guessSound.guessSound data_app_crash
D/STATUSBAR-BatteryController( 8423): onReceive() - ACTION_BATTERY_CHANGED
D/STATUSBAR-BatteryController( 8423): onReceive() - BATTERY_STATUS_CHARGING:
D/webviewglue(28777): nativeDestroy view: 0x5979cee0
D/webviewglue(28777): nativeDestroy view: 0x59c399f0
D/STATUSBAR-IconMerger( 8423): checkOverflow(240), More:false, Req:false Child:2
D/STATUSBAR-PhoneStatusBar( 8423): mBrightnessEnablebySettings = true mBrightnessEnablebyBattery = true mBrightnessEnablebyDisableFlag = true
D/STATUSBAR-AirplaneModeQuickSettingButton( 8423): mPhoneStateListener - inAirplaneMode: false
D/STATUSBAR-NetworkController( 8423): onServiceStateChanged state=0
D/STATUSBAR-NetworkController( 8423): updateDataNetType()
D/STATUSBAR-NetworkController( 8423): Nothing, mRoamingIconId = 0
D/WindowManager( 2347): computeScreenConfigurationLocked() set config.orientation=1 dw=720 dh=1280 Callers=com.android.server.wm.WindowManagerService.updateOrientationFromAppTokensLocked:5171 com.android.server.wm.WindowManagerService.updateOrientationFromAppTokens:5142 com.android.server.am.ActivityStack.realStartActivityLocked:1021
I/SurfaceFlinger( 1935): id=2621 createSurf (1x1),1 flag=4, huessSound
D/PowerManagerService( 2347): setKeyboardVisibility: false
I/GATE (28777): <GATE-M>DEV_ACTION_COMPLETED</GATE-M>
I/InputDispatcher( 2347): Delivering touch to: action: 0x0
I/InputDispatcher( 2347): Delivering touch to: action: 0x1
D/WifiController( 2347): SET_AP_BOOSTER_FLAG ignored due to state change
D/WifiService( 2347): onDataConnectionStateChanged: state -2, networkType - UMTS
D/STATUSBAR-NetworkController( 8423): onDataConnectionStateChanged: state=2 type=3
D/STATUSBAR-NetworkController( 8423): updateDataNetType()
D/STATUSBAR-NetworkController( 8423): Nothing, mRoamingIconId = 0
D/STATUSBAR-NetworkController( 8423): refreshSignalCluster: data=2 bt=false
D/ContextualPageReceiver(20224): mContextualPageReceiver: ACTION_SERVICE_STATE_CHANGED isRoaming : false
D/STATUSBAR-IconMerger( 8423): checkOverflow(240), More:false, Req:false Child:2
W/ActivityManager( 2347): Permission Denial: get/set setting for user asks to run as user -2 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL
E/DatabaseUtils( 2347): Writing exception to parcel
E/DatabaseUtils( 2347): java.lang.SecurityException: Permission Denial: get/set setting for user asks to run as user -2 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL
E/DatabaseUtils( 2347): at com.android.server.am.ActivityManagerService.handleIncomingUser(ActivityManagerService.java:13140)
E/DatabaseUtils( 2347): at android.app.ActivityManager.handleIncomingUser(ActivityManager.java:2038)
E/DatabaseUtils( 2347): at com.android.providers.settings.SettingsProvider.callFromPackage(SettingsProvider.java:607)
E/DatabaseUtils( 2347): at android.content.ContentProvider$Transport.call(ContentProvider.java:279)
E/DatabaseUtils( 2347): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:273)
E/DatabaseUtils( 2347): at android.os.Binder.execTransact(Binder.java:388)
E/DatabaseUtils( 2347): at com.android.server.SystemServer.init1(Native Method)
E/DatabaseUtils( 2347): at com.android.server.SystemServer.main(SystemServer.java:2012)
E/DatabaseUtils( 2347): at java.lang.reflect.Method.invokeNative(Native Method)
E/DatabaseUtils( 2347): at java.lang.reflect.Method.invoke(Method.java:525)
E/DatabaseUtils( 2347): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
E/DatabaseUtils( 2347): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
E/DatabaseUtils( 2347): at dalvik.system.NativeStart.main(Native Method)
I/power ( 2347): *** release_dvfs_lock : lockType : 1
I/power ( 2347): *** acquire_dvfs_lock : lockType : 1 freq : 1200000
D/SSRMv2:CustomFrequencyManagerService( 2347): releaseDVFSLockLocked : Getting Lock type frm List : DVFS_MIN_LIMIT frequency : 1200000 uid : 1000 pid : 2347 tag : ACTIVITY_RESUME_BOOSTER#5
D/SSRMv2:CustomFrequencyManagerService( 2347): acquireDVFSLockLocked : type : DVFS_MIN_LIMIT frequency : 1200000 uid : 1000 pid : 2347 pkgName : ACTIVITY_RESUME_BOOSTER#5
W/ActivityManager( 2347): mDVFSHelper.acquire()
V/RealCellState( 2689): telephonyManager network type is 3
D/PhoneApp( 2708): mReceiver: ACTION_ANY_DATA_CONNECTION_STATE_CHANGED
D/AbsListView(28777): unregisterIRListener() is called
D/FileWriteThread( 2708): FileWriteThread : threadType = 2
D/NotificationMgr( 2708): hideDataDisconnectedRoaming()...
D/MobileDataStateTracker( 2347): default: Received state=CONNECTED, old=CONNECTED, reason=(unspecified)
D/AbsListView(28777): Get MotionRecognitionManager
D/MotionRecognitionService( 2347): ssp status : false
D/dalvikvm(28777): GC_FOR_ALLOC freed 6233K, 27% free 20403K/27816K, paused 57ms, total 57ms
D/StatusChecker(29074): onReceive : android.intent.action.SERVICE_STATE
D/StatusChecker(29074): Service state changed : 0
D/STATUSBAR-NetworkController( 8423): onDataActivity: direction=2
D/STATUSBAR-NetworkController( 8423): refreshSignalCluster: data=2 bt=false
I/BootupListener( 2708): mPendingNetworkManualSelection : false
W/FlurryAgent(28777): Continuing previous session
D/AbsListView(28777): onVisibilityChanged() is called, visibility : 4
D/AbsListView(28777): unregisterIRListener() is called
D/AbsListView(28777): onVisibilityChanged() is called, visibility : 0
D/AbsListView(28777): unregisterIRListener() is called
D/WindowManager( 2347): computeScreenConfigurationLocked() set config.orientation=1 dw=720 dh=1280 Callers=com.android.server.wm.WindowManagerService.updateOrientationFromAppTokensLocked:5171 com.android.server.wm.WindowManagerService.updateOrientationFromAppTokens:5142 com.android.server.am.ActivityStack.realStartActivityLocked:1021
D/PowerManagerService( 2347): setKeyboardVisibility: false
D/webviewglue(28777): nativeDestroy view: 0x596c5bb0
D/webviewglue(28777): nativeDestroy view: 0x57dc5168
I/SurfaceFlinger( 1935): id=2622 createSurf (1x1),1 flag=4, OewGameActi
D/AbsListView(28777): unregisterIRListener() is called
D/AbsListView(28777): Get MotionRecognitionManager
D/MotionRecognitionService( 2347): ssp status : false
D/dalvikvm( 2896): GC_CONCURRENT freed 410K, 30% free 10387K/14804K, paused 4ms+4ms, total 44ms
W/FlurryAgent(28777): Continuing previous session
D/AbsListView(28777): onVisibilityChanged() is called, visibility : 4
D/AbsListView(28777): unregisterIRListener() is called
D/AbsListView(28777): onVisibilityChanged() is called, visibility : 0
D/AbsListView(28777): unregisterIRListener() is called
D/AbsListView(28777): unregisterIRListener() is called
D/dalvikvm(28777): GC_CONCURRENT freed 651K, 23% free 21680K/27816K, paused 11ms+6ms, total 58ms
I/SurfaceFlinger( 1935): id=2623 createSurf (720x1280),1 flag=4, OewGameActi
D/dalvikvm(28826): GC_EXPLICIT freed 1284K, 19% free 11047K/13512K, paused 4ms+16ms, total 93ms
D/AbsListView(28777): unregisterIRListener() is called
D/AbsListView(28777): unregisterIRListener() is called
D/AbsListView(28777): unregisterIRListener() is called
V/WindowManager( 2347): Window{43202888 u0 Keyguard}mOrientationRequetedFromKeyguard=false
I/power ( 2347): *** release_dvfs_lock : lockType : 1
D/SSRMv2:CustomFrequencyManagerService( 2347): releaseDVFSLockLocked : Getting Lock type frm List : DVFS_MIN_LIMIT frequency : 1200000 uid : 1000 pid : 2347 tag : ACTIVITY_RESUME_BOOSTER#5
W/ActivityManager( 2347): mDVFSHelper.release()
I/power ( 2347): *** acquire_dvfs_lock : lockType : 1 freq : 1200000
D/AbsListView(28777): unregisterIRListener() is called
D/SSRMv2:CustomFrequencyManagerService( 2347): acquireDVFSLockLocked : type : DVFS_MIN_LIMIT frequency : 1200000 uid : 1000 pid : 2347 pkgName : ACTIVITY_RESUME_BOOSTER#8
D/MoPub (28777): Ad Unit (9228ebfca6504982941c5601765f658a) going invisible: disabling refresh
D/MoPub (28777): Automatic refresh for com.mopub.mobileads.AdConfiguration#42d65750 set to: false.
D/STATUSBAR-NetworkController( 8423): onDataActivity: direction=0
D/STATUSBAR-NetworkController( 8423): refreshSignalCluster: data=2 bt=false
V/WindowManager( 2347): Window{43202888 u0 Keyguard}mOrientationRequetedFromKeyguard=false
I/SurfaceFlinger( 1935): id=2622 Removed OewGameActi (3/7)
I/SurfaceFlinger( 1935): id=2622 Removed OewGameActi (-2/7)
V/WindowManager( 2347): Window{43202888 u0 Keyguard}mOrientationRequetedFromKeyguard=false
W/FlurryAgent(28777): Trying to end session
D/AbsListView(28777): onVisibilityChanged() is called, visibility : 4
D/AbsListView(28777): unregisterIRListener() is called
D/LocationManagerService( 2347): getProviders()=[]
D/LocationManagerService( 2347): getProviders()=[]
D/LocationManagerService( 2347): getBestProvider(Criteria[power=NO_REQ acc=---], true)=null
W/FlurryAgent(28777): Trying to end session
D/AbsListView(28777): onVisibilityChanged() is called, visibility : 4
D/AbsListView(28777): unregisterIRListener() is called
D/LocationManagerService( 2347): getProviders()=[]
D/LocationManagerService( 2347): getProviders()=[]
D/LocationManagerService( 2347): getBestProvider(Criteria[power=NO_REQ acc=---], true)=null
V/WindowManager( 2347): Window{43202888 u0 Keyguard}mOrientationRequetedFromKeyguard=false
V/WindowManager( 2347): Window{43202888 u0 Keyguard}mOrientationRequetedFromKeyguard=false
I/power ( 2347): *** release_dvfs_lock : lockType : 1
D/SSRMv2:CustomFrequencyManagerService( 2347): releaseDVFSLockLocked : Getting Lock type frm List : DVFS_MIN_LIMIT frequency : 1200000 uid : 1000 pid : 2347 tag : ACTIVITY_RESUME_BOOSTER#8
UPDATE
Here is my Android manifest, Im develop the app in phonegap and use therefore a plugin for the purchase, the java code is below the manifest
<manifest android:hardwareAccelerated="true" android:versionCode="5" android:versionName="1.3.0" android:windowSoftInputMode="adjustPan" package="com.guessSound.guessSound" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" />
<application android:debuggable="false" android:hardwareAccelerated="true" android:icon="#drawable/icon" android:label="#string/app_name" android:name="com.guessSound.guessSound.MainApplication">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="#string/app_name" android:name="com.guessSound.guessSound.GuessThisSound" android:screenOrientation="portrait" android:theme="#android:style/Theme.Black.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.ParseBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
</application>
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.RECORD_VIDEO" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="com.android.vending.BILLING" />
</manifest>
I do first buy it and then consume it, because it looks like I cant buy a consume item while testing with the test productID
private void buy(final String sku){
/* TODO: for security, generate your payload here for verification. See the comments on
* verifyDeveloperPayload() for more info. Since this is a sample, we just use
* an empty string, but on a production app you should generate this. */
final String payload = "";
if (mHelper == null){
callbackContext.error("Billing plugin was not initialized");
return;
}
this.cordova.setActivityResultCallback(this);
mHelper.launchPurchaseFlow(cordova.getActivity(), sku, RC_REQUEST,
mPurchaseFinishedListener, payload);
}
private void consumePurchase(JSONArray data) throws JSONException{
if (mHelper == null){
callbackContext.error("Did you forget to initialize the plugin?");
return;
}
String sku = data.getString(0);
// Get the purchase from the inventory
Purchase purchase = myInventory.getPurchase(sku);
if (purchase != null)
// Consume it
mHelper.consumeAsync(purchase, mConsumeFinishedListener);
else
callbackContext.error(sku + " is not owned so it cannot be consumed");
}
UPDATE 2.0
Im calling the consumePurchase in the successmethod to buy. Could this cause the problem? After I remove the consumepurchase in the successmethod, it looks like I don't get that error.. So how can I buy a consume item without using consumepurchase right after I have bought the item? Could it work if I add a timer, or is it any better solution to this?
User 0 usually indicates root. Are you running your app as root?

Foursquare API: Android key hash does not match the allowed key hashes specified in the app's settings

I'm trying to create Android application based on Fousquare API. I need to connect to foursquare account. I generated keys as told in instructions: github - foursquare-android-oauth But result is "Connecting failed". Client id and client secret are in app's settings. What's wrong?
Logcat:
I/ActivityManager( 1355): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10100000 cmp=com.foursquare.android.sample/.MainActivity } from pid 1507
D/WindowManagerImpl( 1355): addView, new view, mViews[1]: com.android.internal.policy.impl.PhoneWindow$DecorView#40d5af98
W/dalvikvm( 1507): disableGcForExternalAlloc: true
W/dalvikvm( 1507): disableGcForExternalAlloc: false
D/SensorService( 1355): enable: get sensor name = BMA150 3-axis Accelerometer
D/Sensors ( 1355): Enable akm: en = 1
D/SensorService( 1355): SensorDevice::activate--: handle = 0x0, enabled = 0x1
D/SensorService( 1355): enable: sensor->activate return value = 0x0
D/SensorService( 1355): enable: calling mActiveSensors.add(handle, rec) = (0x0, 0x991fc8)
D/SensorService( 1355): enable: mActiveConnections.indexOf(connection) = 0x0
D/SensorService( 1355): pid=1355, uid=1000
D/AK8975 ( 1260): Compass Start
V/WindowManager( 1355): Starting animation in AppWindowToken{408c6f78 token=HistoryRecord{409ded10 com.htc.launcher/.Launcher}} # 27969582
V/WindowManager( 1355): Finished animation in AppWindowToken{408c6f78 token=HistoryRecord{409ded10 com.htc.launcher/.Launcher}} # 27969582
V/WindowManager( 1355): Starting animation in AppWindowToken{40e6f250 token=HistoryRecord{40a891d0 com.foursquare.android.sample/.MainActivity}} # 27969582
V/WindowManager( 1355): Finished animation in AppWindowToken{40e6f250 token=HistoryRecord{40a891d0 com.foursquare.android.sample/.MainActivity}} # 27969582
D/AK8975 ( 1260): Ignore M_Sensor: (y, p, r) = ( 139, 0, 3), Status = 0
D/ATRecorder(19226): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader#4053d0e0
D/WindowManagerImpl(19226): addView, new view, mViews[0]: com.android.internal.policy.impl.PhoneWindow$DecorView#40538ca8
D/WindowManagerImpl( 1355): finishRemoveViewLocked, mViews[1]: com.android.internal.policy.impl.PhoneWindow$DecorView#40d5af98
I/ActivityManager( 1355): Displayed com.foursquare.android.sample/.MainActivity: +210ms
V/ActivityManager( 1355): Checking to restart com.foursquare.android.sample.MainActivity: changed=0x0, handles=0x0
V/ActivityManager( 1355): oldConfig={ scale=1.0 imsi=250/1 loc=ru_RU touch=3 keys=1/1/2 nav=1/1 orien=1 layout=34 uiMode=17 seq=61 skin=default fontsize=3}
V/ActivityManager( 1355): newConfig={ scale=1.0 imsi=250/1 loc=ru_RU touch=3 keys=1/1/2 nav=1/1 orien=1 layout=34 uiMode=17 seq=61 skin=default fontsize=3}
D/lights ( 1355): [LedInfo] write attr ok name=/sys/class/leds/green/brightness string=0,len=1
V/NotificationService( 1355): Charging...
D/lights ( 1355): [LedInfo] write attr ok name=/sys/class/leds/green/blink string=0,len=1
D/lights ( 1355): [LedInfo] write attr ok name=/sys/class/leds/green/off_timer string=0 0,len=3
D/lights ( 1355): [LedInfo] write attr ok name=/sys/class/leds/amber/brightness string=1,len=1
D/lights ( 1355): [LedInfo] write attr ok name=/sys/class/leds/amber/blink string=0,len=1
D/lights ( 1355): [LedInfo] write attr ok name=/sys/class/leds/amber/off_timer string=0 0,len=3
V/NotificationService( 1355): Turn off Charm Ind LED
W/InputManagerService( 1355): [unbindCurrentClientLocked] Disable input method client.
W/InputManagerService( 1355): [startInputLocked] Enable input method client.
D/BatteryService( 1355): SendIntentforPowersaver
D/BatteryService( 1355): Current powersaver status == NORMAL_STATUS
D/WifiService( 1355): [smart wifi] mSmartWiFiStatus: 0 mBatteryLevel: 88 mWifiConnected: true
D/WifiService( 1355): [smart wifi] ACTION_BATTERY_CHANGED pluggedType: 2
D/StatusBarPolicy( 1507): plugged = true, health = 2, level = 88, mPluggedBatteryLevel = 87, mLowBatteryWarningLevel2 = 25, mshowLowChargingWarning2 = true
E/MyHTC ( 1643): [ImmediateModeProxyMgr] Failed to connect; wait some amount of time before trying again.
W/System.err( 1643): java.net.SocketTimeoutException: Connection timed out
W/System.err( 1643): at org.apache.harmony.luni.platform.OSNetworkSystem.connect(Native Method)
W/System.err( 1643): at dalvik.system.BlockGuard$WrappedNetworkSystem.connect(BlockGuard.java:357)
W/System.err( 1643): at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:207)
W/System.err( 1643): at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:440)
W/System.err( 1643): at java.net.Socket.connect(Socket.java:1013)
W/System.err( 1643): at com.htc.handsetlib.proxy.ImmediateModeProxy.connect(ImmediateModeProxy.java:195)
W/System.err( 1643): at com.htc.cs.service.ImmediateModeProxyMgr._connectToImcOrStatusServer(ImmediateModeProxyMgr.java:134)
W/System.err( 1643): at com.htc.cs.service.ImmediateModeProxyMgr.onIntent(ImmediateModeProxyMgr.java:198)
W/System.err( 1643): at com.htc.cs.service.ImmediateModeService$PushHandler.handleMessage(ImmediateModeService.java:708)
W/System.err( 1643): at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err( 1643): at android.os.Looper.loop(Looper.java:150)
W/System.err( 1643): at android.os.HandlerThread.run(HandlerThread.java:60)
D/MyHTC ( 1643): [ImmediateModeProxyMgr] _connectToImcOrStatusServer(): Fail IMC reconnect time = 172000
D/View (19226): onTouchEvent: viewFlags: 0x18004001
D/View (19226): onTouchEvent: isFocusable: true, isFocusableInTouchMode: false, isFocused: false; focusTaken: false
I/ActivityManager( 1355): Starting activity: Intent { act=android.intent.action.VIEW dat=foursquareauth://authorize?client_id=AP5RF0GZVCLPHHQ5HLHD5KQSYG03XIQUTKV1LXFCEQHPYMKS&v=20130509&androidKeyHash=60%3AA4%3AD9%3A06%3A0E%3AD2%3A27%3A56%3A00%3A57%3AF6%3A5D%3AE0%3AB7%3A65%3A39%3AC2%3AA9%3A64%3A34 cmp=com.joelapenna.foursquared/.OauthWebViewActivity } from pid 19226
E/ResourceType( 1355): Style contains key with bad entry: 0x01010397
E/ResourceType( 1355): Style contains key with bad entry: 0x0101039c
D/WindowManagerImpl( 1355): addView, new view, mViews[1]: com.android.internal.policy.impl.PhoneWindow$DecorView#40dce998
I/keystore( 1257): uid: 1000 action: e -> 7 state: 3 -> 3 retry: 4
I/ActivityManager( 1355): Start proc com.joelapenna.foursquared for activity com.joelapenna.foursquared/.OauthWebViewActivity: pid=19512 uid=10077 gids={3003, 1015}
V/WindowManager( 1355): Starting animation in AppWindowToken{40e6f250 token=HistoryRecord{40a891d0 com.foursquare.android.sample/.MainActivity}} # 27971452
V/WindowManager( 1355): Starting animation in AppWindowToken{40d58910 token=HistoryRecord{40b2cf48 com.joelapenna.foursquared/.OauthWebViewActivity}} # 27971452
V/WindowManager( 1355): Finished animation in AppWindowToken{40e6f250 token=HistoryRecord{40a891d0 com.foursquare.android.sample/.MainActivity}} # 27971464
V/WindowManager( 1355): Finished animation in AppWindowToken{40d58910 token=HistoryRecord{40b2cf48 com.joelapenna.foursquared/.OauthWebViewActivity}} # 27971464
D/dalvikvm(19512): GC_CONCURRENT freed 139K, 44% free 3202K/5639K, external 0K/0K, paused 3ms+2ms
D/dalvikvm(19512): GC_CONCURRENT freed 96K, 41% free 3529K/5959K, external 0K/0K, paused 2ms+2ms
I/dalvikvm(19512): Could not find method android.os.StrictMode$ThreadPolicy$Builder.detectCustomSlowCalls, referenced from method com.joelapenna.foursquared.Foursquared.d
W/dalvikvm(19512): VFY: unable to resolve virtual method 1630: Landroid/os/StrictMode$ThreadPolicy$Builder;.detectCustomSlowCalls ()Landroid/os/StrictMode$ThreadPolicy$Builder;
D/dalvikvm(19512): VFY: replacing opcode 0x6e at 0x0011
D/dalvikvm(19512): VFY: dead code 0x0014-003f in Lcom/joelapenna/foursquared/Foursquared;.d ()V
I/ActivityThread(19512): Pub com.joelapenna.foursquared: com.joelapenna.foursquared.providers.GlobalSearchProvider
I/ActivityThread(19512): Pub com.joelapenna.foursquared.db.ConversationsContentProvider: com.joelapenna.foursquared.db.ConversationsContentProvider
I/ActivityThread(19512): Pub com.joelapenna.foursquared.providers.VenueQuerySuggestionsProvider: com.joelapenna.foursquared.providers.VenueQuerySuggestionsProvider
I/ActivityThread(19512): Pub com.joelapenna.foursquared.providers.AppSearchSuggestionProvider: com.joelapenna.foursquared.providers.AppSearchSuggestionProvider
I/ActivityThread(19512): Pub com.joelapenna.foursquared.providers.foursquarebridgeprovider: com.joelapenna.foursquared.providers.FoursquareBridgeProvider
I/ActivityThread(19512): Pub com.joelapenna.foursquared.providers.FriendsSearchSuggestionProvider: com.joelapenna.foursquared.providers.FriendsSearchSuggestionProvider
I/keystore( 1257): uid: 1000 action: e -> 7 state: 3 -> 3 retry: 4
I/keystore( 1257): uid: 1000 action: e -> 7 state: 3 -> 3 retry: 4
I/keystore( 1257): uid: 1000 action: e -> 7 state: 3 -> 3 retry: 4
I/keystore( 1257): uid: 1000 action: e -> 7 state: 3 -> 3 retry: 4
I/keystore( 1257): uid: 1000 action: e -> 7 state: 3 -> 3 retry: 4
I/keystore( 1257): uid: 1000 action: e -> 7 state: 3 -> 3 retry: 4
I/dalvikvm(19512): Could not find method android.os.StrictMode$VmPolicy$Builder.detectLeakedClosableObjects, referenced from method com.foursquare.core.h.z.a
W/dalvikvm(19512): VFY: unable to resolve virtual method 1638: Landroid/os/StrictMode$VmPolicy$Builder;.detectLeakedClosableObjects ()Landroid/os/StrictMode$VmPolicy$Builder;
D/dalvikvm(19512): VFY: replacing opcode 0x6e at 0x0025
D/dalvikvm(19512): VFY: dead code 0x0028-0038 in Lcom/foursquare/core/h/z;.a ()V
follow this link:
https://developer.foursquare.com/overview/auth
it's much more informative and explains the process great.
by the way it would be greate if you could paste the exact error and give some more information about what you did....theres not enough info to help you.
Maybe you didn't set the INTERNET PERMISSION in the Android manifest:
<manifest xlmns:android...>
...
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
</manifest>

Categories

Resources