I must use reflection because i must reflect the view in my own system apk when LockPatternKerguardView.java in framework creates lock screen. I don't know why in eng mode the build system does not optimize my code but usr mode does? Thanks.
在 2013年1月3日星期四UTC+8下午11时05分12秒,bob写道: > > Well, you are calling the methods using Reflection. > > > So, Java doesn't know you are actually using them. > > > So, the Java compiler just optimizes those methods out. > > > Maybe you shouldn't use Reflection? > > > > On Thursday, January 3, 2013 2:57:44 AM UTC-6, futurexiong wrote: >> >> Product must be built in usr mode... >> >> 在 2013年1月2日星期三UTC+8下午10时30分41秒,bob写道: >>> >>> >>> >>> On Wednesday, January 2, 2013 2:46:23 AM UTC-6, futurexiong wrote: >>>> >>>> I modified createLockScreen method of LockPatternKeyguardView.java in >>>> framework,intend to change default LockScreen. In createLockScreen method >>>> I >>>> use reflection to new my own lockscreen view in my own lockscreen apk >>>> which >>>> would be installed in /system/app/. >>>> It works fine when i build the entire system with eng mode, >>>> >>> >>> >>> Sounds like you should build it with eng mode. >>> >>> >>> >>>> but not fine with usr mode.Log shows me that reflection find no such >>>> method in my own lockscreen view. I decompile the apk in each build >>>> mode,find out that apk build with usr mode does not have constructor,and >>>> some other method are lost either. >>>> Can anyone explain this weird situation for me? >>>> BTW,my apk share uid with android.uid.system and my Android.mk add this >>>> line:LOCAL_JAVA_LIBRARIES := android.policy framework because I need to >>>> use >>>> some internal apis of Keyguard. >>>> >>> -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

