[Nexus 6P Themes and Apps] Charles_l:
I will write a guide to explain how to patch it when I have time...too many things to explain. for short I can write down now.

I call it the Opa animation as google's way.

1. deodex the dex in /SystemUI/oat directory, combine the resources decode from systemUI.apk

2. insert the Opa resources from Pixel.

3. insert the modified smali code which is connect to Opa from Pixel. it is separated.

4. the entrance of SytemUIGoogle is the key, you need to modify the original entrance of Nexus's.

Right now I still using the force method to change the settings which was read from shared performance, we still need to find a perfect solution to active the Opa Receiver, I know it can be defined inside the smali instead of defined in the AndroidManifest.xml

Rewrite this Opa receiver, we can make it perfect, disable assistan = no animation. For now animation always shows.

.class public Lcom/google/android/systemui/OpaEnableReceiver;
.super Landroid/content/BroadcastReceiver;
.source "OpaEnableReceiver.java"

# static fields
.field private static final TAG:Ljava/lang/String; = "OpaEnableReceiver"
# direct methods
.method public constructor <init>()V
.locals 0

.prologue
.line 20
invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V

return-void
.end method

# virtual methods
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
.locals 10
.param p1, "context" # Landroid/content/Context;
.param p2, "intent" # Landroid/content/Intent;

.prologue
.line 24
const-string/jumbo v7, "OPA_ENABLED"

const/4 v8, 0x0

invoke-virtual {p2, v7, v8}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z

move-result v1

.line 25
.local v1, "enabled":Z
const-string/jumbo v7, "OpaEnableReceiver"

new-instance v8, Ljava/lang/StringBuilder;

invoke-direct {v8}, Ljava/lang/StringBuilder;-><init>()V

const-string/jumbo v9, "Received "

invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

move-result-object v8

invoke-virtual {v8, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

move-result-object v8

const-string/jumbo v9, " with enabled = "

invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

move-result-object v8

invoke-virtual {v8, v1}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

move-result-object v8

invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

move-result-object v8

invoke-static {v7, v8}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

.line 27
invoke-static {p1}, Landroid/preference/PreferenceManager;->getDefaultSharedPreferences(Landroid/content/Context;)Landroid/content/SharedPreferences;

move-result-object v4

.line 28
.local v4, "prefs":Landroid/content/SharedPreferences;
invoke-interface {v4}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

move-result-object v7

const-string/jumbo v8, "OPA_ENABLED"

invoke-interface {v7, v8, v1}, Landroid/content/SharedPreferences$Editor;->putBoolean(Ljava/lang/String;Z)Landroid/content/SharedPreferences$Editor;

move-result-object v7

invoke-interface {v7}, Landroid/content/SharedPreferences$Editor;->apply()V

.line 30
invoke-virtual {p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

move-result-object v7

check-cast v7, Lcom/android/systemui/SystemUIApplication;

.line 31
const-class v8, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;

.line 30
invoke-virtual {v7, v8}, Lcom/android/systemui/SystemUIApplication;->getComponent(Ljava/lang/Class;)Ljava/lang/Object;

move-result-object v0

check-cast v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;

.line 32
.local v0, "bar":Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
if-nez v0, :cond_0

.line 33
return-void

.line 35
:cond_0
invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->getHomeButton()Lcom/android/systemui/statusbar/phone/ButtonDispatcher;

move-result-object v2

.line 36
.local v2, "homeDispatcher":Lcom/android/systemui/statusbar/phone/ButtonDispatcher;
invoke-virtual {v2}, Lcom/android/systemui/statusbar/phone/ButtonDispatcher;->getViews()Ljava/util/ArrayList;

move-result-object v6

.line 37
.local v6, "views":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/view/View;>;"
const/4 v3, 0x0

.local v3, "i":I
:goto_0
invoke-virtual {v6}, Ljava/util/ArrayList;->size()I

move-result v7

if-ge v3, v7, :cond_1

.line 38
invoke-virtual {v6, v3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

move-result-object v5

check-cast v5, Landroid/view/View;

.line 39
.local v5, "v":Landroid/view/View;
check-cast v5, Lcom/google/android/systemui/OpaLayout;

.end local v5 # "v":Landroid/view/View;
invoke-virtual {v5, v1}, Lcom/google/android/systemui/OpaLayout;->setOpaEnabled(Z)V

.line 37
add-int/lit8 v3, v3, 0x1

goto :goto_0

.line 23
:cond_1
return-void
.end method