[Android General] AbrahamGC:
Native blur on notification panel - Pie

Note : The mod works on-the-fly but would be better with an observer to avoid read keys on every pulldown...

- Decompile SystemUI

- Open StatusBarWindowManager.smali

- Find this line :

invoke-direct {p0, p1}, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->applyCoverFlags(Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;)V

- And add this :

invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->dlxApplyBlur()V

- Now add this method after # direct method and done :

.method private dlxApplyBlur()V
.locals 3

iget-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mContext:Landroid/content/Context;

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

move-result-object v0

const-string v1, "dlx_np_blur"

const/4 v2, 0x0

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

move-result v0

if-eqz v0, :cond_0

iget-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mContext:Landroid/content/Context;

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

move-result-object v0

const-string v1, "dlx_np_blur_amount"

const/16 v2, 0xf

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

move-result v2

int-to-float v2, v2

const/high16 v1, 0x42c80000 # 100.0f

div-float/2addr v2, v1

iget-object v1, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mCurrentState:Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;

iget-boolean v1, v1, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;->keyguardShowing:Z

if-nez v1, :cond_0

iget-object v1, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mCurrentState:Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;

iget-boolean v1, v1, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;->headsUpShowing:Z

if-nez v1, :cond_0

iget-object v1, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mCurrentState:Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;

iget-boolean v1, v1, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;->panelVisible:Z

if-eqz v1, :cond_0

iget-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mLpChanged:Landroid/view/WindowManager$LayoutParams;

iget v1, v0, Landroid/view/WindowManager$LayoutParams;->flags:I

or-int/lit8 v1, v1, 0x2

iput v1, v0, Landroid/view/WindowManager$LayoutParams;->flags:I

iput v2, v0, Landroid/view/WindowManager$LayoutParams;->dimAmount:F

iget v1, v0, Landroid/view/WindowManager$LayoutParams;->samsungFlags:I

or-int/lit8 v1, v1, 0x40

iput v1, v0, Landroid/view/WindowManager$LayoutParams;->samsungFlags:I

:goto_0
return-void

:cond_0
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mLpChanged:Landroid/view/WindowManager$LayoutParams;

const/4 v2, 0x0

iput v2, v1, Landroid/view/WindowManager$LayoutParams;->dimAmount:F

iget-object v1, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mLpChanged:Landroid/view/WindowManager$LayoutParams;

iget v2, v1, Landroid/view/WindowManager$LayoutParams;->flags:I

and-int/lit8 v2, v2, -0x3

iput v2, v1, Landroid/view/WindowManager$LayoutParams;->flags:I

goto :goto_0
.end method

RC keys :

<com.wubydax.romcontrol.v2.prefs.MySwitchPreference
android:defaultValue="false"
android:key="dlx_np_blur"
android:title="Enable blur" />
<com.wubydax.romcontrol.v2.prefs.MySeekBarPreference
app:minValue="1"
app:maxValue="15"
app:unitsValue="°"
android:title="Intensity"
android:dependency="dlx_np_blur"
android:defaultValue="1"
android:key="dlx_np_blur_amount"/>

GrxSettings keys :

<GrxSwitchPreference
android:title="Enable blur"
android:key="dlx_np_blur"
android:defaultValue="0"
grx:systemType="system" />
<GrxSeekBar
android:title="Intensity"
android:key="dlx_np_blur_amount"
android:defaultValue="15"
android:dependency="dlx_np_blur"
grx:maxValue="15"
grx:minValue="1"
grx:interval="1"
grx:systemType="system" />

Enjoy :good:
​