Rabbit-R1/android (non root)/smali/smali_classes3/io/flutter/embedding/android/FlutterSurfaceView.smali

574 lines
17 KiB
Smali
Raw Normal View History

2024-05-21 21:08:36 +00:00
.class public Lio/flutter/embedding/android/FlutterSurfaceView;
.super Landroid/view/SurfaceView;
.source "FlutterSurfaceView.java"
# interfaces
.implements Lio/flutter/embedding/engine/renderer/RenderSurface;
# static fields
.field private static final TAG:Ljava/lang/String; = "FlutterSurfaceView"
# instance fields
.field private flutterRenderer:Lio/flutter/embedding/engine/renderer/FlutterRenderer;
.field private final flutterUiDisplayListener:Lio/flutter/embedding/engine/renderer/FlutterUiDisplayListener;
.field private isPaused:Z
.field private isSurfaceAvailableForRendering:Z
.field private final renderTransparently:Z
.field private final surfaceCallback:Landroid/view/SurfaceHolder$Callback;
# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.locals 2
const/4 v0, 0x0
const/4 v1, 0x0
.line 103
invoke-direct {p0, p1, v0, v1}, Lio/flutter/embedding/android/FlutterSurfaceView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;Z)V
return-void
.end method
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.locals 1
const/4 v0, 0x0
.line 116
invoke-direct {p0, p1, p2, v0}, Lio/flutter/embedding/android/FlutterSurfaceView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;Z)V
return-void
.end method
.method private constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;Z)V
.locals 0
.line 121
invoke-direct {p0, p1, p2}, Landroid/view/SurfaceView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
const/4 p1, 0x0
iput-boolean p1, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->isSurfaceAvailableForRendering:Z
iput-boolean p1, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->isPaused:Z
.line 50
new-instance p1, Lio/flutter/embedding/android/FlutterSurfaceView$1;
invoke-direct {p1, p0}, Lio/flutter/embedding/android/FlutterSurfaceView$1;-><init>(Lio/flutter/embedding/android/FlutterSurfaceView;)V
iput-object p1, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->surfaceCallback:Landroid/view/SurfaceHolder$Callback;
.line 82
new-instance p1, Lio/flutter/embedding/android/FlutterSurfaceView$2;
invoke-direct {p1, p0}, Lio/flutter/embedding/android/FlutterSurfaceView$2;-><init>(Lio/flutter/embedding/android/FlutterSurfaceView;)V
iput-object p1, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->flutterUiDisplayListener:Lio/flutter/embedding/engine/renderer/FlutterUiDisplayListener;
iput-boolean p3, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->renderTransparently:Z
.line 123
invoke-direct {p0}, Lio/flutter/embedding/android/FlutterSurfaceView;->init()V
return-void
.end method
.method public constructor <init>(Landroid/content/Context;Z)V
.locals 1
const/4 v0, 0x0
.line 111
invoke-direct {p0, p1, v0, p2}, Lio/flutter/embedding/android/FlutterSurfaceView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;Z)V
return-void
.end method
.method static synthetic access$002(Lio/flutter/embedding/android/FlutterSurfaceView;Z)Z
.locals 0
.line 35
iput-boolean p1, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->isSurfaceAvailableForRendering:Z
return p1
.end method
.method static synthetic access$100(Lio/flutter/embedding/android/FlutterSurfaceView;)Z
.locals 0
.line 35
invoke-direct {p0}, Lio/flutter/embedding/android/FlutterSurfaceView;->shouldNotify()Z
move-result p0
return p0
.end method
.method static synthetic access$200(Lio/flutter/embedding/android/FlutterSurfaceView;)V
.locals 0
.line 35
invoke-direct {p0}, Lio/flutter/embedding/android/FlutterSurfaceView;->connectSurfaceToRenderer()V
return-void
.end method
.method static synthetic access$300(Lio/flutter/embedding/android/FlutterSurfaceView;II)V
.locals 0
.line 35
invoke-direct {p0, p1, p2}, Lio/flutter/embedding/android/FlutterSurfaceView;->changeSurfaceSize(II)V
return-void
.end method
.method static synthetic access$400(Lio/flutter/embedding/android/FlutterSurfaceView;)V
.locals 0
.line 35
invoke-direct {p0}, Lio/flutter/embedding/android/FlutterSurfaceView;->disconnectSurfaceFromRenderer()V
return-void
.end method
.method static synthetic access$500(Lio/flutter/embedding/android/FlutterSurfaceView;)Lio/flutter/embedding/engine/renderer/FlutterRenderer;
.locals 0
.line 35
iget-object p0, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->flutterRenderer:Lio/flutter/embedding/engine/renderer/FlutterRenderer;
return-object p0
.end method
.method private changeSurfaceSize(II)V
.locals 2
iget-object v0, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->flutterRenderer:Lio/flutter/embedding/engine/renderer/FlutterRenderer;
if-eqz v0, :cond_0
.line 283
new-instance v0, Ljava/lang/StringBuilder;
const-string v1, "Notifying FlutterRenderer that Android surface size has changed to "
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v0
const-string v1, " x "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
const-string v1, "FlutterSurfaceView"
invoke-static {v1, v0}, Lio/flutter/Log;->v(Ljava/lang/String;Ljava/lang/String;)V
iget-object p0, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->flutterRenderer:Lio/flutter/embedding/engine/renderer/FlutterRenderer;
.line 289
invoke-virtual {p0, p1, p2}, Lio/flutter/embedding/engine/renderer/FlutterRenderer;->surfaceChanged(II)V
return-void
.line 279
:cond_0
new-instance p0, Ljava/lang/IllegalStateException;
const-string p1, "changeSurfaceSize() should only be called when flutterRenderer is non-null."
invoke-direct {p0, p1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p0
.end method
.method private connectSurfaceToRenderer()V
.locals 2
iget-object v0, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->flutterRenderer:Lio/flutter/embedding/engine/renderer/FlutterRenderer;
if-eqz v0, :cond_0
.line 262
invoke-virtual {p0}, Lio/flutter/embedding/android/FlutterSurfaceView;->getHolder()Landroid/view/SurfaceHolder;
move-result-object v0
if-eqz v0, :cond_0
iget-object v0, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->flutterRenderer:Lio/flutter/embedding/engine/renderer/FlutterRenderer;
.line 273
invoke-virtual {p0}, Lio/flutter/embedding/android/FlutterSurfaceView;->getHolder()Landroid/view/SurfaceHolder;
move-result-object v1
invoke-interface {v1}, Landroid/view/SurfaceHolder;->getSurface()Landroid/view/Surface;
move-result-object v1
iget-boolean p0, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->isPaused:Z
invoke-virtual {v0, v1, p0}, Lio/flutter/embedding/engine/renderer/FlutterRenderer;->startRenderingToSurface(Landroid/view/Surface;Z)V
return-void
.line 263
:cond_0
new-instance p0, Ljava/lang/IllegalStateException;
const-string v0, "connectSurfaceToRenderer() should only be called when flutterRenderer and getHolder() are non-null."
invoke-direct {p0, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p0
.end method
.method private disconnectSurfaceFromRenderer()V
.locals 1
iget-object p0, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->flutterRenderer:Lio/flutter/embedding/engine/renderer/FlutterRenderer;
if-eqz p0, :cond_0
.line 300
invoke-virtual {p0}, Lio/flutter/embedding/engine/renderer/FlutterRenderer;->stopRenderingToSurface()V
return-void
.line 295
:cond_0
new-instance p0, Ljava/lang/IllegalStateException;
const-string v0, "disconnectSurfaceFromRenderer() should only be called when flutterRenderer is non-null."
invoke-direct {p0, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p0
.end method
.method private init()V
.locals 2
iget-boolean v0, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->renderTransparently:Z
if-eqz v0, :cond_0
.line 130
invoke-virtual {p0}, Lio/flutter/embedding/android/FlutterSurfaceView;->getHolder()Landroid/view/SurfaceHolder;
move-result-object v0
const/4 v1, -0x2
invoke-interface {v0, v1}, Landroid/view/SurfaceHolder;->setFormat(I)V
const/4 v0, 0x1
.line 131
invoke-virtual {p0, v0}, Lio/flutter/embedding/android/FlutterSurfaceView;->setZOrderOnTop(Z)V
.line 136
:cond_0
invoke-virtual {p0}, Lio/flutter/embedding/android/FlutterSurfaceView;->getHolder()Landroid/view/SurfaceHolder;
move-result-object v0
iget-object v1, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->surfaceCallback:Landroid/view/SurfaceHolder$Callback;
invoke-interface {v0, v1}, Landroid/view/SurfaceHolder;->addCallback(Landroid/view/SurfaceHolder$Callback;)V
const/4 v0, 0x0
.line 140
invoke-virtual {p0, v0}, Lio/flutter/embedding/android/FlutterSurfaceView;->setAlpha(F)V
return-void
.end method
.method private shouldNotify()Z
.locals 1
iget-object v0, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->flutterRenderer:Lio/flutter/embedding/engine/renderer/FlutterRenderer;
if-eqz v0, :cond_0
iget-boolean p0, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->isPaused:Z
if-nez p0, :cond_0
const/4 p0, 0x1
goto :goto_0
:cond_0
const/4 p0, 0x0
:goto_0
return p0
.end method
# virtual methods
.method public attachToRenderer(Lio/flutter/embedding/engine/renderer/FlutterRenderer;)V
.locals 2
const-string v0, "Attaching to FlutterRenderer."
const-string v1, "FlutterSurfaceView"
.line 185
invoke-static {v1, v0}, Lio/flutter/Log;->v(Ljava/lang/String;Ljava/lang/String;)V
iget-object v0, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->flutterRenderer:Lio/flutter/embedding/engine/renderer/FlutterRenderer;
if-eqz v0, :cond_0
const-string v0, "Already connected to a FlutterRenderer. Detaching from old one and attaching to new one."
.line 187
invoke-static {v1, v0}, Lio/flutter/Log;->v(Ljava/lang/String;Ljava/lang/String;)V
iget-object v0, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->flutterRenderer:Lio/flutter/embedding/engine/renderer/FlutterRenderer;
.line 191
invoke-virtual {v0}, Lio/flutter/embedding/engine/renderer/FlutterRenderer;->stopRenderingToSurface()V
iget-object v0, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->flutterRenderer:Lio/flutter/embedding/engine/renderer/FlutterRenderer;
iget-object v1, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->flutterUiDisplayListener:Lio/flutter/embedding/engine/renderer/FlutterUiDisplayListener;
.line 192
invoke-virtual {v0, v1}, Lio/flutter/embedding/engine/renderer/FlutterRenderer;->removeIsDisplayingFlutterUiListener(Lio/flutter/embedding/engine/renderer/FlutterUiDisplayListener;)V
:cond_0
iput-object p1, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->flutterRenderer:Lio/flutter/embedding/engine/renderer/FlutterRenderer;
.line 197
invoke-virtual {p0}, Lio/flutter/embedding/android/FlutterSurfaceView;->resume()V
return-void
.end method
.method public detachFromRenderer()V
.locals 2
iget-object v0, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->flutterRenderer:Lio/flutter/embedding/engine/renderer/FlutterRenderer;
const-string v1, "FlutterSurfaceView"
if-eqz v0, :cond_1
.line 213
invoke-virtual {p0}, Lio/flutter/embedding/android/FlutterSurfaceView;->getWindowToken()Landroid/os/IBinder;
move-result-object v0
if-eqz v0, :cond_0
const-string v0, "Disconnecting FlutterRenderer from Android surface."
.line 214
invoke-static {v1, v0}, Lio/flutter/Log;->v(Ljava/lang/String;Ljava/lang/String;)V
.line 215
invoke-direct {p0}, Lio/flutter/embedding/android/FlutterSurfaceView;->disconnectSurfaceFromRenderer()V
.line 218
:cond_0
invoke-virtual {p0}, Lio/flutter/embedding/android/FlutterSurfaceView;->pause()V
const/4 v0, 0x0
.line 221
invoke-virtual {p0, v0}, Lio/flutter/embedding/android/FlutterSurfaceView;->setAlpha(F)V
iget-object v0, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->flutterRenderer:Lio/flutter/embedding/engine/renderer/FlutterRenderer;
iget-object v1, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->flutterUiDisplayListener:Lio/flutter/embedding/engine/renderer/FlutterUiDisplayListener;
.line 222
invoke-virtual {v0, v1}, Lio/flutter/embedding/engine/renderer/FlutterRenderer;->removeIsDisplayingFlutterUiListener(Lio/flutter/embedding/engine/renderer/FlutterUiDisplayListener;)V
const/4 v0, 0x0
iput-object v0, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->flutterRenderer:Lio/flutter/embedding/engine/renderer/FlutterRenderer;
goto :goto_0
:cond_1
const-string p0, "detachFromRenderer() invoked when no FlutterRenderer was attached."
.line 226
invoke-static {v1, p0}, Lio/flutter/Log;->w(Ljava/lang/String;Ljava/lang/String;)V
:goto_0
return-void
.end method
.method public gatherTransparentRegion(Landroid/graphics/Region;)Z
.locals 8
.line 151
invoke-virtual {p0}, Lio/flutter/embedding/android/FlutterSurfaceView;->getAlpha()F
move-result v0
const/high16 v1, 0x3f800000 # 1.0f
cmpg-float v0, v0, v1
const/4 v1, 0x0
if-gez v0, :cond_0
return v1
:cond_0
const/4 v0, 0x2
new-array v0, v0, [I
.line 155
invoke-virtual {p0, v0}, Lio/flutter/embedding/android/FlutterSurfaceView;->getLocationInWindow([I)V
aget v3, v0, v1
const/4 v1, 0x1
aget v4, v0, v1
.line 159
invoke-virtual {p0}, Lio/flutter/embedding/android/FlutterSurfaceView;->getRight()I
move-result v2
add-int/2addr v2, v3
invoke-virtual {p0}, Lio/flutter/embedding/android/FlutterSurfaceView;->getLeft()I
move-result v5
sub-int v5, v2, v5
aget v0, v0, v1
.line 160
invoke-virtual {p0}, Lio/flutter/embedding/android/FlutterSurfaceView;->getBottom()I
move-result v2
add-int/2addr v0, v2
invoke-virtual {p0}, Lio/flutter/embedding/android/FlutterSurfaceView;->getTop()I
move-result p0
sub-int v6, v0, p0
sget-object v7, Landroid/graphics/Region$Op;->DIFFERENCE:Landroid/graphics/Region$Op;
move-object v2, p1
.line 156
invoke-virtual/range {v2 .. v7}, Landroid/graphics/Region;->op(IIIILandroid/graphics/Region$Op;)Z
return v1
.end method
.method public getAttachedRenderer()Lio/flutter/embedding/engine/renderer/FlutterRenderer;
.locals 0
iget-object p0, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->flutterRenderer:Lio/flutter/embedding/engine/renderer/FlutterRenderer;
return-object p0
.end method
.method public pause()V
.locals 1
iget-object v0, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->flutterRenderer:Lio/flutter/embedding/engine/renderer/FlutterRenderer;
if-nez v0, :cond_0
const-string p0, "FlutterSurfaceView"
const-string v0, "pause() invoked when no FlutterRenderer was attached."
.line 236
invoke-static {p0, v0}, Lio/flutter/Log;->w(Ljava/lang/String;Ljava/lang/String;)V
return-void
:cond_0
const/4 v0, 0x1
iput-boolean v0, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->isPaused:Z
return-void
.end method
.method public resume()V
.locals 3
iget-object v0, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->flutterRenderer:Lio/flutter/embedding/engine/renderer/FlutterRenderer;
const-string v1, "FlutterSurfaceView"
if-nez v0, :cond_0
const-string p0, "resume() invoked when no FlutterRenderer was attached."
.line 244
invoke-static {v1, p0}, Lio/flutter/Log;->w(Ljava/lang/String;Ljava/lang/String;)V
return-void
:cond_0
iget-object v2, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->flutterUiDisplayListener:Lio/flutter/embedding/engine/renderer/FlutterUiDisplayListener;
.line 247
invoke-virtual {v0, v2}, Lio/flutter/embedding/engine/renderer/FlutterRenderer;->addIsDisplayingFlutterUiListener(Lio/flutter/embedding/engine/renderer/FlutterUiDisplayListener;)V
iget-boolean v0, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->isSurfaceAvailableForRendering:Z
if-eqz v0, :cond_1
const-string v0, "Surface is available for rendering. Connecting FlutterRenderer to Android surface."
.line 252
invoke-static {v1, v0}, Lio/flutter/Log;->v(Ljava/lang/String;Ljava/lang/String;)V
.line 255
invoke-direct {p0}, Lio/flutter/embedding/android/FlutterSurfaceView;->connectSurfaceToRenderer()V
:cond_1
const/4 v0, 0x0
iput-boolean v0, p0, Lio/flutter/embedding/android/FlutterSurfaceView;->isPaused:Z
return-void
.end method