[MOD]Enable/Disable Media Scanning at boot

Search This thread

broodplank1337

Inactive Recognized Developer
Nov 24, 2011
4,992
10,155
Nijmegen
www.broodplank.net
I've been browing the forums for some helpfull stuff and I found this little mod that allows you to turn Media Scanning on Boot on or off. The original topic by aditya_t90 can be found here

Requirements:
- USB Debugging: ON
- Root Access

Enter one of the following commands in terminal emulator, adb shell or in a script file

To enable media scanning on boot:
Code:
su
pm enable com.android.providers.media/com.android.providers.media.MediaScannerReceiver

To disable media scanning on boot:
Code:
su
pm disable com.android.providers.media/com.android.providers.media.MediaScannerReceiver

Screenshot:
cygwin-medscan.jpg
 

rayiskon

Senior Member
Jan 9, 2011
2,124
1,257
it says in the link :
The new v2.3 app works on all android devices!! It even works with internal and external sd cards!
so isn't it easier to install the app, u might not be near a pc when u need to change it :)
edit: actually u can use a terminal emulator ..ahhh
 
Last edited:

nikagl

Senior Member
Jun 11, 2006
2,856
614
49
Nieuwegein, NL
Thanks!!

If you prefer automated batch files like I do, download attached :)

Code:
@echo off
adb -d shell pm disable com.android.providers.media/com.android.providers.media.MediaScannerReceiver

echo all ok? 
pause

Code:
@echo off
adb -d shell pm enable com.android.providers.media/com.android.providers.media.MediaScannerReceiver

echo all ok? 
pause

Regards,

Nika.
 

Attachments

  • EnableDisable-mediascanning.zip
    491 bytes · Views: 1,413

broodplank1337

Inactive Recognized Developer
Nov 24, 2011
4,992
10,155
Nijmegen
www.broodplank.net
Thanks!!

If you prefer automated batch files like I do, download attached :)

Code:
@echo off
adb -d shell pm disable com.android.providers.media/com.android.providers.media.MediaScannerReceiver

echo all ok? 
pause

Code:
@echo off
adb -d shell pm enable com.android.providers.media/com.android.providers.media.MediaScannerReceiver

echo all ok? 
pause

Regards,

Nika.
Nice addition :) and thnx for posting this in your topic
 

pyronia

Senior Member
Oct 11, 2011
1,520
193
Puchong
So, when scanning not active after boot...when does it scan the files? Sorry noob.... :D

|BroodRom RC2 Beta :D
|Instanet Free Access (no one believe its free)
 

pyronia

Senior Member
Oct 11, 2011
1,520
193
Puchong
Thanks!!

If you prefer automated batch files like I do, download attached :)

Code:
@echo off
adb -d shell pm disable com.android.providers.media/com.android.providers.media.MediaScannerReceiver

echo all ok? 
pause

Code:
@echo off
adb -d shell pm enable com.android.providers.media/com.android.providers.media.MediaScannerReceiver

echo all ok? 
pause

Regards,

Nika.

The zip attach flash it via recovery? How to undo it?

EDIT: i see 2 script in the zip, enable n disable...how to get it working???

|:BroodRom RC2 Beta :D
|:Instanet Free Access (no one believe its free)
 
Last edited:

pyronia

Senior Member
Oct 11, 2011
1,520
193
Puchong
After unplugging an USB cable

I mean, after it working, avery boot it will not scan media right? Do i have to plug-unplug usb to get it scan the media? Averytime? Coz i actually charge my phone when it off at night....

Actually, what is this tweak for? Please answer me, really noob bout this...

|:BroodRom RC2 Beta :D
|:Instanet Free Access (no one believe its free)
 
Last edited:

nikagl

Senior Member
Jun 11, 2006
2,856
614
49
Nieuwegein, NL
The zip attach flash it via recovery? How to undo it?

EDIT: i see 2 script in the zip, enable n disable...how to get it working???

|:BroodRom RC2 Beta :D
|:Instanet Free Access (no one believe its free)

Sorry, those scripts can be executed from the DOS command line. I guess they can be created for CWM too, but I am not too familiar with those scripts ;) you can try attached, no idea whether it works (I'm sure broodplank will correct me if I'm wrong) :D
 

Attachments

  • Disable-mediascanning.zip
    153.7 KB · Views: 489
  • Enable-mediascanning.zip
    153.7 KB · Views: 367
  • Like
Reactions: snoopydunk

pyronia

Senior Member
Oct 11, 2011
1,520
193
Puchong
Sorry, those scripts can be executed from the DOS command line. I guess they can be created for CWM too, but I am not too familiar with those scripts ;) you can try attached, no idea whether it works (I'm sure broodplank will correct me if I'm wrong) :D

What does the tweak for actually?



|Post from XDA premium app
|BroodRom RC2 Beta :D
|Instanet Free Access (no one believe its free)
 

nikagl

Senior Member
Jun 11, 2006
2,856
614
49
Nieuwegein, NL
What does the tweak for actually?



|Post from XDA premium app
|BroodRom RC2 Beta :D
|Instanet Free Access (no one believe its free)

It enables or disables media scanning of your sdcards at boot (see in your top bar when the device starts) :D

---------- Post added at 10:19 AM ---------- Previous post was at 10:09 AM ----------

Check out this video:
http://www.youtube.com/watch?v=fNhJ1DxKolE

It's for another device, but does demonstrate what this does (at around 1 minute) :D
 

pyronia

Senior Member
Oct 11, 2011
1,520
193
Puchong
Can u ise terminal emulator for this???



|Post from XDA premium app
|BroodRom RC2 Beta :D
|Instanet Free Access (no one believe its free)
 

pyronia

Senior Member
Oct 11, 2011
1,520
193
Puchong
Ok done try it, after disable my gallery was empty...have to enable it....

Hmm...if rom have this, do need to enable it averytime?



|Post from XDA premium app
|BroodRom RC2 Beta :D
|Instanet Free Access (no one believe its free)
 

Droid843

Senior Member
Oct 1, 2012
58
34
brood, I need your help... again!
You know... I got this music-gallery /emmc bug (cannot find music, pictures with music apps/gallery apps)
I made a long research, found out that the media scanner doesn't scan on boot. maybe the reason for this bug...
if I try to scan manually, the media scanner just scan the internal sd card.
maybe there is some build.prop tweak that disables the media scanner on emmc.
any suggestions?

tried to set media scanner on boot with this code and terminal emulator... doesn't work at all....
 

DreamerTKM

Senior Member
Jun 20, 2012
852
780
Georgetown
brood, I need your help... again!
You know... I got this music-gallery /emmc bug (cannot find music, pictures with music apps/gallery apps)
I made a long research, found out that the media scanner doesn't scan on boot. maybe the reason for this bug...
if I try to scan manually, the media scanner just scan the internal sd card.
maybe there is some build.prop tweak that disables the media scanner on emmc.
any suggestions?

tried to set media scanner on boot with this code and terminal emulator... doesn't work at all....

hmmm...emmc? which ROM are you using? Old CM9 build?
 

vetefan

Senior Member
Mar 21, 2011
89
12
Is it possible to place this script in init.d? Since the media are empty after every reboot, I want to enable it during boot and disable after scan.
 

sagirfahmid3

Senior Member
Jul 20, 2013
209
30
I made a simple shell script to enable/disable media scanning. I am a noob, so please don't hate :p

Code:
#!/system/bin/sh

echo ""
echo "<Usage: mediascanner <onboot|offboot>"
echo ""

case "$1" in
'onboot')
echo "Media scanner will be started on boot"
pm enable com.android.providers.media/com.android.providers.media.MediaScannerReceiver
;;

'offboot')
echo "Media scanner will not be started on boot"
pm disable com.android.providers.media/com.android.providers.media.MediaScannerReceiver
;;

esac

A shell file is attached if you want to be lazy. Rename it to mediascanner.sh (or just mediascanner) then push it to /system/bin/ and chmod 655 it. When you want to run it, do: su > mediascanner onboot|offboot (choose one). Ex: # mediascanner offboot

Hope that helps!
@Rehab4Life it does work on 4.4 KitKat :D
 

Attachments

  • mediascanner.txt
    396 bytes · Views: 143

Top Liked Posts

  • There are no posts matching your filters.
  • 13
    I've been browing the forums for some helpfull stuff and I found this little mod that allows you to turn Media Scanning on Boot on or off. The original topic by aditya_t90 can be found here

    Requirements:
    - USB Debugging: ON
    - Root Access

    Enter one of the following commands in terminal emulator, adb shell or in a script file

    To enable media scanning on boot:
    Code:
    su
    pm enable com.android.providers.media/com.android.providers.media.MediaScannerReceiver

    To disable media scanning on boot:
    Code:
    su
    pm disable com.android.providers.media/com.android.providers.media.MediaScannerReceiver

    Screenshot:
    cygwin-medscan.jpg
    3
    Thanks!!

    If you prefer automated batch files like I do, download attached :)

    Code:
    @echo off
    adb -d shell pm disable com.android.providers.media/com.android.providers.media.MediaScannerReceiver
    
    echo all ok? 
    pause

    Code:
    @echo off
    adb -d shell pm enable com.android.providers.media/com.android.providers.media.MediaScannerReceiver
    
    echo all ok? 
    pause

    Regards,

    Nika.
    1
    The zip attach flash it via recovery? How to undo it?

    EDIT: i see 2 script in the zip, enable n disable...how to get it working???

    |:BroodRom RC2 Beta :D
    |:Instanet Free Access (no one believe its free)

    Sorry, those scripts can be executed from the DOS command line. I guess they can be created for CWM too, but I am not too familiar with those scripts ;) you can try attached, no idea whether it works (I'm sure broodplank will correct me if I'm wrong) :D