Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,739,262 Members 50,573 Now Online
XDA Developers Android and Mobile Development Forum

[MOD][GUIDE][JB 4.1.2][MULTI-THREAD/NATIVE] Lockscreen Blur Effect/MULTITHREAD

Tip us?
 
phenomarc
Old
#71  
phenomarc's Avatar
Senior Member
Thanks Meter 100
Posts: 192
Join Date: Nov 2011
Quote:
Originally Posted by Many40 View Post
Ok thanks. It would be nice if you could post it. I would differ the code if my mine then (if my doesn't work - have to recheck it).

Sent from my GT-I9100 using Tapatalk 2
http://d-h.st/kaf
ROM: SaberPAC 4.4.3 / PHD v9 TWE
KERNEL: Dorimanx 8.43v112 with -50 mV
MODEM: 250K
https://www.youtube.com/channel/UC0e...tpQJYV0VuTkGog
The Following User Says Thank You to phenomarc For This Useful Post: [ Click to Expand ]
 
Many40
Old
(Last edited by Many40; 26th May 2014 at 03:56 PM.)
#72  
Many40's Avatar
Recognized Contributor
Thanks Meter 18066
Posts: 5,062
Join Date: Nov 2009
Location: Ω⌂
Quote:
Originally Posted by phenomarc View Post
Thanks, you are very helpful however I just rechecked my old toggle (non build.prop one) which I made last week and a miracle happened - it works

It even works without changing wallpaper after toggling. Just it works on-the-fly as it should be. Don't know why it didn't work earlier - only difference is that in the meantime I reflashed my rom so maybe that time I had some leftovers from older mods ...

Regards

 
My current setup:
Device: SGS2 (i9100)
Kernel: Siyah6.0 beta 4/SuperSU
CPU: 10 steps (100-1000MHz)/UV, pegasusq/sio
GPU: 5 steps (54, 66, 108, 160, 267 MHz)/UV
ROM: JB 4.1.2 XWMS3 NeatRomLite v6.2
 
alphamale
Old
#73  
alphamale's Avatar
Senior Member
Thanks Meter 36
Posts: 176
Join Date: Mar 2011
Any idea if this would work on kk
 
shut_down
Old
#74  
shut_down's Avatar
Senior Member
Thanks Meter 3193
Posts: 7,216
Join Date: Sep 2010
Location: Belgrade
Quote:
Originally Posted by alphamale View Post
Any idea if this would work on kk
I think that some KK ROMs has Lockscreen Blur Effect. But I can't remember which one.
 
alphamale
Old
#75  
alphamale's Avatar
Senior Member
Thanks Meter 36
Posts: 176
Join Date: Mar 2011
Quote:
Originally Posted by shut_down View Post
I think that some KK ROMs has Lockscreen Blur Effect. But I can't remember which one.
None for vzw note 3 tw

Sent from my SM-N900V using Tapatalk
 
shut_down
Old
#76  
shut_down's Avatar
Senior Member
Thanks Meter 3193
Posts: 7,216
Join Date: Sep 2010
Location: Belgrade
Quote:
Originally Posted by alphamale View Post
None for vzw note 3 tw

Sent from my SM-N900V using Tapatalk
I was referring to the device in which section is this thread - Galaxy S Advance. It does not have stock TW 4.4.
 
drnarinder
Old
(Last edited by drnarinder; 14th June 2014 at 02:14 AM.)
#77  
drnarinder's Avatar
Senior Member
Thanks Meter 543
Posts: 372
Join Date: Nov 2011
Location: Amritsar
Hi @phenomarc Can you guide me how to add on the fly toggle in settings

Thanks in advance
 
phenomarc
Old
#78  
phenomarc's Avatar
Senior Member
Thanks Meter 100
Posts: 192
Join Date: Nov 2011
Quote:
Originally Posted by drnarinder View Post
Hi @phenomarc Can you guide me how to add on the fly toggle in settings

Thanks in advance
In WallpaperWidget, make method public constructor like this:

Code:
Select Code
.method public constructor <init>(Landroid/content/Context;Landroid/content/res/Configuration;)V
    .registers 8
    .parameter "paramContext"
    .parameter "paramConfiguration"

    .prologue
    const/4 v4, 0x0

    const/4 v3, -0x1

    const/4 v2, 0x1

    .line 35
    invoke-direct {p0, p1}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;)V

    .line 24
    const-string v0, "WallpaperWidget"

    iput-object v0, p0, Lcom/android/internal/policy/impl/sec/WallpaperWidget;->TAG:Ljava/lang/String;

    .line 27
    iput-boolean v2, p0, Lcom/android/internal/policy/impl/sec/WallpaperWidget;->mIsLiveWallpaper:Z

    .line 36
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/android/internal/policy/impl/sec/WallpaperWidget;->mLockScreenWallpaperImage:Landroid/widget/ImageView;

    .line 37
    const-string v0, "/data/data/com.sec.android.gallery3d/lockscreen_wallpaper.jpg"

    iput-object v0, p0, Lcom/android/internal/policy/impl/sec/WallpaperWidget;->PORTRAIT_WALLPAPER_IMAGE_PATH:Ljava/lang/String;

    .line 38
    iput-object p1, p0, Lcom/android/internal/policy/impl/sec/WallpaperWidget;->mContext:Landroid/content/Context;

    .line 39
    invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    const-string v1, "lockscreen_wallpaper"

    invoke-static {v0, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v0

    if-ne v0, v2, :cond_23

    .line 40
    iput-boolean v4, p0, Lcom/android/internal/policy/impl/sec/WallpaperWidget;->mIsLiveWallpaper:Z

    .line 42
    :cond_23
    iget-boolean v0, p0, Lcom/android/internal/policy/impl/sec/WallpaperWidget;->mIsLiveWallpaper:Z

    if-eqz v0, :cond_28

    .line 67
    :goto_27
    return-void

    .line 45
    :cond_28
    new-instance v0, Landroid/widget/ImageView;

    invoke-direct {v0, p1}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/android/internal/policy/impl/sec/WallpaperWidget;->mLockScreenWallpaperImage:Landroid/widget/ImageView;

    .line 46
    iget-object v0, p0, Lcom/android/internal/policy/impl/sec/WallpaperWidget;->mLockScreenWallpaperImage:Landroid/widget/ImageView;

    sget-object v1, Landroid/widget/ImageView$ScaleType;->CENTER_CROP:Landroid/widget/ImageView$ScaleType;

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setScaleType(Landroid/widget/ImageView$ScaleType;)V

    .line 47
    iget-object v0, p0, Lcom/android/internal/policy/impl/sec/WallpaperWidget;->mLockScreenWallpaperImage:Landroid/widget/ImageView;

    invoke-virtual {p0, v0, v3, v3}, Lcom/android/internal/policy/impl/sec/WallpaperWidget;->addView(Landroid/view/View;II)V

    .line 48
    invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    const-string v1, "blur_toggle"

    invoke-static {v0, v1, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v0

    packed-switch v0, :pswitch_data_5c

    goto :goto_27

    .line 50
    :pswitch_49
    invoke-direct {p0}, Lcom/android/internal/policy/impl/sec/WallpaperWidget;->setLockScreenWallpaper()V

    goto :goto_27

    .line 53
    :pswitch_4d
    invoke-direct {p0}, Lcom/android/internal/policy/impl/sec/WallpaperWidget;->BlurImage()V

    .line 54
    invoke-virtual {p0}, Lcom/android/internal/policy/impl/sec/WallpaperWidget;->updateWallpaper()V

    goto :goto_27

    .line 57
    :pswitch_54
    invoke-direct {p0}, Lcom/android/internal/policy/impl/sec/WallpaperWidget;->BlurImage_Multi()V

    .line 58
    invoke-virtual {p0}, Lcom/android/internal/policy/impl/sec/WallpaperWidget;->updateWallpaper()V

    goto :goto_27

    .line 48
    nop

    :pswitch_data_5c
    .packed-switch 0x0
        :pswitch_49
        :pswitch_4d
        :pswitch_54
    .end packed-switch
.end method

Then, in SecSettings or where you put the toggle, put this in the xml:
Code:
Select Code
<CheckBoxPreference android:title="Your tilte" android:key="blur_toggle" android:summary="Your summary" />
Then, in your smali add this at the top:
Code:
Select Code
.field mBlurLock:Landroid/preference/CheckBoxPreference;
this in method OnCreate:
Code:
Select Code
const-string v1, "blur_toggle"

    invoke-virtual {p0, v1}, Lcom/android/settings/YourSmali;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    check-cast v1, Landroid/preference/CheckBoxPreference;

    iput-object v1, p0, Lcom/android/settings/YourSmali;->mBlurLock:Landroid/preference/CheckBoxPreference;
this in method OnPreferenceChange:
Code:
Select Code
:cond_2
    iget-object v0, p0, Lcom/android/settings/YourSmali;->mBlurLock:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-ne p1, v5, :cond_0

    iget-object v0, p0, Lcom/android/settings/YourSmali;->mBlurLock:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z

    move-result v0

    invoke-virtual {p0}, Lcom/android/settings/YourSmali;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "blur_toggle"

    if-nez v0, :cond_3

    const/4 v0, 0x0

    goto :goto_2

    :cond_3
    const/4 v0, 0x1

    :goto_2
    invoke-static {v3, v4, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    goto :goto_0
and this in method OnPreferenceTreeClick:
Code:
Select Code
:cond_6
    iget-object v2, p0, Lcom/android/settings/YourSmali;->mBlurLock:Landroid/preference/CheckBoxPreference;

    if-ne p2, v2, :cond_1

    invoke-virtual {p0}, Lcom/android/settings/YourSmali;->getActivity()Landroid/app/Activity;

    move-result-object v2

    invoke-virtual {v2}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v2

    const-string v3, "blur_toggle"

    check-cast p2, Landroid/preference/CheckBoxPreference;

    invoke-virtual {p2}, Landroid/preference/CheckBoxPreference;->isChecked()Z

    move-result v4

    if-eqz v4, :cond_7

    move v0, v1

    :cond_7
    invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    goto/16 :goto_0
Change "YourSmali" with the path of the smali you're using in settings.
The smali part is the most difficult, because you will have to match with your values.
If you have problems, let me know.
ROM: SaberPAC 4.4.3 / PHD v9 TWE
KERNEL: Dorimanx 8.43v112 with -50 mV
MODEM: 250K
https://www.youtube.com/channel/UC0e...tpQJYV0VuTkGog
The Following User Says Thank You to phenomarc For This Useful Post: [ Click to Expand ]
 
drnarinder
Old
#79  
drnarinder's Avatar
Senior Member
Thanks Meter 543
Posts: 372
Join Date: Nov 2011
Location: Amritsar
Dear @phenomarc

Finally added onthe fly toggle with your help

Thanks a lot

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes