[How-To] Potential Media Scanner Fix for XXLSJ-MS1/XWLS8-LSD-LSE-LSJ

Search This thread

shoman94

Recognized Contributor
Mar 27, 2009
8,926
12,322
Maine
As you all know a lot of people have a media scanner wakelock. It's a well known issue across all Google JB Phones. Google has implemented a fix for 4.2 which seems to fix it but there are still things that should be done by users.
Googles FIX: https://android.googlesource.com/platform/frameworks/base/+/8ab2dc2f9680307febe997631c2148729f714e3d

Seems the issue stems from corrupt thumbnail or other files. Also the issue is expanded by SQL Wildcard such as underscore [ _ ] in the file name.

Also note that .nomedia in the folders don't seem to work anymore as posted by Koushik Dutta (Koush) CWM: https://plus.google.com/u/0/103583939320326217147/posts/Ntgmq2oniA5

So while looking at the fix it seems that the CM team has implemented Google's fix in there source here: http://review.cyanogenmod.org/#/c/27862/

So we decide to try this in our ROM and it seems from my test users with the issue that it has fixed it so we want to share what needs to be changed so you can mod your ROM yourself or Devs to add this to their ROM.

First up is to Decompile Framework.jar

Go to:
\framework\smali\android\media\MediaScanner.smali

and find:
Code:
.method makeEntryFor(Ljava/lang/String;)Landroid/media/MediaScanner$FileEntry;

Replace the whole method with this:
Code:
.method makeEntryFor(Ljava/lang/String;)Landroid/media/MediaScanner$FileEntry;
    .locals 14
    .parameter "path"

    .prologue
    .line 1470
    const/4 v12, 0x0

    .line 1472
    .local v12, c:Landroid/database/Cursor;
    :try_start_0
    const-string v0, "_"

    invoke-virtual {p1, v0}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v0

    if-nez v0, :cond_0

    const-string v0, "%"

    invoke-virtual {p1, v0}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_4

    :cond_0
    const/4 v13, 0x1

    .line 1474
    .local v13, hasWildCards:Z
    :goto_0
    if-nez v13, :cond_1

    iget-boolean v0, p0, Landroid/media/MediaScanner;->mCaseInsensitivePaths:Z

    if-nez v0, :cond_5

    .line 1479
    :cond_1
    const-string v3, "_data=?"

    .line 1480
    .local v3, where:Ljava/lang/String;
    const/4 v0, 0x1

    new-array v4, v0, [Ljava/lang/String;

    const/4 v0, 0x0

    aput-object p1, v4, v0

    .line 1487
    .local v4, selectionArgs:[Ljava/lang/String;
    :goto_1
    iget-object v0, p0, Landroid/media/MediaScanner;->mMediaProvider:Landroid/content/IContentProvider;

    iget-object v1, p0, Landroid/media/MediaScanner;->mFilesUri:Landroid/net/Uri;

    sget-object v2, Landroid/media/MediaScanner;->FILES_PRESCAN_PROJECTION:[Ljava/lang/String;

    const/4 v5, 0x0

    const/4 v6, 0x0

    invoke-interface/range {v0 .. v6}, Landroid/content/IContentProvider;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Landroid/os/ICancellationSignal;)Landroid/database/Cursor;

    move-result-object v12

    .line 1489
    invoke-interface {v12}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v0

    if-nez v0, :cond_2

    if-eqz v13, :cond_2

    iget-boolean v0, p0, Landroid/media/MediaScanner;->mCaseInsensitivePaths:Z

    if-eqz v0, :cond_2

    .line 1494
    const-string v3, "_data LIKE ?1 AND lower(_data)=lower(?1)"

    .line 1495
    const/4 v0, 0x1

    new-array v4, v0, [Ljava/lang/String;

    .end local v4           #selectionArgs:[Ljava/lang/String;
    const/4 v0, 0x0

    aput-object p1, v4, v0

    .line 1496
    .restart local v4       #selectionArgs:[Ljava/lang/String;
    invoke-interface {v12}, Landroid/database/Cursor;->close()V

    .line 1497
    iget-object v0, p0, Landroid/media/MediaScanner;->mMediaProvider:Landroid/content/IContentProvider;

    iget-object v1, p0, Landroid/media/MediaScanner;->mFilesUri:Landroid/net/Uri;

    sget-object v2, Landroid/media/MediaScanner;->FILES_PRESCAN_PROJECTION:[Ljava/lang/String;

    const/4 v5, 0x0

    const/4 v6, 0x0

    invoke-interface/range {v0 .. v6}, Landroid/content/IContentProvider;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Landroid/os/ICancellationSignal;)Landroid/database/Cursor;

    move-result-object v12

    .line 1502
    :cond_2
    invoke-interface {v12}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v0

    if-eqz v0, :cond_8

    .line 1503
    const/4 v0, 0x0

    invoke-interface {v12, v0}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v6

    .line 1504
    .local v6, rowId:J
    const/4 v0, 0x2

    invoke-interface {v12, v0}, Landroid/database/Cursor;->getInt(I)I

    move-result v11

    .line 1505
    .local v11, format:I
    const/4 v0, 0x3

    invoke-interface {v12, v0}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v9

    .line 1506
    .local v9, lastModified:J
    new-instance v5, Landroid/media/MediaScanner$FileEntry;

    move-object v8, p1

    invoke-direct/range {v5 .. v11}, Landroid/media/MediaScanner$FileEntry;-><init>(JLjava/lang/String;JI)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 1510
    if-eqz v12, :cond_3

    .line 1511
    invoke-interface {v12}, Landroid/database/Cursor;->close()V

    .line 1514
    .end local v3           #where:Ljava/lang/String;
    .end local v4           #selectionArgs:[Ljava/lang/String;
    .end local v6           #rowId:J
    .end local v9           #lastModified:J
    .end local v11           #format:I
    .end local v13           #hasWildCards:Z
    :cond_3
    :goto_2
    return-object v5

    .line 1472
    :cond_4
    const/4 v13, 0x0

    goto :goto_0

    .line 1484
    .restart local v13       #hasWildCards:Z
    :cond_5
    :try_start_1
    const-string v3, "_data LIKE ?1 AND lower(_data)=lower(?1)"

    .line 1485
    .restart local v3       #where:Ljava/lang/String;
    const/4 v0, 0x1

    new-array v4, v0, [Ljava/lang/String;

    const/4 v0, 0x0

    aput-object p1, v4, v0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0
    .catch Landroid/os/RemoteException; {:try_start_1 .. :try_end_1} :catch_0

    .restart local v4       #selectionArgs:[Ljava/lang/String;
    goto :goto_1

    .line 1510
    .end local v3           #where:Ljava/lang/String;
    .end local v4           #selectionArgs:[Ljava/lang/String;
    .end local v13           #hasWildCards:Z
    :catchall_0
    move-exception v0

    if-eqz v12, :cond_6

    .line 1511
    invoke-interface {v12}, Landroid/database/Cursor;->close()V

    .line 1510
    :cond_6
    throw v0

    .line 1508
    :catch_0
    move-exception v0

    .line 1510
    if-eqz v12, :cond_7

    .line 1511
    :goto_3
    invoke-interface {v12}, Landroid/database/Cursor;->close()V

    .line 1514
    :cond_7
    const/4 v5, 0x0

    goto :goto_2

    .line 1510
    .restart local v3       #where:Ljava/lang/String;
    .restart local v4       #selectionArgs:[Ljava/lang/String;
    .restart local v13       #hasWildCards:Z
    :cond_8
    if-eqz v12, :cond_7

    goto :goto_3
.end method

Recompile and you're good to go.

Hope this helps.

Thanks to:
jeboo
Google
cyanogenmod
 
Last edited:

maanz "L"

Senior Member
Sep 12, 2010
1,048
779
singapore
Samsung Galaxy Note 10+
First up is to Decompile Framework.jar

Go to:


and find:
Code:
.method makeEntryFor(Ljava/lang/String;)Landroid/media/MediaScanner$FileEntry;

Replace the whole method with this:
Code:
.method makeEntryFor(Ljava/lang/String;)Landroid/media/MediaScanner$FileEntry;
    .locals 14
    .parameter "path"

    .prologue
    .line 1470
    const/4 v12, 0x0

    .line 1472
    .local v12, c:Landroid/database/Cursor;
    :try_start_0
    const-string v0, "_"

    invoke-virtual {p1, v0}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v0

    if-nez v0, :cond_0

    const-string v0, "%"

    invoke-virtual {p1, v0}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_4

    :cond_0
    const/4 v13, 0x1

    .line 1474
    .local v13, hasWildCards:Z
    :goto_0
    if-nez v13, :cond_1

    iget-boolean v0, p0, Landroid/media/MediaScanner;->mCaseInsensitivePaths:Z

    if-nez v0, :cond_5

    .line 1479
    :cond_1
    const-string v3, "_data=?"

    .line 1480
    .local v3, where:Ljava/lang/String;
    const/4 v0, 0x1

    new-array v4, v0, [Ljava/lang/String;

    const/4 v0, 0x0

    aput-object p1, v4, v0

    .line 1487
    .local v4, selectionArgs:[Ljava/lang/String;
    :goto_1
    iget-object v0, p0, Landroid/media/MediaScanner;->mMediaProvider:Landroid/content/IContentProvider;

    iget-object v1, p0, Landroid/media/MediaScanner;->mFilesUri:Landroid/net/Uri;

    sget-object v2, Landroid/media/MediaScanner;->FILES_PRESCAN_PROJECTION:[Ljava/lang/String;

    const/4 v5, 0x0

    const/4 v6, 0x0

    invoke-interface/range {v0 .. v6}, Landroid/content/IContentProvider;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Landroid/os/ICancellationSignal;)Landroid/database/Cursor;

    move-result-object v12

    .line 1489
    invoke-interface {v12}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v0

    if-nez v0, :cond_2

    if-eqz v13, :cond_2

    iget-boolean v0, p0, Landroid/media/MediaScanner;->mCaseInsensitivePaths:Z

    if-eqz v0, :cond_2

    .line 1494
    const-string v3, "_data LIKE ?1 AND lower(_data)=lower(?1)"

    .line 1495
    const/4 v0, 0x1

    new-array v4, v0, [Ljava/lang/String;

    .end local v4           #selectionArgs:[Ljava/lang/String;
    const/4 v0, 0x0

    aput-object p1, v4, v0

    .line 1496
    .restart local v4       #selectionArgs:[Ljava/lang/String;
    invoke-interface {v12}, Landroid/database/Cursor;->close()V

    .line 1497
    iget-object v0, p0, Landroid/media/MediaScanner;->mMediaProvider:Landroid/content/IContentProvider;

    iget-object v1, p0, Landroid/media/MediaScanner;->mFilesUri:Landroid/net/Uri;

    sget-object v2, Landroid/media/MediaScanner;->FILES_PRESCAN_PROJECTION:[Ljava/lang/String;

    const/4 v5, 0x0

    const/4 v6, 0x0

    invoke-interface/range {v0 .. v6}, Landroid/content/IContentProvider;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Landroid/os/ICancellationSignal;)Landroid/database/Cursor;

    move-result-object v12

    .line 1502
    :cond_2
    invoke-interface {v12}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v0

    if-eqz v0, :cond_8

    .line 1503
    const/4 v0, 0x0

    invoke-interface {v12, v0}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v6

    .line 1504
    .local v6, rowId:J
    const/4 v0, 0x2

    invoke-interface {v12, v0}, Landroid/database/Cursor;->getInt(I)I

    move-result v11

    .line 1505
    .local v11, format:I
    const/4 v0, 0x3

    invoke-interface {v12, v0}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v9

    .line 1506
    .local v9, lastModified:J
    new-instance v5, Landroid/media/MediaScanner$FileEntry;

    move-object v8, p1

    invoke-direct/range {v5 .. v11}, Landroid/media/MediaScanner$FileEntry;-><init>(JLjava/lang/String;JI)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 1510
    if-eqz v12, :cond_3

    .line 1511
    invoke-interface {v12}, Landroid/database/Cursor;->close()V

    .line 1514
    .end local v3           #where:Ljava/lang/String;
    .end local v4           #selectionArgs:[Ljava/lang/String;
    .end local v6           #rowId:J
    .end local v9           #lastModified:J
    .end local v11           #format:I
    .end local v13           #hasWildCards:Z
    :cond_3
    :goto_2
    return-object v5

    .line 1472
    :cond_4
    const/4 v13, 0x0

    goto :goto_0

    .line 1484
    .restart local v13       #hasWildCards:Z
    :cond_5
    :try_start_1
    const-string v3, "_data LIKE ?1 AND lower(_data)=lower(?1)"

    .line 1485
    .restart local v3       #where:Ljava/lang/String;
    const/4 v0, 0x1

    new-array v4, v0, [Ljava/lang/String;

    const/4 v0, 0x0

    aput-object p1, v4, v0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0
    .catch Landroid/os/RemoteException; {:try_start_1 .. :try_end_1} :catch_0

    .restart local v4       #selectionArgs:[Ljava/lang/String;
    goto :goto_1

    .line 1510
    .end local v3           #where:Ljava/lang/String;
    .end local v4           #selectionArgs:[Ljava/lang/String;
    .end local v13           #hasWildCards:Z
    :catchall_0
    move-exception v0

    if-eqz v12, :cond_6

    .line 1511
    invoke-interface {v12}, Landroid/database/Cursor;->close()V

    .line 1510
    :cond_6
    throw v0

    .line 1508
    :catch_0
    move-exception v0

    .line 1510
    if-eqz v12, :cond_7

    .line 1511
    :goto_3
    invoke-interface {v12}, Landroid/database/Cursor;->close()V

    .line 1514
    :cond_7
    const/4 v5, 0x0

    goto :goto_2

    .line 1510
    .restart local v3       #where:Ljava/lang/String;
    .restart local v4       #selectionArgs:[Ljava/lang/String;
    .restart local v13       #hasWildCards:Z
    :cond_8
    if-eqz v12, :cond_7

    goto :goto_3
.end method

Recompile and Your good to go.

Hope this helps.

will try to implement this on my project.;) thanks Sir..
 

Mr.Greg

Senior Member
Sep 19, 2010
6,566
5,062
Folks, I tried this method, but when recompile I have a Warning:could not find resources:confused: but building was successful. Anyone know?
 
Last edited:
  • Like
Reactions: Marin0803

Mr.Greg

Senior Member
Sep 19, 2010
6,566
5,062
Ok, seem like after modify code in framework.jar, after reboot photos and picture in gallery loading slowly then before, but this it's not a problem. I'll test today and see how is. Thanks guys for tip.
 

BSDgeek_Jake

Senior Member
Oct 2, 2012
1,003
8,021
DEL
As you all know a lot of people have a media scanner wakelock. It's a well known issue across all Google JB Phones. Google has implemented a fix for 4.2 which seems to fix it but there are still things that should be done by users.
Googles FIX: https://android.googlesource.com/platform/frameworks/base/+/8ab2dc2f9680307febe997631c2148729f714e3d

Seems the issue stems from corrupt thumbnail or other files. Also the issue is expanded by SQL Wildcard such as underscore [ _ ] in the file name.

Also note that .nomedia in the folders don't seem to work anymore as posted by Koushik Dutta (Koush) CWM: https://plus.google.com/u/0/103583939320326217147/posts/Ntgmq2oniA5

So while looking at the fix it seems that the CM team has implemented Google's fix in there source here: http://review.cyanogenmod.org/#/c/27862/

So we decide to try this in our ROM and it seems from my test users with the issue that it has fixed it so we want to share what needs to be changed so you can mod your ROM yourself or Devs to add this to their ROM.

First up is to Decompile Framework.jar

CODE .......... CODE

Recompile and you're good to go.

Hope this helps.

Recompiled on XXLSJ but not working. Got SOOO many FCs...
 
Last edited:

Mr.Greg

Senior Member
Sep 19, 2010
6,566
5,062
Ok guys. After compiled framework.jar with this code, no media scanning issue. Did a test;rebooted phone and checked battery in settings, seems like media scanning running 7-10 min then stops. After a few hours checked again and no media scanning. Great:fingers-crossed:
 

Top Liked Posts

  • There are no posts matching your filters.
  • 67
    As you all know a lot of people have a media scanner wakelock. It's a well known issue across all Google JB Phones. Google has implemented a fix for 4.2 which seems to fix it but there are still things that should be done by users.
    Googles FIX: https://android.googlesource.com/platform/frameworks/base/+/8ab2dc2f9680307febe997631c2148729f714e3d

    Seems the issue stems from corrupt thumbnail or other files. Also the issue is expanded by SQL Wildcard such as underscore [ _ ] in the file name.

    Also note that .nomedia in the folders don't seem to work anymore as posted by Koushik Dutta (Koush) CWM: https://plus.google.com/u/0/103583939320326217147/posts/Ntgmq2oniA5

    So while looking at the fix it seems that the CM team has implemented Google's fix in there source here: http://review.cyanogenmod.org/#/c/27862/

    So we decide to try this in our ROM and it seems from my test users with the issue that it has fixed it so we want to share what needs to be changed so you can mod your ROM yourself or Devs to add this to their ROM.

    First up is to Decompile Framework.jar

    Go to:
    \framework\smali\android\media\MediaScanner.smali

    and find:
    Code:
    .method makeEntryFor(Ljava/lang/String;)Landroid/media/MediaScanner$FileEntry;

    Replace the whole method with this:
    Code:
    .method makeEntryFor(Ljava/lang/String;)Landroid/media/MediaScanner$FileEntry;
        .locals 14
        .parameter "path"
    
        .prologue
        .line 1470
        const/4 v12, 0x0
    
        .line 1472
        .local v12, c:Landroid/database/Cursor;
        :try_start_0
        const-string v0, "_"
    
        invoke-virtual {p1, v0}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
    
        move-result v0
    
        if-nez v0, :cond_0
    
        const-string v0, "%"
    
        invoke-virtual {p1, v0}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
    
        move-result v0
    
        if-eqz v0, :cond_4
    
        :cond_0
        const/4 v13, 0x1
    
        .line 1474
        .local v13, hasWildCards:Z
        :goto_0
        if-nez v13, :cond_1
    
        iget-boolean v0, p0, Landroid/media/MediaScanner;->mCaseInsensitivePaths:Z
    
        if-nez v0, :cond_5
    
        .line 1479
        :cond_1
        const-string v3, "_data=?"
    
        .line 1480
        .local v3, where:Ljava/lang/String;
        const/4 v0, 0x1
    
        new-array v4, v0, [Ljava/lang/String;
    
        const/4 v0, 0x0
    
        aput-object p1, v4, v0
    
        .line 1487
        .local v4, selectionArgs:[Ljava/lang/String;
        :goto_1
        iget-object v0, p0, Landroid/media/MediaScanner;->mMediaProvider:Landroid/content/IContentProvider;
    
        iget-object v1, p0, Landroid/media/MediaScanner;->mFilesUri:Landroid/net/Uri;
    
        sget-object v2, Landroid/media/MediaScanner;->FILES_PRESCAN_PROJECTION:[Ljava/lang/String;
    
        const/4 v5, 0x0
    
        const/4 v6, 0x0
    
        invoke-interface/range {v0 .. v6}, Landroid/content/IContentProvider;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Landroid/os/ICancellationSignal;)Landroid/database/Cursor;
    
        move-result-object v12
    
        .line 1489
        invoke-interface {v12}, Landroid/database/Cursor;->moveToFirst()Z
    
        move-result v0
    
        if-nez v0, :cond_2
    
        if-eqz v13, :cond_2
    
        iget-boolean v0, p0, Landroid/media/MediaScanner;->mCaseInsensitivePaths:Z
    
        if-eqz v0, :cond_2
    
        .line 1494
        const-string v3, "_data LIKE ?1 AND lower(_data)=lower(?1)"
    
        .line 1495
        const/4 v0, 0x1
    
        new-array v4, v0, [Ljava/lang/String;
    
        .end local v4           #selectionArgs:[Ljava/lang/String;
        const/4 v0, 0x0
    
        aput-object p1, v4, v0
    
        .line 1496
        .restart local v4       #selectionArgs:[Ljava/lang/String;
        invoke-interface {v12}, Landroid/database/Cursor;->close()V
    
        .line 1497
        iget-object v0, p0, Landroid/media/MediaScanner;->mMediaProvider:Landroid/content/IContentProvider;
    
        iget-object v1, p0, Landroid/media/MediaScanner;->mFilesUri:Landroid/net/Uri;
    
        sget-object v2, Landroid/media/MediaScanner;->FILES_PRESCAN_PROJECTION:[Ljava/lang/String;
    
        const/4 v5, 0x0
    
        const/4 v6, 0x0
    
        invoke-interface/range {v0 .. v6}, Landroid/content/IContentProvider;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Landroid/os/ICancellationSignal;)Landroid/database/Cursor;
    
        move-result-object v12
    
        .line 1502
        :cond_2
        invoke-interface {v12}, Landroid/database/Cursor;->moveToFirst()Z
    
        move-result v0
    
        if-eqz v0, :cond_8
    
        .line 1503
        const/4 v0, 0x0
    
        invoke-interface {v12, v0}, Landroid/database/Cursor;->getLong(I)J
    
        move-result-wide v6
    
        .line 1504
        .local v6, rowId:J
        const/4 v0, 0x2
    
        invoke-interface {v12, v0}, Landroid/database/Cursor;->getInt(I)I
    
        move-result v11
    
        .line 1505
        .local v11, format:I
        const/4 v0, 0x3
    
        invoke-interface {v12, v0}, Landroid/database/Cursor;->getLong(I)J
    
        move-result-wide v9
    
        .line 1506
        .local v9, lastModified:J
        new-instance v5, Landroid/media/MediaScanner$FileEntry;
    
        move-object v8, p1
    
        invoke-direct/range {v5 .. v11}, Landroid/media/MediaScanner$FileEntry;-><init>(JLjava/lang/String;JI)V
        :try_end_0
        .catchall {:try_start_0 .. :try_end_0} :catchall_0
        .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0
    
        .line 1510
        if-eqz v12, :cond_3
    
        .line 1511
        invoke-interface {v12}, Landroid/database/Cursor;->close()V
    
        .line 1514
        .end local v3           #where:Ljava/lang/String;
        .end local v4           #selectionArgs:[Ljava/lang/String;
        .end local v6           #rowId:J
        .end local v9           #lastModified:J
        .end local v11           #format:I
        .end local v13           #hasWildCards:Z
        :cond_3
        :goto_2
        return-object v5
    
        .line 1472
        :cond_4
        const/4 v13, 0x0
    
        goto :goto_0
    
        .line 1484
        .restart local v13       #hasWildCards:Z
        :cond_5
        :try_start_1
        const-string v3, "_data LIKE ?1 AND lower(_data)=lower(?1)"
    
        .line 1485
        .restart local v3       #where:Ljava/lang/String;
        const/4 v0, 0x1
    
        new-array v4, v0, [Ljava/lang/String;
    
        const/4 v0, 0x0
    
        aput-object p1, v4, v0
        :try_end_1
        .catchall {:try_start_1 .. :try_end_1} :catchall_0
        .catch Landroid/os/RemoteException; {:try_start_1 .. :try_end_1} :catch_0
    
        .restart local v4       #selectionArgs:[Ljava/lang/String;
        goto :goto_1
    
        .line 1510
        .end local v3           #where:Ljava/lang/String;
        .end local v4           #selectionArgs:[Ljava/lang/String;
        .end local v13           #hasWildCards:Z
        :catchall_0
        move-exception v0
    
        if-eqz v12, :cond_6
    
        .line 1511
        invoke-interface {v12}, Landroid/database/Cursor;->close()V
    
        .line 1510
        :cond_6
        throw v0
    
        .line 1508
        :catch_0
        move-exception v0
    
        .line 1510
        if-eqz v12, :cond_7
    
        .line 1511
        :goto_3
        invoke-interface {v12}, Landroid/database/Cursor;->close()V
    
        .line 1514
        :cond_7
        const/4 v5, 0x0
    
        goto :goto_2
    
        .line 1510
        .restart local v3       #where:Ljava/lang/String;
        .restart local v4       #selectionArgs:[Ljava/lang/String;
        .restart local v13       #hasWildCards:Z
        :cond_8
        if-eqz v12, :cond_7
    
        goto :goto_3
    .end method

    Recompile and you're good to go.

    Hope this helps.

    Thanks to:
    jeboo
    Google
    cyanogenmod
    6
    But a fix made only for Lsd version in a zip :p lol

    Sent from my GT-I9100 using Tapatalk 2

    Here you go, if you are using my Rom, it's already included, i just forgot to put it on features list.
    4
    Hopefully they fix the .nomedia bug soon..Hard to imagine such an enormous oversight.
    4
    i made one for Neat ROM XWLS8 but will work on all XWLS8 ROMs :D

    Please try and report

    http://forum.xda-developers.com/showpost.php?p=37451842&postcount=27687
    3
    Thanks Sir for sharing with us:) This wakelock is really anoying.