Patching phone app to use the other microphone? - Moto X Q&A

Hi all, (and hi moderators, apologies if this should not be the correct place),
as my ghost currently can't be used as a phone, I am now thinking of trying to fix the problem in software. Apps like RecForge work just fine with the *second* microphone, so I'd like to compile LineageOS myself after changing the dialer to use that. So far I've been clicking around the LineageOS repositories on GitHub, unfortunately without much luck. Just judging by file names, these two files looked promising:
https://github.com/LineageOS/androi...src/com/android/dialer/DialerApplication.java
https://github.com/LineageOS/androi...4.1/src/com/android/phone/CallController.java
I am, however, not even sure if these are the correct repositories to be looking at. Could someone nudge me into the right direction?
Cheers,
Jonathan

Edit: the second file was indeed not a bad place to look in!
Code:
if (!(Intent.ACTION_CALL.equals(action)
|| Intent.ACTION_CALL_EMERGENCY.equals(action)
|| Intent.ACTION_CALL_PRIVILEGED.equals(action))) {
Log.wtf(TAG, "placeCall: unexpected intent action " + action);
throw new IllegalArgumentException("Unexpected action: " + action);
}
(https://github.com/LineageOS/androi...m/android/phone/CallController.java#L222-L227)
Unfortunately, now I'm stumped. Cloning the android_packages_services_Telephony repository and grepping for things like ACTION_CALL doesn't get me any closer to what device is opened to access the microphone. Where do I go from here? By the way, "Log.wtf" - how cool is that?

Related

WM5 BA Wiki is Gone!!!!!!!!

Does anyone know if the Wiki is undergoing maintenance? Cause if that is not the case, then the same boso that is messing with the FTP has just found a way to play with the site's wiki.
I do not know how, but this idiot has to be stopped.
Look, is it not about time that these things were locked down? Make the FTP site have an upload directory for us serfs and give the ROM "regulars" accounts for their own directories on the server. These regs/mods can move the popular uploads into safer locations.
And make the wiki require an account to edit. There will always be assholes trying to mess things up for everyone. People have been dealing with this problem for decades now and there are many solutions.
EDIT: I take that back, it looks like a template error or something on the wiki. I had an attempt at fixing the page, but you can't even get a single line of text to appear with all the content removed. I canceled my edit. Here's the error:
lib/InlineParser.php (In template 'editpage') (In template 'body') (In template 'html'):146: Warning[2]: preg_match(): No ending delimiter '/' found
lib/InlineParser.php (In template 'editpage') (In template 'body') (In template 'html'):146: Warning[2]: preg_match(): No ending delimiter '/' found
Click to expand...
Click to collapse
http://forum.xda-developers.com/viewtopic.php?t=54069
http://forum.xda-developers.com/viewtopic.php?t=54033

[REQ] XML builder for Raph

Hi all
I was wondering how many people here would like to have some sort of way to build an xml which upon completion of a ROM update (which for some us are only day's apart) would change a load of settings to what we want for them
this is just a concept at the moment and i would like to work with someone or the community as a whole to produce a program to do this
the concept i have is as follows:
a simple windows exe Window which has inside it drop down menu's for all of the settings possible (cleartype/text size/regional settings/time zone/notification settings) fields (username for email/password/server addresses/screen name)
and if possible, something to allow us to drag and drop CAB file's into a window which would then also package up the cab's into a folder and spit out/generate the relevant SDCONFIG.txt file
is this at all possible? is there much interest in this?
I can go through and try to find as many of the settings possible and attempt to perhaps find the relevant registry settings even
i would really like to get the ball rolling with this, im sure it could work really well, not only on the raphael, but also on other devices perhaps
please post any interest on this project/concept here and i would really like to do something about this, im about to go and figure out the best way to even code this, however my coding knowledge is about zilch.lol!
.PROVXML files are the ideal place for last minute configuration changes. I'm just starting to explore this avenue and I've found tremendous flexibility in what one can change.
Have a look at the following information ... right from the source
Provisioning Using a ROM Configuration XML File
http://msdn.microsoft.com/en-us/library/bb737254.aspx
Configuration Service Provider Reference for Windows Mobile-Based Devices
http://msdn.microsoft.com/en-us/library/ms889539.aspx
There's also some excellent thread on XDA ... you'll have to do a bit of searching for them.
HTH,
have you looked at oemizer?
Assume this is the one you mean: http://tiermann.net
... takes the fun out of doing this the "manual way"
Cheers,
I don't use it personally. I came across it when I was learning with my M3100 (Hermes) and it provided a few useful insights at the time when I disected what it had created. I found a few problems and don't use it, but it seems like a similar attempt to what the OP is trying to achieve.
many thanks for the replies
im just looking into the oemizer that was posted and see how that works, however, i get the impression that its for rom cooking
Hi duke_stix,
That's where it's often used ... although, I have come across some posts about utilities that can re-initiate Provision XML files already present on the device or new ones placed on an SD card.
*EDIT* - Some examples
DotFred's Task Manager: http://www.dotfred.net/TaskMgr.htm
HTCustom: http://shadowmite.com/forum/viewtopic.php?f=28&t=2231&p=7890#p7890
Cheers,
I have not seen anything that does exactly what you suggest, but things to look at that are maybe related include
Sashimi
tier-autoinstall (or something like that)
They run the files but don't create them.
You can always just export the reg values and then import them after you flash...
or use a reg to xml program to add it to SDConfig
I'm working on a new app right now that might have the potential to cover what you're asking for, but the exact features necessary to pull off at least a part of it won't be available in the first release. Keep an eye out on the D&H forum in anywhere from a week to two weeks when I post it up there.

[DEV] First step of reserve engineering libcamera (Work in progress)

Hi all,
I'm working on reserve engineering libcamera for Tattoo, based on libcamera2 by NCommander. Thanks to nopy for many help.
HTC have changed a lot in their kernel, and left LOTS of useless or temporary codes not to be cleaned up. Right now, camera codes in the kernel are very clean and tidy and mainly ported from AOSP-donut kernel. Interfaces of /dev/msm_camera/control0, config0, and frame0 are successfully generated. As you know, HTC kernel implemented the /dev/msm_camera/msm_camera0 interface to communicate with requests from user space. I'm not sure why HTC did such a hack. The reason why I ported camera codes from AOSP-donut relies on the fact that most of camera working ROMs for other headsets like Dream or Sapphire did this, even if these ROMs are powered by 2.6.32 or even 2.6.34 kernels.
I've sticked to HTC camera driver in the kernel. Please check out my github.
Here is the explanation of the relationship between libcamera, libqcamera and the kernel, written by NCommander.
This is my first step to reserver engineering work on libcamera. Camera does NOT work yet.
The current logcat and klogtail have been attached here, Donut version as well. Thanks to MrGland, salva.tejero, and kicmi.
If anyone is interested in hacking for Tattoo, just let know. I'll invite you to cooperate with us.
Regards,
do you want try my kernel?
it have a problem with wifi...but the camera and media driver are correctly loaded...
if u want i can send it via pm
i have fix the GL problem on my rom...i haven't a tatto...but if u want i can see again the problem with your rom.
i'm just thinkg to restart my rom from zero. I have already downloaded the froyo source and i'm starting to compile the source and add my personal kernel...
said me if u want collaborate to made a new 2.2 rom
W/dalvikvm( 613): threadid=10: thread exiting with uncaught exception (group=0x400207d8)
I am by no means a c++ expert, but I started learning it last week. A uncaught exception needs catching so that the whole thread does not terminate, you can deal with them using catch(), unless it is a hardware exception
I think you two have the best chance of making a working froyo rom if you work together based on using your roms. I use fyodors 1.6 rom daily
I believe this too.
I prefer fyodor's rom though cause with his roms I never had problems on booting. Ikxdf' s roms from the other side don't boot on my device(except abusu 2.01 and capcake 1.01)
you two (ikxdf,cn.fyodor) are supermans make a team mix up your files and your skills, make a great panfyodorcake ROM and we, tattoo users will be so happy Good Luck
E: omg sry kiljacken and HCDR.Jacob ale supermans too
cn.fyodor said:
I've dived into the source files, and found there was a __NULL__ "config_defaults" array of structure in egl.cpp file. This array was used in eglChooseConfig function, which is heavily related with my issue. I'm not sure what the codes did since not familiar with C++ programming. I've googled a lot, but no luck.
I need C++ experts to read the opengl codes in Froyo system and find the reason why 'No configs match configSpec' error comes up. Thanks in advance.
Regards,
Click to expand...
Click to collapse
If you send me that file or gives me the path to it in the Android source code I'll gladly take a look at it...
If you send me that file or gives me the path to it in the Android source code I'll gladly take a look at it...
Click to expand...
Click to collapse
Same here...
ikxdf said:
do you want try my kernel?
it have a problem with wifi...but the camera and media driver are correctly loaded...
if u want i can send it via pm
i have fix the GL problem on my rom...i haven't a tatto...but if u want i can see again the problem with your rom.
i'm just thinkg to restart my rom from zero. I have already downloaded the froyo source and i'm starting to compile the source and add my personal kernel...
said me if u want collaborate to made a new 2.2 rom
Click to expand...
Click to collapse
Hi, ikxdf
Glad to see you in this dev thread. My kernel can drive the camera correctly, but I haven't verified it yet. Feel free to send yours to me, I'll test it to check whether it works or not.
speedyracer5 said:
W/dalvikvm( 613): threadid=10: thread exiting with uncaught exception (group=0x400207d8)
I am by no means a c++ expert, but I started learning it last week. A uncaught exception needs catching so that the whole thread does not terminate, you can deal with them using catch(), unless it is a hardware exception
Click to expand...
Click to collapse
Thanks for the info. If it's a hardware exception, there must be some bugs in my customized kernel. However, to be honest, I really don't know how to debug the C++ codes.
kiljacken said:
If you send me that file or gives me the path to it in the Android source code I'll gladly take a look at it...
Click to expand...
Click to collapse
Thanks. The top path is frameworks/base/opengl. This exception error was thrown by the ./java/android/opengl/GLSurfaceView.java and the eglChooseConfig function is defined in ./libagl/egl.cpp. Hope you find something useful to debug it.
My greetings,
are the best in the tattoo improving.
Thanks to all the people who try to improve the tattoo...
let´s go friends
cn.fyodor said:
Hi, ikxdf
Glad to see you in this dev thread. My kernel can drive the camera correctly, but I haven't verified it yet. Feel free to send yours to me, I'll test it to check whether it works or not.
Thanks for the info. If it's a hardware exception, there must be some bugs in my customized kernel. However, to be honest, I really don't know how to debug the C++ codes.
Thanks. The top path is frameworks/base/opengl. This exception error was thrown by the ./java/android/opengl/GLSurfaceView.java and the eglChooseConfig function is defined in ./libagl/egl.cpp. Hope you find something useful to debug it.
Click to expand...
Click to collapse
I've looked much at the files and i have fund that the error you get is caused when an app gives some info about a configuration and EGL can't find a config that matches that information...
Does this error happen in the camera app??
cn.fyodor said:
Hi, ikxdf
Glad to see you in this dev thread. My kernel can drive the camera correctly, but I haven't verified it yet. Feel free to send yours to me, I'll test it to check whether it works or not.
Thanks for the info. If it's a hardware exception, there must be some bugs in my customized kernel. However, to be honest, I really don't know how to debug the C++ codes.
Thanks. The top path is frameworks/base/opengl. This exception error was thrown by the ./java/android/opengl/GLSurfaceView.java and the eglChooseConfig function is defined in ./libagl/egl.cpp. Hope you find something useful to debug it.
Click to expand...
Click to collapse
The Exception has been thrown from JAVA because num_config[0] has not been populated by eglChooseConfig. This output parameter it's populated at the last line of eglChooseConfig.
I don't know the architecture of android and egl stuff, what i can reccomend to you is to use the LOGE macro to write in console the list of attibute (attrib_list parameter) and try to see in which point the function returns (using LOGE macro opportunely).
From what i can understand, this function tries to match the list of attributes passed as parameter(attrib_list) with global array of configurations (gConfigs), which contains 8 configurations (every configuration is an array of attributes).
Java makes 2 calls to eglChooseConfig, the first is to retrieve the number of configurations that matches the attribute list, if this number is >0 create an empty array and re-call eglChooseConfig to get the array itself populated, otherwise throws the exception you have showed in your log.
ivendor said:
The Exception has been thrown from JAVA because num_config[0] has not been populated by eglChooseConfig. This output parameter it's populated at the last line of eglChooseConfig.
I don't know the architecture of android and egl stuff, what i can reccomend to you is to use the LOGE macro to write in console the list of attibute (attrib_list parameter) and try to see in which point the function returns (using LOGE macro opportunely).
From what i can understand, this function tries to match the list of attributes passed as parameter(attrib_list) with global array of configurations (gConfigs), which contains 8 configurations (every configuration is an array of attributes).
Java makes 2 calls to eglChooseConfig, the first is to retrieve the number of configurations that matches the attribute list, if this number is >0 create an empty array and re-call eglChooseConfig to get the array itself populated, otherwise throws the exception you have showed in your log.
Click to expand...
Click to collapse
I think you're right...
I think it would be important for all of us, to have a rom 100 % funcional 2.1 or 2.2 without the camera, and before fix the camera...i think
If you make a team i havent doubt could be able to make it real
thanks for all
capito djjkd said:
I think it would be important for all of us, to have a rom 100 % funcional 2.1 or 2.2 without the camera, and before fix the camera...i think
If you make a team i havent doubt could be able to make it real
thanks for all
Click to expand...
Click to collapse
why?
because the devs maybe could stop developing, because they are satisfied of the working camera?
i don't think so. if they could get the camera working, there isn't a long way anymore to a 100% functional 2.1/2.2 ROM.
I hope this comes true, good luck to the devs!!!!!!
ivendor said:
The Exception has been thrown from JAVA because num_config[0] has not been populated by eglChooseConfig. This output parameter it's populated at the last line of eglChooseConfig.
I don't know the architecture of android and egl stuff, what i can reccomend to you is to use the LOGE macro to write in console the list of attibute (attrib_list parameter) and try to see in which point the function returns (using LOGE macro opportunely).
From what i can understand, this function tries to match the list of attributes passed as parameter(attrib_list) with global array of configurations (gConfigs), which contains 8 configurations (every configuration is an array of attributes).
Java makes 2 calls to eglChooseConfig, the first is to retrieve the number of configurations that matches the attribute list, if this number is >0 create an empty array and re-call eglChooseConfig to get the array itself populated, otherwise throws the exception you have showed in your log.
Click to expand...
Click to collapse
I commented out the setEGLConfigChooser() stmt. in Camera/src/*/ui/GLRootView.java source file to use the GLES default config for camera. Although the 'no config match...' exception didn't come up, camera didn't snapshot any images as if the sensor didn't open. Check out the attachment below.
If the setEGLConfigChooser stmt. was added, in eglChooseConfig function, both possibleMatch and num_config will be 0. I'm trying to find the low-level reason.
The setEGLConfigChooser() in Camera/src/*/ui/GLRootView.java source file is defined:
public void
setEGLConfigChooser (int redSize,
int greenSize, int blueSize, int alphaSize, int depthSize, int stencilSize).
All we want (i think) is the correct values for the parameters. Ok at page
http://brandnewreality.com/blog/android-egl-querying-your-gl-driver
there is a java program to query from a donut tattoo the configs....
Now we can correct the parameters at setEGLConfigChooser function.
I hope that this helps us...
seg
segway_ said:
The setEGLConfigChooser() in Camera/src/*/ui/GLRootView.java source file is defined:
public void
setEGLConfigChooser (int redSize,
int greenSize, int blueSize, int alphaSize, int depthSize, int stencilSize).
All we want (i think) is the correct values for the parameters. Ok at page
http://brandnewreality.com/blog/android-egl-querying-your-gl-driver
there is a java program to query from a donut tattoo the configs....
Now we can correct the parameters at setEGLConfigChooser function.
I hope that this helps us...
seg
Click to expand...
Click to collapse
Wont this method you are proposing hard coding the values?Shouldnt these be set by the user?There must be another class with the default values and which saves the user defined values.
Look at the code:
http://android.git.kernel.org/?p=pl...0f823229da7569a51367f20c0c9d048d1cba;hb=froyo
175 private void initialize() {
176 mFlags |= FLAG_INITIALIZED;
177 setEGLConfigChooser(8, 8, 8, 8, 0, 4);
178 getHolder().setFormat(PixelFormat.TRANSLUCENT);
179 setZOrderOnTop(true);
Click to expand...
Click to collapse
Is it hard coded?
seg
Well the values are hard coded.. but at the look of it I guess the hardware need these hard coded values to initialise. Good point seg.

Native Debian on i9000?

Hello and good day, dear XDA Developers forum members!
I have been struggling with this problem for some time and have tried to resolve it myself, but have failed miserably. Anyway, I have installed Linux Deploy from Play Store, an excellent application which automates installation of many Linux distributions on your phone made by a guy called meefik. Everything worked fine. Of course, Linux image file size was automatically calculated by the application so it took quite a lot of free space on my internal SD card. It later proved to be actually reasonable as the desktop environment and everything I installed quite filled those two gigs Linux Deploy allocated. Not quite important for this issue, but... whatever. The real problem I have encountered is the problem of digitizer input. Controlling my phone using x2x through SSH is good enough to eventually resolve some smaller problems or play Dink Smallwood (or freedink, to be exact) just for fun, but it's not quite doable and useful outdoors with no desktop or laptop nearby, so I would like to make Debian somehow recognize digitizer input. Framebuffer output without Android (it is killed by ctl.stop, I guess) and VNC assistance works pretty fine (no HW acceleration, of course, but good enough), just if there is a way to make Debian capture digitizer input, at least in a touchpad-esque way, as I still haven't bought any Bluetooth gear. I tried setting evdev as the driver to recognize digitizer input and /dev/input/event0 as the input device's path in xorg.conf, but no luck. Chroot has access to main Android file system. When cat'ing /dev/input/event0 in terminal it gives output when I tap or swipe on the digitizer, so the actual problem lies in the fact that Linux actually doesn't know to interpret informations that digitizer is sending.
Any ideas? Suggestions? If anything else, do not hesitate to let me know if I made a mistake of some kind (grammar or terminology for example) in my post.
Hooray! Digitizer input finally recognized in Debian! After chatting with pabs* on irc.debian.org I found out that evdev requires ABS_X and ABS_Y coordinates in order to move the cursor successfully around the screen, but as i9000 has a multi-touch digitizer, it sends only ABS_MT_POSITION_X and ABS_MT_POSITION_Y positions** for each finger (as well as an ID for each of them and some other relevant details). Means that evdev isn't quite useful for this purpose. We have a multi-touch digitizer and thus we need a multi-touch driver that will properly interpret our digitizer's input. After browsing through packages in synaptic, I found two seemingly appropriate multi-touch drivers, mtrack and multitouch. As mtrack is a fork of multitouch that (supposedly) brings some improvements when compared to the forkee*** I've chosen to install and set it as the input driver in xorg.conf instead of multitouch. I didn't regret, everything works perfectly! Of course, it still isn't as finger-friendly as Maemo or Android are because it works in touchpad mode, but it's quite a good beginning!
Here's the xorg.conf file (XDA didn't allow me to upload a .conf file as it's an, erm, invalid file) if anyone wants to try this on his i9000!
Code:
Section "ServerLayout"
Identifier "Layout0"
Screen "Screen0"
InputDevice "touchscreen" "CorePointer"
EndSection
Section "InputDevice"
Identifier "touchscreen"
Option "Device" "/dev/input/event0"
Driver "mtrack"
EndSection
Section "Device"
Identifier "Card0"
Driver "fbdev"
Option "fbdev" "/dev/graphics/fb0"
#Option "Rotate" "CW"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Card0"
DefaultDepth 24
SubSection "Display"
Depth 24
EndSubSection
EndSection
* Who is also the author of this post, quite useful (post, not poster :laugh.
** In order to be properly recognized as a multi-touch input device by Android. ABS_X and ABS_Y are provided only if a single-touch digitizer is installed, see here
*** The one being forked, in this case multitouch. According to Google, it's a valid word, well, kind of.
P.S. I've attached a screenshot of current setup if anyone's wondering how it looks.
P.P.S. Cursor moves awkwardly when Xorg is in landscape mode (as if X and Y axes were swapped) so I commented out the Option "Rotate" "CW" line.
Progress: one step forward, two steps back
Help needed! As I might have mentioned in previous posts, cursor moves weirdly (moving finger to the left moves cursor up, moving to the right moves down, etc.) in landscape mode (i.e. with Option "Rotate" "CW" line under "Device" section uncommented), so I would like to know if there is there any way to swap X and Y axes? There have been some efforts to make X and Y finger coordinates swapped in this thread, but, unfortunately, with no actual result, because mtrack ignores the Rotate and SwapAxes options as if they were not valid for mtrack or just not implemented yet. Of course, I would prefer to have the option of absolute mouse movement (in the manner of what tslib provides) instead of having digitizer input recognized in a touchpad way, but it seems that there is something that should be modified in tslib's source code in order to make it work.
Also, I've tried to install Hildon by wget'ing Squeeze armel .deb packages and installing them through dpkg until all the dependencies were satisfied, but it still seems like there is some more missing packages that ought to be installed... so if you guys have tried installing Hildon on your Android device (not necessarily i9000) please reply here. All suggestions are welcome.
P.S. Feel free to let me know if this thread might be more appropriate in some other (sub)forum.
moorkai said:
P.S. Feel free to let me know if this thread might be more appropriate in some other (sub)forum.
Click to expand...
Click to collapse
yup, it would get better attention here and here
Check this out!You , YES! you are an " Android ". Not your phone but U.
You Must watch this documentary concerning your privacy Terms & Conditions we had agreed to, by using a PC or Smartphone
How to say Thank you? If you find any post helpful on XDA, please click on the Thanks button
If you are using XDA App or Tapatalk, long press on the post and select :good: Thanks Its easier to give "Feedback" in this manner than make an additional post.​
Yeah, it could, but over here (at least I believe) I'm dealing with issues that occur only on i9000 and similar boards. After all, Android Software and Hacking General forum seems like it's more appropriate for finalized works done by people who absolutely (or at least mostly) know what they're doing, not that thingy I'm messing with, and on the other hand, Android General is flooded by various posts mostly related to flashing problems and doubts, interesting offers and similar stuff, so my thread doesn't actually fit in neither of these forums. That thing I'm messing with is an odd duck. I'm trying to address issues that are tightly related with i9000 as well as problems more related to Android-Debian communication through chroot (it's not my primary problem at the moment, but I should look into it someday too), and reincarnating Maemo through chrooted Debian through Hildon Desktop too, but I don't consider myself experienced enough to post in any of the above mentioned categories.
So, to summarize, I don't know. Feel free to convince me if you think I'm wrong.
P.S. It's my 60th post, hooray!

[Q] [Problem] How to list parameters in

It's quite a simple one I hope. Also, apologies for adding noise to the forum, but I couldn't find any detailed documentation or many tutorials.
I'm making use of findAndHookMethod for a little test project of mine. The problem is, the method which I am hooking has custom classes in its parameters.
Obviously I don't have access to these classes in terms of having the source code imported, so my first thought was just to list the paramaters as Object.class, but this didn't work.
What (if any) are the solutions? Thanks!
P.S.
In case I worded it badly. Say I have method to be hooked...
public void methodThatDoesSomething(ThisCustomClass nameOfParameter)
How do I use findAndHookMethod when listing parameters, as ThisCustomClass.class is not within the scope of my project
Use a string with the class' full name, e.g. "com.hooked.package.ThisCustomClass".

Categories

Resources