[Galaxy S III Android Development] kingdj:
Hello guys this time i wana share you how to port blur effect to your expanded&recent, it has option to switch on or off the blur just like xposed module do but this time we do it via smali:p huge thanks to [MENTION=3989065]serajr[/MENTION] for source&tips fix also to [MENTION=5179862]psidco[/MENTION] as builder&thinker

If you not familiar with smali or dcrc your system app i suggest you dig about that before doing this guide/mod

ALWAYS BACKUP BEFORE YOU MODIFY YOUR ROM

I don.t take any responsibility for any damage that may occur while you doing this, you are free no force to do this

GUIDE Expanded Blur With Realtime Change Effect

This Blur Was Already Tested On

Samsung S3 Cm13 Pure By Me Via Smali

Samsung Note2 Cm13 Pure Build From Source

And Many Os&Device On Maaadr Group Fb

Salute&Credit For

Dedy Prayetno/psidco Creator&Builder Of The Mod

Serajr For The Source&Fix Tips Of Headsup Blur And Blank Lockscreen

Maaadr (Mediatek Android Art&Dev Reborn )

You

RESPECT OUR JOB&HARDWORK GIVE PROPER CREDIT IF YOU WANT TO USE ON YOUR ROM OR MOD

WE DIDN.T ASK FOR NOTHING ONLY PROPER CREDIT FOR OUR COUNTLESS TIME DURING BUILD THIS MOD

YOU HAD NO IDEA HOW MUCH TIME&HEADACHE WE FEEL FOR THIS MOD

OKE SKIP BLA BLA BLA LETS START

OPEN notifpanelview smali

PASTE THIS LINE

# static fields
[COLOR="Blue"]
.field public static kontek:Landroid/content/Context;

.field private static mBlurRadius:I

.field private static mBlurScale:I

.field private static mBlurredStatusBarExpandedEnabled:Z

.field private static mBlurredView:Landroid/widget/FrameLayout;

.field private static mColorFilter:Landroid/graphics/ColorFilter;

.field public static mDimen:[I

.field private static final mDummyDirtyRect:Landroid/graphics/Rect;

.field private static mKeyguardShowing:Z

.field public static tmp:Landroid/graphics/Bitmap;[/COLOR]

Delete Field Keyguardshowing That Already Exist On Your Smali That.S Not Needeed Anymore

Paste This Line At The End Of Your Method Static Synthetic Accsess

[COLOR="Blue"]
.method static synthetic access$L1000028()I
.locals 1

sget v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurScale:I

return v0
.end method

.method static synthetic access$L1000029()I
.locals 1

sget v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurRadius:I

return v0
.end method

.method static synthetic access$L1000030()Z
.locals 1

sget-boolean v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredStatusBarExpandedEnabled:Z

return v0
.end method

.method static synthetic access$S1000028(I)V
.locals 0

sput p0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurScale:I

return-void
.end method

.method static synthetic access$S1000029(I)V
.locals 0

sput p0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurRadius:I

return-void
.end method

.method static synthetic access$S1000030(Z)V
.locals 0

sput-boolean p0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredStatusBarExpandedEnabled:Z

return-void
.end method[/COLOR]

Above Method .method private calculatePanelHeightQsExpanded()I

[COLOR="Blue"]
.method public static apdet()V
.locals 6
.annotation system Ldalvik/annotation/Signature;
value = {
"()V"
}
.end annotation

.prologue
const/4 v1, 0x4

const/4 v5, 0x0

.line 564
invoke-static {}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->apdetBlur()V

.line 566
invoke-static {}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->isKeyguard()Z

move-result v0

if-eqz v0, :cond_0

.line 567
sget-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;

invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->setVisibility(I)V

.line 588
:goto_0
return-void

.line 571
:cond_0
invoke-static {}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->ena()Z

move-result v0

if-eqz v0, :cond_1

.line 572
invoke-static {}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->getTemp()Landroid/graphics/Bitmap;

move-result-object v0

.line 573
invoke-static {}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->getDimens()[I

move-result-object v1

.line 574
invoke-static {}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->getScala()I

move-result v2

.line 575
aget v3, v1, v5

div-int/2addr v3, v2

.line 576
const/4 v4, 0x1

aget v4, v1, v4

div-int v2, v4, v2

.line 578
invoke-static {v0, v3, v2, v5}, Landroid/graphics/Bitmap;->createScaledBitmap(Landroid/graphics/Bitmap;IIZ)Landroid/graphics/Bitmap;

move-result-object v0

.line 579
invoke-static {}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->getRadius()I

move-result v2

invoke-static {v0, v2}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->blurBitmap(Landroid/graphics/Bitmap;I)Landroid/graphics/Bitmap;

move-result-object v0

.line 580
sget-object v2, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;

invoke-virtual {v2}, Landroid/widget/FrameLayout;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

move-result-object v2

aget v1, v1, v5

iput v1, v2, Landroid/view/ViewGroup$LayoutParams;->width:I

.line 581
sget-object v1, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;

invoke-virtual {v1}, Landroid/widget/FrameLayout;->requestLayout()V

.line 582
new-instance v1, Landroid/graphics/drawable/BitmapDrawable;

invoke-direct {v1, v0}, Landroid/graphics/drawable/BitmapDrawable;-><init>(Landroid/graphics/Bitmap;)V

.line 583
new-instance v0, Landroid/graphics/PorterDuffColorFilter;

const v2, -0xbbbbbc

sget-object v3, Landroid/graphics/PorterDuff$Mode;->MULTIPLY:Landroid/graphics/PorterDuff$Mode;

invoke-direct {v0, v2, v3}, Landroid/graphics/PorterDuffColorFilter;-><init>(ILandroid/graphics/PorterDuff$Mode;)V

invoke-virtual {v1, v0}, Landroid/graphics/drawable/BitmapDrawable;->setColorFilter(Landroid/graphics/ColorFilter;)V

.line 584
sget-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;

invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->setBackground(Landroid/graphics/drawable/Drawable;)V

.line 585
sget-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;

invoke-virtual {v0, v5}, Landroid/widget/FrameLayout;->setVisibility(I)V

goto :goto_0

.line 588
:cond_1
sget-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;

invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->setVisibility(I)V

goto :goto_0
.end method

.method public static apdetBlur()V
.locals 4
.annotation system Ldalvik/annotation/Signature;
value = {
"()V"
}
.end annotation

.prologue
const/4 v3, 0x3

const/4 v0, 0x1

.line 553
sget-object v1, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->kontek:Landroid/content/Context;

invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v1

.line 555
const-string v2, "BLUR_SCALA"

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

move-result v2

sput v2, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurScale:I

.line 557
const-string v2, "BLUR_RADIUS"

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

move-result v2

sput v2, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurRadius:I

.line 559
const-string v2, "BLUR"

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

move-result v1

if-eq v1, v0, :cond_0

const/4 v0, 0x0

:cond_0
sput-boolean v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredStatusBarExpandedEnabled:Z

return-void
.end method

.method public static blurBitmap(Landroid/graphics/Bitmap;I)Landroid/graphics/Bitmap;
.locals 4

.prologue
.line 585
sget-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->kontek:Landroid/content/Context;

invoke-static {v0}, Landroid/renderscript/RenderScript;->create(Landroid/content/Context;)Landroid/renderscript/RenderScript;

move-result-object v0

.line 586
invoke-static {v0}, Landroid/renderscript/Element;->U8_4(Landroid/renderscript/RenderScript;)Landroid/renderscript/Element;

move-result-object v1

invoke-static {v0, v1}, Landroid/renderscript/ScriptIntrinsicBlur;->create(Landroid/renderscript/RenderScript;Landroid/renderscript/Element;)Landroid/renderscript/ScriptIntrinsicBlur;

move-result-object v1

.line 587
invoke-static {v0, p0}, Landroid/renderscript/Allocation;->createFromBitmap(Landroid/renderscript/RenderScript;Landroid/graphics/Bitmap;)Landroid/renderscript/Allocation;

move-result-object v2

.line 588
invoke-virtual {v2}, Landroid/renderscript/Allocation;->getType()Landroid/rcript/Type;

ove-result-objectSS v3

invoke-static {v0, v3}, Landroid/renderscript/Allocation;->createTyped(Landroid/renderscript/RenderScript;Landroid/renderscript/Type;)Landroid/renderscript/Allocation;

move-result-object v0

.line 589
int-to-float v3, p1

invoke-virtual {v1, v3}, Landroid/renderscript/ScriptIntrinsicBlur;->setRadius(F)V

.line 590
invoke-virtual {v1, v2}, Landroid/renderscript/ScriptIntrinsicBlur;->setInput(Landroid/renderscript/Allocation;)V

.line 591
invoke-virtual {v1, v0}, Landroid/renderscript/ScriptIntrinsicBlur;->forEach(Landroid/renderscript/Allocation;)V

.line 592
invoke-virtual {v0, p0}, Landroid/renderscript/Allocation;->copyTo(Landroid/graphics/Bitmap;)V

.line 593
return-object p0
.end method[/COLOR]

Above Method .method private flingExpandsQs(F)Z

[COLOR="Blue"]
.method public static ena()Z
.locals 1

.prologue
.line 539
sget-boolean v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredStatusBarExpandedEnabled:Z

return v0
.end method[/COLOR]

Above Method .method private getFadeoutAlpha()F

[COLOR="Blue"]
.method public static getDimens()[I
.locals 1

.prologue
.line 549
sget-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mDimen:[I

return-object v0
.end method[/COLOR]

Above Method .method private getScrollViewScrollY()I

[COLOR="Blue"].method public static getRadius()I
.locals 1

.prologue
.line 545
sget v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurRadius:I

return v0
.end method

.method public static getScala()I
.locals 1

.prologue
.line 542
sget v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurScale:I

return v0
.end method[/COLOR]

Above Method .method private getTempQsMaxExpansion()I

[COLOR="Blue"]
.method public static getTemp()Landroid/graphics/Bitmap;
.locals 1

.prologue
.line 533
sget-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->tmp:Landroid/graphics/Bitmap;

return-object v0
.end method[/COLOR]

Below Method .method private isInSettings()Z

[COLOR="Blue"]
.method public static isKeyguard()Z
.locals 1

.prologue
.line 537
sget-boolean v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mKeyguardShowing:Z

return v0
.end method[/COLOR]

Above Method .method private requestScrollerTopPaddingUpdate(Z)V

[COLOR="Blue"]
.method public static recycle()V
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"()V"
}
.end annotation

.prologue
const/4 v1, 0x0

.line 613
sget-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;

if-eqz v0, :cond_1

sget-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;

invoke-virtual {v0}, Landroid/widget/FrameLayout;->getBackground()Landroid/graphics/drawable/Drawable;

move-result-object v0

if-eqz v0, :cond_1

.line 615
sget-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;

invoke-virtual {v0}, Landroid/widget/FrameLayout;->getBackground()Landroid/graphics/drawable/Drawable;

move-result-object v0

instance-of v0, v0, Landroid/graphics/drawable/BitmapDrawable;

if-eqz v0, :cond_0

.line 616
sget-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;

invoke-virtual {v0}, Landroid/widget/FrameLayout;->getBackground()Landroid/graphics/drawable/Drawable;

move-result-object v0

check-cast v0, Landroid/graphics/drawable/BitmapDrawable;

invoke-virtual {v0}, Landroid/graphics/drawable/BitmapDrawable;->getBitmap()Landroid/graphics/Bitmap;

move-result-object v0

.line 617
if-eqz v0, :cond_0

.line 618
invoke-virtual {v0}, Landroid/graphics/Bitmap;->recycle()V

move-object v0, v1

.line 619
check-cast v0, Landroid/graphics/Bitmap;

.line 623
:cond_0
sget-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;

check-cast v1, Landroid/graphics/drawable/Drawable;

invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->setBackground(Landroid/graphics/drawable/Drawable;)V

.line 625
:cond_1
sget-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;

const/4 v1, 0x4

invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->setVisibility(I)V

return-void
.end method[/COLOR]

Below Method .method private shouldQuickSettingsIntercept(FFF)Z

[COLOR="Blue"]
.method public static startBlurTask()V
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"()V"
}
.end annotation

.prologue
.line 610
sget-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->kontek:Landroid/content/Context;

invoke-static {v0}, Lcom/android/systemui/statusbar/phone/BlurAnu;->ss(Landroid/content/Context;)Landroid/graphics/Bitmap;

move-result-object v0

.line 611
sput-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->tmp:Landroid/graphics/Bitmap;

.line 612
sget-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->kontek:Landroid/content/Context;

invoke-static {v0}, Lcom/android/systemui/statusbar/phone/BlurAnu;->ukuranLayar(Landroid/content/Context;)[I

move-result-object v0

sput-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mDimen:[I

.line 614
invoke-static {}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->isKeyguard()Z

move-result v0

if-eqz v0, :cond_0

.line 615
sget-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;

const/4 v1, 0x4

invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->setVisibility(I)V

.line 620
:goto_0
return-void

.line 619
:cond_0
invoke-static {}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->apdetBlur()V

.line 620
invoke-static {}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->apdet()V

goto :goto_0
.end method[/COLOR]

Below Method .method protected isTrackingBlocked()Z

[COLOR="Blue"]
.method public jancuk()V
.locals 4
.annotation system Ldalvik/annotation/Signature;
value = {
"()V"
}
.end annotation

.prologue
const/4 v3, 0x0

const/4 v2, -0x1

.line 519
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->getContext()Landroid/content/Context;

move-result-object v0

sput-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->kontek:Landroid/content/Context;

.line 525
new-instance v0, Landroid/widget/FrameLayout;

iget-object v1, p0, Landroid/view/View;->mContext:Landroid/content/Context;

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

sput-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;

.line 526
sget-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;

new-instance v1, Landroid/widget/FrameLayout$LayoutParams;

invoke-direct {v1, v2, v2}, Landroid/widget/FrameLayout$LayoutParams;-><init>(II)V

invoke-virtual {p0, v0, v3, v1}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->addView(Landroid/view/View;ILandroid/view/ViewGroup$LayoutParams;)V

.line 528
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->requestLayout()V

.line 530
sget-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;

invoke-virtual {v0, v3}, Landroid/widget/FrameLayout;->setVisibility(I)V

return-void
.end method[/COLOR]

On Method Protected Onfinish Inflate Add

[COLOR="Blue"]
.line 437
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->jancuk()V[/COLOR]

Looks Like This Below

[COLOR="Blue"]
check-cast v0, Lcom/android/systemui/qs/QSDragPanel;

iput-object v0, p0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mQsPanel:Lcom/android/systemui/qs/QSDragPanel;

.line 437
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->jancuk()V
[/COLOR]

NEXT

PhoneStatusBar.smali

On Method .method private updateKeyguardState(ZZ)V

[COLOR="Blue"]
.line 4570
:goto_1
invoke-static {}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->recycle()V[/COLOR]

Looks Like Below

[COLOR="Blue"].line 4565
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mIconPolicy:Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;

invoke-virtual {v1, v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->setKeyguardShowing(Z)V

.line 4570
:goto_1
invoke-static {}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->recycle()V

iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationPanel:Lcom/android/systemui/statusbar/phone/NotificationPanelView;

iget v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mState:I[/COLOR]

On Method .method makeExpandedInvisible()V

Add

[COLOR="Blue"].line 2786
:cond_1
invoke-static {}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->recycle()V[/COLOR]

Looks like below

[COLOR="Blue"].line 2781
iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedVisible:Z

if-eqz v0, :cond_0

iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;

if-nez v0, :cond_1

.line 2782
:cond_0
return-void

.line 2786
:cond_1
invoke-static {}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->recycle()V[/COLOR]

On Method .method makeExpandedVisible(Z)V

Add

[COLOR="Blue"]
.line 2673
invoke-static {}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->startBlurTask()V/[/COLOR]

Looks Like Below

[COLOR="Blue"].line 2672
invoke-virtual {p0, v1, v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setInteracting(IZ)V

.line 2673
invoke-static {}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->startBlurTask()V

.line 2655
return-void

.line 2658
:cond_2
return-void

:cond_3
move v0, v1

.line 2671
goto :goto_0
.end method[/COLOR]

NEXT

NOTE!!!!!!!!!!!!

You Must Change Default Instance Inside Your Smali

Example

BEFORE

[COLOR="Blue"]iget-boolean v3, p0,Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mKeyguardShowing:Z[/COLOR]

AFTER

[COLOR="Blue"]sget-boolean v3, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mKeyguardShowing:Z[/COLOR]

Do That On Every Line Inside Your Notifpanel Smali That Have End Line Like This "mkeyguardshowing;Z"

On My Smali I Had To Change About 15 Until 20 Line So Check Carefully Yours

If You Forgot 1 Line It Will Fc

The Point Is To Change From Instance To Be Static Field

​

Continue to part2