[Q] How to fake a system intent? - Android Software/Hacking General [Developers Only]

Hi,
Is it possible to fake a system intent and broadcast a system event in a rooted device manually?
To be more precise, I want to make the phone believe that an headset is plugged in even while it's not plugged in.
I want to fire an action_headset_plug event manually and also set the state to 1.
Here's the intent am wanting to modify,
http://developer.android.com/reference/android/content/Intent.html#ACTION_HEADSET_PLUG
Anybody? Any ideas?

Under /sys/devices/virtual/switch/h2w and /sys/devices/virtual/switch/msm-h2w, I found a file called state which I believe could be the files storing the strings I want to change. I tried modifying the values but the system quickly reverts even if I set the files as read-only.

Did you ever figure out a solution to this problem?

lvnr00tddrd said:
Did you ever figure out a solution to this problem?
Click to expand...
Click to collapse
Nope.
https://play.google.com/store/apps/details?id=com.mikersmicros.fm&hl=en is a radio app that works without headset. Solved my original issue.

Find a solution?
Hey! I'm looking to do some sound recording on my HTC EVO and want to directly input an external microphone. Looking for an application that can manually fake a microphone-headset being inserted. Do you know if anythings available?
Thanks

Related

[Q] Ringtones Reassigning Themselves?

Trying to determine if this is a "just me" problem or a larger problem.
I have ringtones on my SD card that I moved onto my phone when I got the Atrix 2. I am able to successfully assign the 'new' ringtones for both the default and the individual contacts. I've already set it up as indicated in this thread (which I know is for the S2, but I presumed the concept should be the same).
However, I've found that at some point later (perhaps after a restart?), some (but not all) of the ringtones have changed, usually to songs on the SD card (not necessarily to other ringtones).
Is anyone else experiencing anything like this? It's not a huge deal, but it definitely throws me for a loop when say, my father calls, and it's not "his" ringtone playing on my phone.
Thanks for the feedback to anyone else who responds.
chicknlil said:
Trying to determine if this is a "just me" problem or a larger problem.
I have ringtones on my SD card that I moved onto my phone when I got the Atrix 2. I am able to successfully assign the 'new' ringtones for both the default and the individual contacts. I've already set it up as indicated in this thread (which I know is for the S2, but I presumed the concept should be the same).
However, I've found that at some point later (perhaps after a restart?), some (but not all) of the ringtones have changed, usually to songs on the SD card (not necessarily to other ringtones).
Is anyone else experiencing anything like this? It's not a huge deal, but it definitely throws me for a loop when say, my father calls, and it's not "his" ringtone playing on my phone.
Thanks for the feedback to anyone else who responds.
Click to expand...
Click to collapse
You should not have them on the phone storage, that is for apps and android only. All of your media (including ringtones) needs to stay on your SDcard, especially since the phone scans and rescans the SDcard on every boot, for things like that.
To make it work correctly for this phone, create a folder (directory) on your SDcard and call it ringtones (it must be on the root of the SDcard), that will make them show up as ringtones to select, the only time they will not work, is if you unmount the SDcard and put another one in, that does not have that layout with the files you selected as ringtones. Once you put the card back in and remount it, they should start to immediately work again.
Hi Jim:
So would the correct path for these files then be: /mnt/sd-card/media (and then either notifications/ringtones/audio?).... or /sd-card/media?
I swear that's how it was initially set up and the phone couldn't seem to find any ringtones, which is why I'd made the change as outlined above.
Thanks for your assistance.
chicknlil said:
Hi Jim:
So would the correct path for these files then be: /mnt/sd-card/media (and then either notifications/ringtones/audio?).... or /sd-card/media?
I swear that's how it was initially set up and the phone couldn't seem to find any ringtones, which is why I'd made the change as outlined above.
Thanks for your assistance.
Click to expand...
Click to collapse
No, the correct path is:
/sdcard/ringtones/
Your ringtone mp3 files go in there. I have never had an issue with that location on this phone, and a few other other phones that has worked flawlessly as well.
Jim
Sent from my MB865 using xda premium
chicknlil said:
Hi Jim:
So would the correct path for these files then be: /mnt/sd-card/media (and then either notifications/ringtones/audio?).... or /sd-card/media?
I swear that's how it was initially set up and the phone couldn't seem to find any ringtones, which is why I'd made the change as outlined above.
Thanks for your assistance.
Click to expand...
Click to collapse
No, the correct path is:
/sdcard/ringtones/
Your ringtone mp3 files go in there. I have never had an issue with that location on this phone, and a few other other phones that has worked flawlessly as well.
Jim
Sent from my MB865 using xda premium
Hi Jim:
I moved the files there using root explorer, used the app "sd rescan" to rescan the card again, and rebooted my phone.
The tones now appear twice each in my ringtones option and both appear to play (which would at least imply that they're both linked to valid files). However, I had set my alarm for this morning to wake me up with a ringtone, and was instead woken up to the noise the phone makes when you first turn it on and it's scanning the card. I've also noticed that again, my contacts have different ringtones.
I've noticed that the folder appears in two places (sd-card/ringtones, and then a mnt/sd-card/ringtones has a symblink of that) ... could that be my issue?
It's not just you. The phone has storage "issues" of all kinds.
Just curious do you have Zedge installed?
I do have Zedge installed, though I've never used it for Ringtones. I've also got RingDroid installed, which is how I made these into ringtones/notification tones in the first place.

ringtones changing to default after reboot

Just been having this issue lately where my custom ringtone and notifications change to the default after a reboot or after I connect micro usb to add files to the memory card. I cant seem to find a way to fix this. Just wondering if anyone has had this issue and how to fix it. Thanks in advance.
ak29 said:
Just been having this issue lately where my custom ringtone and notifications change to the default after a reboot or after I connect micro usb to add files to the memory card. I cant seem to find a way to fix this. Just wondering if anyone has had this issue and how to fix it. Thanks in advance.
Click to expand...
Click to collapse
Hi,
When you change a ringtone,do you click apply?
Exactly the same problem i also have no council. until now. with CoreDroid 2.6 i had it not, only with v2.7 and v3.0.
I have the exact same problem, I had some custom ringtones and suddenly for no reason started switching back to default. So I finally just did a factory reset now everything's back to normal.
Sent from my HTC Sensation 4G using XDA App
I may have found the issue with mine. I recently started using an app called headset droid. Once I uninstalled the app most of my issue is gone now. My ringtones and notifications no longer reset when I reboot. They do still reset if if I connect my phone via micro USB and add transfer things to my memory card. I will try resetting my phone and reflashing my rom next to see if that solves the problem completely.
Solution for rooted user but please help for non-rooted
To start off I do not have my phone rooted, although I am thinking about it lol.
My ringtones and notifications changed every time I restart my phone. What I have tried is to change the ringtones and notifications folder location. It basically started right after I received the T-Mobile update software number 1.50.531.1
sdcard(root)/notifications
sdcard(root)/ringtones
and
sdcard(root)/media/audio/notifications
sdcard(root)/media/audio/ringtones
all the above methods work in the sense that the phone recognized the ringtones but every time I restart the phone it changes the ringtone and notification back to defaults.
I have searched for a solution the closest thing I have found was located here: https://code.google.com/p/android/issues/detail?id=13413
The conclusion is to gain root access and move the ringtones and notification to the phone's internal system folder. Since I do not want to root my phone, is there a method to gain permission to move files to the system folder?
I really want to solve this problem so please let me know if there is a solution
Thanks from a noob
I fixed my issue by clearing the cache. I downloaded app called "app cache cleaner" than I cleared the rosie cache and boom it works woot
Anyone got an answer?
Is there an easy way to move ringtones/notification sounds to the phone memory without rooting?
xaccers said:
Anyone got an answer?
Is there an easy way to move ringtones/notification sounds to the phone memory without rooting?
Click to expand...
Click to collapse
Try adding your phone ringtone / notification sound this way
Settings-sound-phone ringtone-menu soft key-more ringtones-add ringtone
Then select the ringtone.
Also the similar way for notification sound..
This way you might not lose your custom ringtones when rebooted
sent from my blazing fast pyramid through sonic waves
ganeshp said:
Try adding your phone ringtone / notification sound this way
Settings-sound-phone ringtone-menu soft key-more ringtones-add ringtone
Then select the ringtone.
Also the similar way for notification sound..
This way you might not lose your custom ringtones when rebooted
sent from my blazing fast pyramid through sonic waves
Click to expand...
Click to collapse
That's how I assign them. I don't have the issue of losing them when rebooting, but I do have problems when I've connected my phone as a mass storage device as with the SD card unmounted (so it can be accessed by the PC) the phone can no longer see my ringtone/notification sounds.
Annoyingly downloading ringtones from HTC doesn't save them to the phone memory.
xaccers said:
That's how I assign them. I don't have the issue of losing them when rebooting, but I do have problems when I've connected my phone as a mass storage device as with the SD card unmounted (so it can be accessed by the PC) the phone can no longer see my ringtone/notification sounds.
Annoyingly downloading ringtones from HTC doesn't save them to the phone memory.
Click to expand...
Click to collapse
then you move it to memory...
move the required ringtones to /system/media/audio/ringtones
and similarly for notifications...use any file explorer...
ganeshp said:
then you move it to memory...
move the required ringtones to /system/media/audio/ringtones
and similarly for notifications...use any file explorer...
Click to expand...
Click to collapse
Anyway to do that without rooting?
xaccers said:
Anyway to do that without rooting?
Click to expand...
Click to collapse
without rooting...no not possible ...as you require /system partition as r/w which can be done only when rooted
ak29 said:
Just been having this issue lately where my custom ringtone and notifications change to the default after a reboot or after I connect micro usb to add files to the memory card. I cant seem to find a way to fix this. Just wondering if anyone has had this issue and how to fix it. Thanks in advance.
Click to expand...
Click to collapse
Hi, I had this issue after I installed Beats.
I found that the problem was linked to /system/app/com.htc.sdm.apk
This is a soundset profile which was defaulting tones.
I deleted this file, rebooted and all was fine!
Hope this helps
deano309 said:
Hi, I had this issue after I installed Beats.
I found that the problem was linked to /system/app/com.htc.sdm.apk
This is a soundset profile which was defaulting tones.
I deleted this file, rebooted and all was fine!
Hope this helps
Click to expand...
Click to collapse
Is that a solution which can be used without rooting?
I have tried to report this to HTC as a bug, but cannot find the details. There are many links on this and similar sites which all go to "Whoops we cannot find that site, please one of the below" [sic] and there is nothing below. When I tried to access support direction the only countries I could choose from were USA or Canada. Can anyone direct me to how to report this as a bug for a UK user? They shouldn't be requiring us to root just so that we don't have all our ringtones defaulted every time we connect the phone to a PC, that's about 20 times a day! Particularly important for me rather than just nigglingly annoying as I'm profoundly deaf in some frequencies, I literally cannot hear some of the ring tones, I need to input ones I can tell the phone is ringing!
It's not a HTC issue, it's a gingerbread/ics issue.
Although HTC could fix it I suppose by releasing an app that allows you to copy ringtones to the phone memory.
RoseRodent said:
Is that a solution which can be used without rooting?
Click to expand...
Click to collapse
No, it isn't!
Tell you what.... Just S-OFF & root your phone and install a custom ROM.
Otherwise, learn to live with the crappy software that HTC release and stop moaning about it.
Thanks
---------- Post added at 07:28 PM ---------- Previous post was at 07:16 PM ----------
xaccers said:
It's not a HTC issue, it's a gingerbread/ics issue.
Although HTC could fix it I suppose by releasing an app that allows you to copy ringtones to the phone memory.
Click to expand...
Click to collapse
I feel that I need to disagree.
If it was an OS issue then every ROM on every phone would suffer from the same problem.
This problem happens for various reasons on various ROMs.
HTC replace a lot of the AOSP programs with thier own and it's less than perfect and can cause this issue - they could release a patch but they are not always speedy on the releases!
I remember someone creating a Sound profile and then deleting it - which solved their problem?!
deano309 said:
I feel that I need to disagree.
If it was an OS issue then every ROM on every phone would suffer from the same problem.
This problem happens for various reasons on various ROMs.
HTC replace a lot of the AOSP programs with thier own and it's less than perfect and can cause this issue - they could release a patch but they are not always speedy on the releases!
I remember someone creating a Sound profile and then deleting it - which solved their problem?!
Click to expand...
Click to collapse
The Galaxy Nexus also suffers from resetting ringtones etc when the SD card has been unmounted, there's a bug report a mile long with Google about it.
There should be an easy fix, ie two sound config files, one for when the SD card is present and the other for when it's not, or the set as ringtone/notification function could copy the file to the internal memory.
Why load a flakey unfinished ROM when O2 provide one that fast and trouble free?
I was hoping there'd be a way of accessing the internal memory from a PC via developer tools.
xaccers said:
The Galaxy Nexus also suffers from resetting ringtones etc when the SD card has been unmounted, there's a bug report a mile long with Google about it.
There should be an easy fix, ie two sound config files, one for when the SD card is present and the other for when it's not, or the set as ringtone/notification function could copy the file to the internal memory.
Why load a flakey unfinished ROM when O2 provide one that fast and trouble free?
I was hoping there'd be a way of accessing the internal memory from a PC via developer tools.
Click to expand...
Click to collapse
As I stated - "Various ROMs" - BUT NOT ALL - So it can't be the fault of the base AOSP but rather modifications done by Manufacurers or Providers (3 is the worst for customising)!
Not all ROMs are flakey or unfurnished and you have the options to customise them a lot more to your own personal style - Most providers add bloatware which slows the device down which a lot of people don't want (The only settings I need are for my APN)!
You can access internal memory via adb - but modifying it requires you to be rooted.
There is a fallback ringtone found within framework-res.apk which the device will use if it can't find any tones at all but no different configs for SD in/out (Nice idea though!) but copying to the internal memory would still require root!
This is where I benefit from a custom rom - If I don't like one then I choose another, or I patch the problem! (Or, more often then not, I just make my own)
Try setting up a custom sound set, what rom and mods do you have
Sent from my HTC Sensation XE with Beats Audio using xda premium
deano309 said:
As I stated - "Various ROMs" - BUT NOT ALL - So it can't be the fault of the base AOSP but rather modifications done by Manufacurers or Providers (3 is the worst for customising)!
Not all ROMs are flakey or unfurnished and you have the options to customise them a lot more to your own personal style - Most providers add bloatware which slows the device down which a lot of people don't want (The only settings I need are for my APN)!
You can access internal memory via adb - but modifying it requires you to be rooted.
There is a fallback ringtone found within framework-res.apk which the device will use if it can't find any tones at all but no different configs for SD in/out (Nice idea though!) but copying to the internal memory would still require root!
This is where I benefit from a custom rom - If I don't like one then I choose another, or I patch the problem! (Or, more often then not, I just make my own)
Click to expand...
Click to collapse
Thing is, with O2 they don't add bloat and I'm happy with their ROM, it's fast (ICS seems much faster than GB) and stable, which I guess we're lucky in that
I've set up a new sound set and tomorrow I'll be adding vids to watch on the train into London so will see how it goes.
Interesting though how it affects a Nexus device which I always thought was bare bones Android.

[Q] Ringtone jumps back to Horizon after reboot

Hi all,
The ringtone settings of my wife Node Edge is jumping back to "Over the Horizon" after every reboot or after an incoming call.
I tried to change it to one of the other default ringtones of Samsung, but after a reboot the ringtone is set back to "Over the Horizon".
I also tried using a custom ringtone without any luck.
I removed the SD card, change the ringtone ... also without any luck
Can anyone help me to fix this issue without a factory reset?
Btw. I have the same phone and I don't have any problem with changing the ringtone on my Note Edge
Specs
Samsung Note Edge
OS 4.4.4
Your help is really appreciated
Added:
- I do not have any Root rights
bentrovati said:
Hi all,
The ringtone settings of my wife Node Edge is jumping back to "Over the Horizon" after every reboot or after an incoming call.
I tried to change it to one of the other default ringtones of Samsung, but after a reboot the ringtone is set back to "Over the Horizon".
I also tried using a custom ringtone without any luck.
I removed the SD card, change the ringtone ... also without any luck
Can anyone help me to fix this issue without a factory reset?
Btw. I have the same phone and I don't have any problem with changing the ringtone on my Note Edge
Specs
Samsung Note Edge
OS 4.4.4
Your help is really appreciated
Click to expand...
Click to collapse
This WILL require root so it won't work for AT&T or Verizon variants. Anyone reading this now, PLEASE remember to state your carrier when posting. This is a general Note Edge Q&A and the amount of help we can provide is EXTREMELY limited without knowing your model in many cases.
Take any files you want as a ringtone and put it in /sdcard/media/audio/ringtones. Create the folder if it doesn't exist. Then go to /system/media/audio/ringtones and rename it to /system/media/audio/ringtones.bak. Reboot. It shouldn't be able to find ANY of the stock ringtones anymore so it should default to user ringtones in /sdcard/. If you don't have a good file explorer yet, get ES file explorer from the play store.
Thanks for your suggestion, but I have no root rights.
Is There another way to solve this issue???
bentrovati said:
Thanks for your suggestion, but I have no root rights.
Is There another way to solve this issue???
Click to expand...
Click to collapse
To be honest, I had no idea if that was a solution at all; just a hopeful and partially educated guess. Is rooting not an option at all? What carrier is the phone on?
I can't think of anything concrete, but some apps have been known to interfere in the past. Can you provide a list of anything installed since buying the phone?
jooniloh said:
To be honest, I had no idea if that was a solution at all; just a hopeful and partially educated guess. Is rooting not an option at all? What carrier is the phone on?
I can't think of anything concrete, but some apps have been known to interfere in the past. Can you provide a list of anything installed since buying the phone?
Click to expand...
Click to collapse
The carrier is Vodafone (Netherlands).
She only have games apps and the google apps you can download. There is no app installed that can control sounds or other system apps.

Charging notification sounds

Hi
I don't care for the charging sounds when the phone is connected / disconnected from the charger and setting silent to get around it is a pain.
I've had a look at all over the /system partition for where these sounds are located and can't find them.
Several forums mention they should be in system/media/audio but after listening to every single file I can't find them.
Does anyone know where they are located?
Thanks
Phils7 said:
Hi
I don't care for the charging sounds when the phone is connected / disconnected from the charger and setting silent to get around it is a pain.
I've had a look at all over the /system partition for where these sounds are located and can't find them.
Several forums mention they should be in system/media/audio but after listening to every single file I can't find them.
Does anyone know where they are located?
Thanks
Click to expand...
Click to collapse
They are located here my friend: \system\priv-app\MiuiSystemUI.apk\raw
Yes, indeed they are there, in the .apk file, but how to remove or replace with blank or render them useless?
Should the phone be rooted for the process, or there is a simpler workaround?

Media storage got crazy on my old Android 6 Lenovo phone

I don't know what has happened to my old Lenovo Vibe X on Android 6.01 and how to resolve the issue without wiping data (no guarantee it would help - I'm now thinking...).
The phone is temporarily at my relative's disposal: i've switched to her Google account to let her use my old phone. She complained the call ring was very weak. I decided to change the ringtone, but I found out that I cannot do it anymore, the Media/Audio/Ringtones folder with standard OGG files is not visible (I cannot select ringtones from there anymore). "Other ringtones" option directs me to some installed Audio player, which does not allow to select any MP3 files in ANY folder (they cannot be played, because the player reports they are not added to Media storage). When I try to use "Scan media" option - it is just stuck. I've tried to use another programs like SD scanner, they either report Media database read error or finally report success status, however the audio files are still not playable.
I've tried to: clear caches (Android and Dalvik), disable / enable Media system app and delete its data.
I've also noticed that NOW my USB Audio player reports that HiRes DAC is not found (!) and does not want to play files in HiRes mode (through the chip instead of generic driver) - actually, my phone does have ES9018 DAC...
I am not sure this problem is related to Media storage, however all this together is very weird.
Any thoughts what could happen and what should I do?
How long was she using it and how good are her Android skills? May have caught a rootkit or virus. Anything below Android 9 is vulnerable to the Xhelper type rootkits that can worm their way out of the user partition. Real nasty critters...
If it just went nuts, I highly suspect malware especially in the hands of a novice user.
Nafiganado said:
(...) what should I do?
Click to expand...
Click to collapse
As @blackhawk wrote, the user may have infected the phone.
The only solution is to flash the phone manufacturer's stock ROM.
I will try to do this as soon as I get a chance, nowadays there is no other smartphone to use for my relative, so have to wait a couple of days.
BTW - regarding "HiRes DAC is not found" message... is there a chance that guys who replaced the battery in this smartphone soldered out ES9018 chip??
Nafiganado said:
I will try to do this as soon as I get a chance, nowadays there is no other smartphone to use for my relative, so have to wait a couple of days.
BTW - regarding "HiRes DAC is not found" message... is there a chance that guys who replaced the battery in this smartphone soldered out ES9018 chip??
Click to expand...
Click to collapse
Likely a software, firmware or settings issue. Malware could also be the root cause for losing the high resolution DAC.
It's possible the tech damaged this circuit but probably not likely. Obviously if it was working before they got their paws on it then they are likely to blame.

Categories

Resources