ViewExposureManager.smali 16.8 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466
.class public final Lcom/bytedance/applog/exposure/ViewExposureManager;
.super Ljava/lang/Object;
.source ""


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/bytedance/applog/exposure/ViewExposureManager$a;
    }
.end annotation

.annotation runtime Lkotlin/Metadata;
    bv = {
        0x1,
        0x0,
        0x3
    }
    d1 = {
        "\u0000\\\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\u0008\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0008\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\u0008\u0005\n\u0002\u0018\u0002\n\u0002\u0008\u0002\n\u0002\u0018\u0002\n\u0002\u0008\u0004\u0018\u0000 #2\u00020\u0001:\u0001#B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u00a2\u0006\u0002\u0010\u0004J\u0010\u0010\u0016\u001a\u00020\u00172\u0006\u0010\u0018\u001a\u00020\u0007H\u0002J\u000e\u0010\u0019\u001a\u00020\u00172\u0006\u0010\u001a\u001a\u00020\u0008J\u000e\u0010\u001b\u001a\u00020\u00172\u0006\u0010\u001a\u001a\u00020\u0008J\u0018\u0010\u001b\u001a\u00020\u00172\u0006\u0010\u001a\u001a\u00020\u00082\u0008\u0010\u001c\u001a\u0004\u0018\u00010\u001dJ\u0016\u0010\u001e\u001a\u00020\u00172\u000c\u0010\u001f\u001a\u0008\u0012\u0004\u0012\u00020\u00170 H\u0002J\u001a\u0010!\u001a\u00020\u00172\u0006\u0010\u001a\u001a\u00020\u00082\u0008\u0010\u001c\u001a\u0004\u0018\u00010\u001dH\u0002J\u0008\u0010\"\u001a\u00020\u0017H\u0002R&\u0010\u0005\u001a\u001a\u0012\u0004\u0012\u00020\u0007\u0012\u0010\u0012\u000e\u0012\u0004\u0012\u00020\u0008\u0012\u0004\u0012\u00020\t0\u00060\u0006X\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0011\u0010\u0002\u001a\u00020\u0003\u00a2\u0006\u0008\n\u0000\u001a\u0004\u0008\n\u0010\u000bR\u000e\u0010\u000c\u001a\u00020\rX\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u000e\u001a\u00020\u000fX\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0010\u001a\u00020\u0011X\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0012\u001a\u00020\u0013X\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0014\u001a\u00020\u0015X\u0082\u000e\u00a2\u0006\u0002\n\u0000\u00a8\u0006$"
    }
    d2 = {
        "Lcom/bytedance/applog/exposure/ViewExposureManager;",
        "",
        "appLog",
        "Lcom/bytedance/applog/AppLogInstance;",
        "(Lcom/bytedance/applog/AppLogInstance;)V",
        "activitiesMap",
        "Ljava/util/WeakHashMap;",
        "Landroid/app/Activity;",
        "Landroid/view/View;",
        "Lcom/bytedance/applog/exposure/ViewExposureHolder;",
        "getAppLog",
        "()Lcom/bytedance/applog/AppLogInstance;",
        "checkTask",
        "Ljava/lang/Runnable;",
        "globalConfig",
        "Lcom/bytedance/applog/exposure/ViewExposureConfig;",
        "mainHandler",
        "Landroid/os/Handler;",
        "started",
        "",
        "viewTreeChangeObserver",
        "Lcom/bytedance/applog/exposure/ViewTreeChangeObserver;",
        "checkViewExposureFromActivity",
        "",
        "activity",
        "disposeViewExposure",
        "view",
        "observeViewExposure",
        "data",
        "Lcom/bytedance/applog/exposure/ViewExposureData;",
        "runSafely",
        "task",
        "Lkotlin/Function0;",
        "sendViewExposureEvent",
        "start",
        "Companion",
        "agent_liteChinaRelease"
    }
    k = 0x1
    mv = {
        0x1,
        0x1,
        0x10
    }
.end annotation


# static fields
.field public static final Companion:Lcom/bytedance/applog/exposure/ViewExposureManager$a;

.field public static final h:Lcom/bytedance/applog/exposure/ViewExposureConfig;


# instance fields
.field public final a:Ljava/util/WeakHashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/WeakHashMap<",
            "Landroid/app/Activity;",
            "Ljava/util/WeakHashMap<",
            "Landroid/view/View;",
            "Lcom/bytedance/bdtracker/o0;",
            ">;>;"
        }
    .end annotation
.end field

.field public b:Z

.field public c:Lcom/bytedance/bdtracker/r0;

.field public final d:Lcom/bytedance/applog/exposure/ViewExposureConfig;

.field public final e:Landroid/os/Handler;

.field public final f:Ljava/lang/Runnable;

.field public final g:Lcom/bytedance/bdtracker/d;
    .annotation build Lorg/jetbrains/annotations/NotNull;
    .end annotation
.end field


# direct methods
.method public static constructor <clinit>()V
    .locals 4

    new-instance v0, Lcom/bytedance/applog/exposure/ViewExposureManager$a;

    const/4 v1, 0x0

    invoke-direct {v0, v1}, Lcom/bytedance/applog/exposure/ViewExposureManager$a;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V

    sput-object v0, Lcom/bytedance/applog/exposure/ViewExposureManager;->Companion:Lcom/bytedance/applog/exposure/ViewExposureManager$a;

    new-instance v0, Lcom/bytedance/applog/exposure/ViewExposureConfig;

    const/high16 v2, 0x3f800000    # 1.0f

    invoke-static {v2}, Ljava/lang/Float;->valueOf(F)Ljava/lang/Float;

    move-result-object v2

    const/4 v3, 0x2

    invoke-direct {v0, v2, v1, v3, v1}, Lcom/bytedance/applog/exposure/ViewExposureConfig;-><init>(Ljava/lang/Float;Ljava/lang/Boolean;ILkotlin/jvm/internal/DefaultConstructorMarker;)V

    sput-object v0, Lcom/bytedance/applog/exposure/ViewExposureManager;->h:Lcom/bytedance/applog/exposure/ViewExposureConfig;

    return-void
.end method

.method public constructor <init>(Lcom/bytedance/bdtracker/d;)V
    .locals 2
    .param p1    # Lcom/bytedance/bdtracker/d;
        .annotation build Lorg/jetbrains/annotations/NotNull;
        .end annotation
    .end param

    const-string v0, "appLog"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

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

    iput-object p1, p0, Lcom/bytedance/applog/exposure/ViewExposureManager;->g:Lcom/bytedance/bdtracker/d;

    new-instance p1, Ljava/util/WeakHashMap;

    invoke-direct {p1}, Ljava/util/WeakHashMap;-><init>()V

    iput-object p1, p0, Lcom/bytedance/applog/exposure/ViewExposureManager;->a:Ljava/util/WeakHashMap;

    new-instance p1, Lcom/bytedance/bdtracker/r0;

    iget-object v0, p0, Lcom/bytedance/applog/exposure/ViewExposureManager;->g:Lcom/bytedance/bdtracker/d;

    .line 1
    iget-object v0, v0, Lcom/bytedance/bdtracker/d;->n:Landroid/app/Application;

    if-eqz v0, :cond_3

    .line 2
    invoke-direct {p1, v0}, Lcom/bytedance/bdtracker/r0;-><init>(Landroid/app/Application;)V

    iput-object p1, p0, Lcom/bytedance/applog/exposure/ViewExposureManager;->c:Lcom/bytedance/bdtracker/r0;

    iget-object p1, p0, Lcom/bytedance/applog/exposure/ViewExposureManager;->g:Lcom/bytedance/bdtracker/d;

    invoke-virtual {p1}, Lcom/bytedance/bdtracker/d;->getInitConfig()Lcom/bytedance/applog/InitConfig;

    move-result-object p1

    if-eqz p1, :cond_0

    invoke-virtual {p1}, Lcom/bytedance/applog/InitConfig;->getExposureConfig()Lcom/bytedance/applog/exposure/ViewExposureConfig;

    move-result-object p1

    if-eqz p1, :cond_0

    goto :goto_0

    :cond_0
    sget-object p1, Lcom/bytedance/applog/exposure/ViewExposureManager;->h:Lcom/bytedance/applog/exposure/ViewExposureConfig;

    :goto_0
    iput-object p1, p0, Lcom/bytedance/applog/exposure/ViewExposureManager;->d:Lcom/bytedance/applog/exposure/ViewExposureConfig;

    new-instance p1, Landroid/os/Handler;

    invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;

    move-result-object v0

    invoke-direct {p1, v0}, Landroid/os/Handler;-><init>(Landroid/os/Looper;)V

    iput-object p1, p0, Lcom/bytedance/applog/exposure/ViewExposureManager;->e:Landroid/os/Handler;

    new-instance p1, Lcom/bytedance/applog/exposure/ViewExposureManager$b;

    invoke-direct {p1, p0}, Lcom/bytedance/applog/exposure/ViewExposureManager$b;-><init>(Lcom/bytedance/applog/exposure/ViewExposureManager;)V

    iput-object p1, p0, Lcom/bytedance/applog/exposure/ViewExposureManager;->f:Ljava/lang/Runnable;

    iget-object p1, p0, Lcom/bytedance/applog/exposure/ViewExposureManager;->g:Lcom/bytedance/bdtracker/d;

    invoke-virtual {p1}, Lcom/bytedance/bdtracker/d;->getInitConfig()Lcom/bytedance/applog/InitConfig;

    move-result-object p1

    if-eqz p1, :cond_2

    invoke-virtual {p1}, Lcom/bytedance/applog/InitConfig;->isExposureEnabled()Z

    move-result p1

    const/4 v0, 0x1

    if-ne p1, v0, :cond_2

    .line 3
    iget-boolean p1, p0, Lcom/bytedance/applog/exposure/ViewExposureManager;->b:Z

    if-eqz p1, :cond_1

    goto :goto_1

    :cond_1
    iget-object p1, p0, Lcom/bytedance/applog/exposure/ViewExposureManager;->c:Lcom/bytedance/bdtracker/r0;

    new-instance v1, Lcom/bytedance/bdtracker/p0;

    invoke-direct {v1, p0}, Lcom/bytedance/bdtracker/p0;-><init>(Lcom/bytedance/applog/exposure/ViewExposureManager;)V

    invoke-virtual {p1, v1}, Lcom/bytedance/bdtracker/r0;->b(Lkotlin/jvm/functions/Function1;)V

    iget-object p1, p0, Lcom/bytedance/applog/exposure/ViewExposureManager;->c:Lcom/bytedance/bdtracker/r0;

    new-instance v1, Lcom/bytedance/bdtracker/q0;

    invoke-direct {v1, p0}, Lcom/bytedance/bdtracker/q0;-><init>(Lcom/bytedance/applog/exposure/ViewExposureManager;)V

    invoke-virtual {p1, v1}, Lcom/bytedance/bdtracker/r0;->a(Lkotlin/jvm/functions/Function1;)V

    iput-boolean v0, p0, Lcom/bytedance/applog/exposure/ViewExposureManager;->b:Z

    :cond_2
    :goto_1
    return-void

    .line 4
    :cond_3
    new-instance p1, Lkotlin/TypeCastException;

    const-string v0, "null cannot be cast to non-null type android.app.Application"

    invoke-direct {p1, v0}, Lkotlin/TypeCastException;-><init>(Ljava/lang/String;)V

    throw p1
.end method

.method public static final synthetic access$checkViewExposureFromActivity(Lcom/bytedance/applog/exposure/ViewExposureManager;Landroid/app/Activity;)V
    .locals 0

    invoke-virtual {p0, p1}, Lcom/bytedance/applog/exposure/ViewExposureManager;->a(Landroid/app/Activity;)V

    return-void
.end method

.method public static final synthetic access$getActivitiesMap$p(Lcom/bytedance/applog/exposure/ViewExposureManager;)Ljava/util/WeakHashMap;
    .locals 0

    iget-object p0, p0, Lcom/bytedance/applog/exposure/ViewExposureManager;->a:Ljava/util/WeakHashMap;

    return-object p0
.end method

.method public static final synthetic access$getCheckTask$p(Lcom/bytedance/applog/exposure/ViewExposureManager;)Ljava/lang/Runnable;
    .locals 0

    iget-object p0, p0, Lcom/bytedance/applog/exposure/ViewExposureManager;->f:Ljava/lang/Runnable;

    return-object p0
.end method

.method public static final synthetic access$getGlobalConfig$p(Lcom/bytedance/applog/exposure/ViewExposureManager;)Lcom/bytedance/applog/exposure/ViewExposureConfig;
    .locals 0

    iget-object p0, p0, Lcom/bytedance/applog/exposure/ViewExposureManager;->d:Lcom/bytedance/applog/exposure/ViewExposureConfig;

    return-object p0
.end method

.method public static final synthetic access$getMainHandler$p(Lcom/bytedance/applog/exposure/ViewExposureManager;)Landroid/os/Handler;
    .locals 0

    iget-object p0, p0, Lcom/bytedance/applog/exposure/ViewExposureManager;->e:Landroid/os/Handler;

    return-object p0
.end method

.method public static final synthetic access$getViewTreeChangeObserver$p(Lcom/bytedance/applog/exposure/ViewExposureManager;)Lcom/bytedance/bdtracker/r0;
    .locals 0

    iget-object p0, p0, Lcom/bytedance/applog/exposure/ViewExposureManager;->c:Lcom/bytedance/bdtracker/r0;

    return-object p0
.end method

.method public static final synthetic access$sendViewExposureEvent(Lcom/bytedance/applog/exposure/ViewExposureManager;Landroid/view/View;Lcom/bytedance/applog/exposure/ViewExposureData;)V
    .locals 0

    invoke-virtual {p0, p1, p2}, Lcom/bytedance/applog/exposure/ViewExposureManager;->a(Landroid/view/View;Lcom/bytedance/applog/exposure/ViewExposureData;)V

    return-void
.end method

.method public static final synthetic access$setViewTreeChangeObserver$p(Lcom/bytedance/applog/exposure/ViewExposureManager;Lcom/bytedance/bdtracker/r0;)V
    .locals 0

    iput-object p1, p0, Lcom/bytedance/applog/exposure/ViewExposureManager;->c:Lcom/bytedance/bdtracker/r0;

    return-void
.end method


# virtual methods
.method public final a(Landroid/app/Activity;)V
    .locals 1

    new-instance v0, Lcom/bytedance/applog/exposure/ViewExposureManager$c;

    invoke-direct {v0, p0, p1}, Lcom/bytedance/applog/exposure/ViewExposureManager$c;-><init>(Lcom/bytedance/applog/exposure/ViewExposureManager;Landroid/app/Activity;)V

    invoke-virtual {p0, v0}, Lcom/bytedance/applog/exposure/ViewExposureManager;->a(Lkotlin/jvm/functions/Function0;)V

    return-void
.end method

.method public final a(Landroid/view/View;Lcom/bytedance/applog/exposure/ViewExposureData;)V
    .locals 1

    new-instance v0, Lcom/bytedance/applog/exposure/ViewExposureManager$f;

    invoke-direct {v0, p0, p2, p1}, Lcom/bytedance/applog/exposure/ViewExposureManager$f;-><init>(Lcom/bytedance/applog/exposure/ViewExposureManager;Lcom/bytedance/applog/exposure/ViewExposureData;Landroid/view/View;)V

    invoke-virtual {p0, v0}, Lcom/bytedance/applog/exposure/ViewExposureManager;->a(Lkotlin/jvm/functions/Function0;)V

    return-void
.end method

.method public final a(Lkotlin/jvm/functions/Function0;)V
    .locals 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lkotlin/jvm/functions/Function0<",
            "Lkotlin/Unit;",
            ">;)V"
        }
    .end annotation

    :try_start_0
    invoke-interface {p1}, Lkotlin/jvm/functions/Function0;->invoke()Ljava/lang/Object;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception p1

    iget-object v0, p0, Lcom/bytedance/applog/exposure/ViewExposureManager;->g:Lcom/bytedance/bdtracker/d;

    .line 1
    iget-object v0, v0, Lcom/bytedance/bdtracker/d;->D:Lcom/bytedance/applog/log/IAppLogLogger;

    const/4 v1, 0x0

    .line 2
    new-array v1, v1, [Ljava/lang/Object;

    const/4 v2, 0x7

    const-string v3, "Run task failed"

    invoke-interface {v0, v2, v3, p1, v1}, Lcom/bytedance/applog/log/IAppLogLogger;->error(ILjava/lang/String;Ljava/lang/Throwable;[Ljava/lang/Object;)V

    :goto_0
    return-void
.end method

.method public final disposeViewExposure(Landroid/view/View;)V
    .locals 1
    .param p1    # Landroid/view/View;
        .annotation build Lorg/jetbrains/annotations/NotNull;
        .end annotation
    .end param

    const-string v0, "view"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    new-instance v0, Lcom/bytedance/applog/exposure/ViewExposureManager$d;

    invoke-direct {v0, p0, p1}, Lcom/bytedance/applog/exposure/ViewExposureManager$d;-><init>(Lcom/bytedance/applog/exposure/ViewExposureManager;Landroid/view/View;)V

    invoke-virtual {p0, v0}, Lcom/bytedance/applog/exposure/ViewExposureManager;->a(Lkotlin/jvm/functions/Function0;)V

    return-void
.end method

.method public final getAppLog()Lcom/bytedance/bdtracker/d;
    .locals 1
    .annotation build Lorg/jetbrains/annotations/NotNull;
    .end annotation

    iget-object v0, p0, Lcom/bytedance/applog/exposure/ViewExposureManager;->g:Lcom/bytedance/bdtracker/d;

    return-object v0
.end method

.method public final observeViewExposure(Landroid/view/View;)V
    .locals 1
    .param p1    # Landroid/view/View;
        .annotation build Lorg/jetbrains/annotations/NotNull;
        .end annotation
    .end param

    const-string v0, "view"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    const/4 v0, 0x0

    invoke-virtual {p0, p1, v0}, Lcom/bytedance/applog/exposure/ViewExposureManager;->observeViewExposure(Landroid/view/View;Lcom/bytedance/applog/exposure/ViewExposureData;)V

    return-void
.end method

.method public final observeViewExposure(Landroid/view/View;Lcom/bytedance/applog/exposure/ViewExposureData;)V
    .locals 1
    .param p1    # Landroid/view/View;
        .annotation build Lorg/jetbrains/annotations/NotNull;
        .end annotation
    .end param
    .param p2    # Lcom/bytedance/applog/exposure/ViewExposureData;
        .annotation build Lorg/jetbrains/annotations/Nullable;
        .end annotation
    .end param

    const-string v0, "view"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    new-instance v0, Lcom/bytedance/applog/exposure/ViewExposureManager$e;

    invoke-direct {v0, p0, p1, p2}, Lcom/bytedance/applog/exposure/ViewExposureManager$e;-><init>(Lcom/bytedance/applog/exposure/ViewExposureManager;Landroid/view/View;Lcom/bytedance/applog/exposure/ViewExposureData;)V

    invoke-virtual {p0, v0}, Lcom/bytedance/applog/exposure/ViewExposureManager;->a(Lkotlin/jvm/functions/Function0;)V

    return-void
.end method