[WIP][PORT] MIUI CAMERA for more devices


Jul 15, 2012
26
4
15
#1
Hi. I started porting the MIUICamera.apk (MIUIv5) to Samsung Galaxy S3 (AOSP based version of MIUIv5)...yes I know you're tempted to say it's not possible, but first let me tell you that someone (The Bownz user @xda) really made it for LG Nexus 4, so I reverse engineered his method and now I'm stuck with FC. Sadly he's not responding to pm's, so you're my last chance. There are some small framework modifications, adding and diffing from miui some smalis, Camera* tree, adding a library "libjni_mosaic.so" and of course adding the Camera.apk. So here's the log with the FC caused by a "number format exception":
Code:
09-03 22:47:13.219: E/AndroidRuntime(12956): FATAL EXCEPTION: Thread-185
09-03 22:47:13.219: E/AndroidRuntime(12956): java.lang.NumberFormatException: Invalid int: "null"
09-03 22:47:13.219: E/AndroidRuntime(12956): at java.lang.Integer.invalidInt(Integer.java:138)
09-03 22:47:13.219: E/AndroidRuntime(12956): at java.lang.Integer.parseInt(Integer.java:355)
09-03 22:47:13.219: E/AndroidRuntime(12956): at java.lang.Integer.parseInt(Integer.java:332)
09-03 22:47:13.219: E/AndroidRuntime(12956): atandroid.hardware.Camera$Parameters.getInt(Camera.java)
09-03 22:47:13.219: E/AndroidRuntime(12956):
at android.hardware.Camera$Parameters.getMaxSaturation(Camera.java)
09-03 22:47:13.219: E/AndroidRuntime(12956):
at com.android.camera.Camera.qcomUpdateCameraParametersPreference(Camera.java:2579)
09-03 22:47:13.219: E/AndroidRuntime(12956):
at com.android.camera.Camera.updateCameraParametersPreference(Camera.java:2831)
09-03 22:47:13.219: E/AndroidRuntime(12956):
at com.android.camera.Camera.setCameraParameters(Camera.java:2884)
09-03 22:47:13.219: E/AndroidRuntime(12956):
at com.android.camera.Camera.access$900(Camera.java:89)
09-03 22:47:13.219: E/AndroidRuntime(12956):
at com.android.camera.Camera$CameraStartUpThread.run(Camera.java:329)
09-03 22:47:13.219: W/ActivityManager(6504): Force finishing activity com.android.camera/.Camera
Full logcat: http://pastebin.com/dCfmudmf
What clues does this error give?
ps: I even managed to take a screenshot the second before FC.
 

Attachments

Jul 15, 2012
26
4
15
#3
Ok, that's where the work has been done, but what specifically in framework.jar? I'm interested in that "Invalid int" error, that I don't know what's about.
 
Nov 4, 2013
54
5
18
#7
Ok, that's where the work has been done, but what specifically in framework.jar? I'm interested in that "Invalid int" error, that I don't know what's about.
It's hard to say something about the CAUSE of the error without actually looking at the (smali) code. But at least, it's quite obvious that "null" is not a valid integer ;) Can't you find it in the android.hardware.Camera.Parameters class code? getMaxSaturation seems to return a null pointer (or, the string "null", not sure...), but is expected to return something getInt() can parse (whatever that would be, maybe a string representing a number? Got to check the code to find out).