我写了一个节拍器,并在开发过程中使用KK手机进行测试。现在该应用程序似乎已经准备就绪,我在我的测试设备(从GB到MM)上获得的每个Android / CyanogenMod版本上都进行了测试。 该应用程序是可靠的,不能正常使用JB和更新,但在ICS和更老的表现和奇怪的行为(见belove)。由于Android是复古兼容的并且清单中的min-sdk = 9(而我的应用程序仅使用lvl API 1),我看起来很奇怪。
详细信息: 我有一个很大的启动/停止按钮来切换主循环。主循环产生" tics" (通过audioTrack)并在一个单独的任务中运行。主活动中使用一个标志来保持当前状态(已启动或已停止),以便您无法启动"两次或"停止"两次,只做开始/停止/开始/停止/等...周期。主循环,任务和AudioTrack相应地设置或取消设置。
问题:
如果我在ICS(及更早版本)中多次粉碎启动/停止,应用程序将关闭而不会 Toast The application Metronome as stopped unexpectidly etc...
。
这是对我来说不太重要的logcat:
<-- Application launched -->
I/ActivityManager( 247): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.arnaud.metronome/.Metronome bnds=[83,242][157,321] } from pid 347
D/dalvikvm( 247): GC_EXTERNAL_ALLOC freed 205K, 45% free 4761K/8583K, external 2482K/2497K, paused 50ms
I/ActivityManager( 247): Start proc com.arnaud.metronome for activity com.arnaud.metronome/.Metronome: pid=919 uid=10045 gids={}
D/szipinf ( 919): Initializing inflate state
D/dalvikvm( 919): GC_EXTERNAL_ALLOC freed 47K, 51% free 2685K/5379K, external 0K/0K, paused 28ms
W/System.err( 919): java.io.FileNotFoundException: /data/data/com.arnaud.metronome/files/structures (No such file or directory)
W/System.err( 919): at org.apache.harmony.luni.platform.OSFileSystem.open(Native Method)
W/System.err( 919): at dalvik.system.BlockGuard$WrappedFileSystem.open(BlockGuard.java:232)
W/System.err( 919): at java.io.FileInputStream.<init>(FileInputStream.java:80)
W/System.err( 919): at android.app.ContextImpl.openFileInput(ContextImpl.java:432)
W/System.err( 919): at android.content.ContextWrapper.openFileInput(ContextWrapper.java:152)
W/System.err( 919): at com.arnaud.metronome.StructureContainer.loadFromInternal(StructureContainer.java:201)
W/System.err( 919): at com.arnaud.metronome.Metronome.onCreate(Metronome.java:81)
W/System.err( 919): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
W/System.err( 919): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1722)
W/System.err( 919): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1784)
W/System.err( 919): at android.app.ActivityThread.access$1500(ActivityThread.java:123)
W/System.err( 919): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:939)
W/System.err( 919): at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err( 919): at android.os.Looper.loop(Looper.java:130)
W/System.err( 919): at android.app.ActivityThread.main(ActivityThread.java:3835)
W/System.err( 919): at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err( 919): at java.lang.reflect.Method.invoke(Method.java:507)
W/System.err( 919): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
W/System.err( 919): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
W/System.err( 919): at dalvik.system.NativeStart.main(Native Method)
W/InputMethodManager( 919): Ignoring onBind: cur seq=66, given seq=65
I/ActivityManager( 247): Displayed com.arnaud.metronome/.Metronome: +674ms
<-- Application fully launched. Commencing spamming the button -->
D/dalvikvm( 919): GC_FOR_MALLOC freed 243K, 50% free 2841K/5575K, external 162K/543K, paused 16ms
D/AudioHardwareMSM7X30( 175): value of device and enable is 6 1
D/AudioHardwareMSM7X30( 175): msm_route_stream(PCM_PLAY, 5, 15, 1)
D/AudioHardwareMSM7X30( 175): addToTable (dec_id 5, dev_rx 6, dev_tx 65535, type 1, active 1)
D/dalvikvm( 919): GC_CONCURRENT freed 270K, 49% free 3010K/5831K, external 162K/543K, paused 3ms+2ms
D/dalvikvm( 547): GC_EXPLICIT freed 6K, 47% free 3350K/6279K, external 2481K/3099K, paused 26ms
D/dalvikvm( 919): GC_CONCURRENT freed 472K, 51% free 2973K/6023K, external 162K/543K, paused 1ms+2ms
D/dalvikvm( 919): GC_CONCURRENT freed 434K, 51% free 2973K/6023K, external 162K/543K, paused 2ms+2ms
D/dalvikvm( 919): GC_CONCURRENT freed 434K, 51% free 2973K/6023K, external 162K/543K, paused 2ms+2ms
D/dalvikvm( 919): GC_CONCURRENT freed 434K, 51% free 2974K/6023K, external 162K/543K, paused 2ms+3ms
D/dalvikvm( 919): GC_CONCURRENT freed 434K, 51% free 2974K/6023K, external 162K/543K, paused 2ms+2ms
D/dalvikvm( 919): GC_CONCURRENT freed 434K, 51% free 2974K/6023K, external 162K/543K, paused 2ms+2ms
D/dalvikvm( 919): GC_CONCURRENT freed 348K, 50% free 3060K/6023K, external 162K/543K, paused 2ms+2ms
D/dalvikvm( 919): GC_FOR_MALLOC freed 434K, 53% free 2845K/6023K, external 162K/543K, paused 32ms
D/dalvikvm( 919): GC_CONCURRENT freed 173K, 49% free 3103K/6023K, external 158K/543K, paused 2ms+2ms
D/dalvikvm( 919): GC_FOR_MALLOC freed 433K, 53% free 2888K/6023K, external 162K/543K, paused 18ms
<-- Crash start here -->
I/DEBUG ( 914): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 914): Build fingerprint: 'SEMC/ST17i_1249-6227/ST17i:2.3.4/4.0.2.A.0.42/j_b_3w:user/release-keys'
I/DEBUG ( 914): pid: 919, tid: 932 >>> com.arnaud.metronome <<<
I/DEBUG ( 914): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 312e9000
I/DEBUG ( 914): r0 312e9000 r1 00000080 r2 00000000 r3 317f1a50
I/DEBUG ( 914): r4 312e9000 r5 312e9000 r6 00000000 r7 317f1a50
I/DEBUG ( 914): r8 6904cb94 r9 ffffff92 10 00000000 fp 000003e8
I/DEBUG ( 914): ip 690610bc sp 317f1a18 lr 6fd11724 pc 6fd113fc cpsr 200f0010
I/DEBUG ( 914): d0 643a64696f72646e d1 6472656767756265
I/DEBUG ( 914): d2 0000000000000000 d3 0000000000000000
I/DEBUG ( 914): d4 0000000000000000 d5 0000000000000000
I/DEBUG ( 914): d6 0000000000000000 d7 0000000000000000
I/DEBUG ( 914): d8 000000003b9aca00 d9 0000000000000000
I/DEBUG ( 914): d10 3fb8129d00000000 d11 0000000000000000
I/DEBUG ( 914): d12 0000000000000000 d13 0000000000000000
I/DEBUG ( 914): d14 0000000000000000 d15 0000000000000000
I/DEBUG ( 914): d16 0000000000000000 d17 3ff0000000000000
I/DEBUG ( 914): d18 3fc5555555555549 d19 bf4b3f057997ac2a
I/DEBUG ( 914): d20 3e707186c2887fc1 d21 be5ae5839fe26830
I/DEBUG ( 914): d22 bc5abb2580000000 d23 3de5d93a5acfd57c
I/DEBUG ( 914): d24 0000000000000000 d25 ffffffffffffffff
I/DEBUG ( 914): d26 0000000000000000 d27 ffffffffffffffff
I/DEBUG ( 914): d28 0100010001000100 d29 4049000000000000
I/DEBUG ( 914): d30 4049000000000000 d31 3ff0000000000000
I/DEBUG ( 914): scr 20000010
I/DEBUG ( 914):
I/DEBUG ( 914): #00 pc 000113fc /system/lib/libc.so (pthread_mutex_lock)
I/DEBUG ( 914): #01 pc 00011720 /system/lib/libc.so (__pthread_cond_timedwait_relative)
I/DEBUG ( 914): #02 pc 0002d7b8 /system/lib/libmedia.so
I/DEBUG ( 914):
I/DEBUG ( 914): code around pc:
I/DEBUG ( 914): 6fd113dc e3a02001 ebfffe82 e1a00005 e8bd87f0
I/DEBUG ( 914): 6fd113ec 00035fc4 e92d47f0 e2504000 0a000019
I/DEBUG ( 914): 6fd113fc e5946000 e5947000 e2166903 1a000017
I/DEBUG ( 914): 6fd1140c e5945000 e1a02004 e2055a02 e1a00005
I/DEBUG ( 914): 6fd1141c e3851001 ebffed67 e3500000 13856002
I/DEBUG ( 914):
I/DEBUG ( 914): code around lr:
I/DEBUG ( 914): 6fd11704 e1a03007 e1a02006 e2011001 e1a00004
I/DEBUG ( 914): 6fd11714 ebfffd9a e1a04000 e1a00005 ebffff32
I/DEBUG ( 914): 6fd11724 e374006e 03a0006e 13a00000 e8bd81f0
I/DEBUG ( 914): 6fd11734 e304cdd3 e3043240 e92d4010 e341c062
I/DEBUG ( 914): 6fd11744 e1a0e002 e24dd008 e340300f e1a0200d
I/DEBUG ( 914):
I/DEBUG ( 914): stack:
I/DEBUG ( 914): 317f19d8 00000000
I/DEBUG ( 914): 317f19dc 00000000
I/DEBUG ( 914): 317f19e0 00000000
I/DEBUG ( 914): 317f19e4 0000ee6b
I/DEBUG ( 914): 317f19e8 0000ee6b
I/DEBUG ( 914): 317f19ec 6fd0fe54 /system/lib/libc.so
I/DEBUG ( 914): 317f19f0 00000000
I/DEBUG ( 914): 317f19f4 00000000
I/DEBUG ( 914): 317f19f8 00000000
I/DEBUG ( 914): 317f19fc 00000000
I/DEBUG ( 914): 317f1a00 00000000
I/DEBUG ( 914): 317f1a04 3b9aca00
I/DEBUG ( 914): 317f1a08 00000000
I/DEBUG ( 914): 317f1a0c 3b9aca00
I/DEBUG ( 914): 317f1a10 00000000
I/DEBUG ( 914): 317f1a14 6904cb94 /system/lib/libmedia.so
I/DEBUG ( 914): #00 317f1a18 ffffff92
I/DEBUG ( 914): 317f1a1c 312e9000
I/DEBUG ( 914): 317f1a20 00000000
I/DEBUG ( 914): 317f1a24 317f1a50
I/DEBUG ( 914): 317f1a28 6904cb94 /system/lib/libmedia.so
I/DEBUG ( 914): 317f1a2c ffffff92
I/DEBUG ( 914): 317f1a30 00000000
I/DEBUG ( 914): 317f1a34 6fd11724 /system/lib/libc.so
I/DEBUG ( 914): #01 317f1a38 312e9000
I/DEBUG ( 914): 317f1a3c 312e9004
I/DEBUG ( 914): 317f1a40 317f1af0
I/DEBUG ( 914): 317f1a44 fffffffe
I/DEBUG ( 914): 317f1a48 6904cb94 /system/lib/libmedia.so
I/DEBUG ( 914): 317f1a4c 6902d7bb /system/lib/libmedia.so
D/dalvikvm( 919): GC_FOR_MALLOC freed 434K, 53% free 2888K/6023K, external 162K/543K, paused 31ms
D/dalvikvm( 919): GC_CONCURRENT freed 173K, 52% free 2931K/6023K, external 158K/543K, paused 2ms+12ms
I/BootReceiver( 247): Copying /data/tombstones/tombstone_00 to DropBox (SYSTEM_TOMBSTONE)
W/AudioTrack( 919): obtainBuffer timed out (is the CPU pegged?) 0x17c230 user=00010554, server=000079e0
I/DEBUG ( 914): debuggerd committing suicide to free the zombie!
I/DEBUG ( 944): debuggerd: Jun 15 2012 20:09:09
D/dalvikvm( 247): GC_FOR_MALLOC freed 533K, 43% free 4922K/8583K, external 870K/1382K, paused 33ms
I/WindowManager( 247): WIN DEATH: Window{2b270d18 com.arnaud.metronome/com.arnaud.metronome.Metronome paused=false}
I/ActivityManager( 247): Process com.arnaud.metronome (pid 919) has died.
D/Zygote ( 174): Process 919 terminated by signal (11)
<-- App is closed here, We are now back to the launcher -->
W/InputManagerService( 247): Got RemoteException sending setActive(false) notification to pid 919 uid 10045
D/AudioHardwareMSM7X30( 175): AudioStreamOutMSM72xx::standby()
D/AudioHardwareMSM7X30( 175): Deroute pcm out stream
D/AudioHardwareMSM7X30( 175): deleteFromTable, type 1
D/AudioHardwareMSM7X30( 175): updateDeviceInfo: E rx_device 6 and tx_device 11
D/AudioHardwareMSM7X30( 175): No active voicecall/playback, disabling cur_rx 6
D/AudioHardwareMSM7X30( 175): value of device and enable is 6 0
D/AudioHardwareMSM7X30( 175): No active voicecall/recording, disabling cur_tx 11
D/AudioHardwareMSM7X30( 175): value of device and enable is 11 0
D/AudioHardwareMSM7X30( 175): updateDeviceInfo: X cur_rx 6 cur_tx 11
我正在尝试订阅f-droid,如果有人想仔细看看,可以更新gitlab。