text:
.class public final Lcom/android/server/print/PrintManagerService;
.super Landroid/print/IPrintManager$Stub;
.source "PrintManagerService.java"

# static fields
.field private static final COMPONENT_NAME_SEPARATOR:C = ':'

.field private static final EXTRA_PRINT_SERVICE_COMPONENT_NAME:Ljava/lang/String; = "EXTRA_PRINT_SERVICE_COMPONENT_NAME"

# instance fields
.field private final mContext:Landroid/content/Context;

.field private mCurrentUserId:I

.field private final mLock:Ljava/lang/Object;

.field private final mUserStates:Landroid/util/SparseArray;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Landroid/util/SparseArray",
            "<",
            "Lcom/android/server/print/UserState;",
            ">;"
        }
    .end annotation
.end field

# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .registers 3
    .param p1    # Landroid/content/Context;

    invoke-direct {p0}, Landroid/print/IPrintManager$Stub;-><init>()V

    new-instance v0, Ljava/lang/Object;

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

    iput-object v0, p0, Lcom/android/server/print/PrintManagerService;->mLock:Ljava/lang/Object;

    new-instance v0, Landroid/util/SparseArray;

    invoke-direct {v0}, Landroid/util/SparseArray;-><init>()V

    iput-object v0, p0, Lcom/android/server/print/PrintManagerService;->mUserStates:Landroid/util/SparseArray;

    const/4 v0, 0x0

    iput v0, p0, Lcom/android/server/print/PrintManagerService;->mCurrentUserId:I

    iput-object p1, p0, Lcom/android/server/print/PrintManagerService;->mContext:Landroid/content/Context;

    invoke-direct {p0}, Lcom/android/server/print/PrintManagerService;->registerContentObservers()V

    invoke-direct {p0}, Lcom/android/server/print/PrintManagerService;->registerBoradcastReceivers()V

    return-void
.end method

.method static synthetic access$000(Lcom/android/server/print/PrintManagerService;)Ljava/lang/Object;
    .registers 2
    .param p0    # Lcom/android/server/print/PrintManagerService;

    iget-object v0, p0, Lcom/android/server/print/PrintManagerService;->mLock:Ljava/lang/Object;

    return-object v0
.end method

.method static synthetic access$100(Lcom/android/server/print/PrintManagerService;)Lcom/android/server/print/UserState;
    .registers 2
    .param p0    # Lcom/android/server/print/PrintManagerService;

    invoke-direct {p0}, Lcom/android/server/print/PrintManagerService;->getCurrentUserStateLocked()Lcom/android/server/print/UserState;

    move-result-object v0

    return-object v0
.end method

.method static synthetic access$200(Lcom/android/server/print/PrintManagerService;I)Lcom/android/server/print/UserState;
    .registers 3
    .param p0    # Lcom/android/server/print/PrintManagerService;
    .param p1    # I

    invoke-direct {p0, p1}, Lcom/android/server/print/PrintManagerService;->getOrCreateUserStateLocked(I)Lcom/android/server/print/UserState;

    move-result-object v0

    return-object v0
.end method

.method static synthetic access$300(Lcom/android/server/print/PrintManagerService;)Landroid/content/Context;
    .registers 2
    .param p0    # Lcom/android/server/print/PrintManagerService;

    iget-object v0, p0, Lcom/android/server/print/PrintManagerService;->mContext:Landroid/content/Context;

    return-object v0
.end method

.method static synthetic access$400(Lcom/android/server/print/PrintManagerService;Landroid/content/ComponentName;Ljava/lang/String;I)V
    .registers 4
    .param p0    # Lcom/android/server/print/PrintManagerService;
    .param p1    # Landroid/content/ComponentName;
    .param p2    # Ljava/lang/String;
    .param p3    # I

    invoke-direct {p0, p1, p2, p3}, Lcom/android/server/print/PrintManagerService;->showEnableInstalledPrintServiceNotification(Landroid/content/ComponentName;Ljava/lang/String;I)V

    return-void
.end method

.method static synthetic access$500(Lcom/android/server/print/PrintManagerService;I)V
    .registers 2
    .param p0    # Lcom/android/server/print/PrintManagerService;
    .param p1    # I

    invoke-direct {p0, p1}, Lcom/android/server/print/PrintManagerService;->switchUser(I)V

    return-void
.end method

.method static synthetic access$600(Lcom/android/server/print/PrintManagerService;I)V
    .registers 2
    .param p0    # Lcom/android/server/print/PrintManagerService;
    .param p1    # I

    invoke-direct {p0, p1}, Lcom/android/server/print/PrintManagerService;->removeUser(I)V

    return-void
.end method

.method private getCurrentUserStateLocked()Lcom/android/server/print/UserState;
    .registers 2

    iget v0, p0, Lcom/android/server/print/PrintManagerService;->mCurrentUserId:I

    invoke-direct {p0, v0}, Lcom/android/server/print/PrintManagerService;->getOrCreateUserStateLocked(I)Lcom/android/server/print/UserState;

    move-result-object v0

    return-object v0
.end method

.method private getOrCreateUserStateLocked(I)Lcom/android/server/print/UserState;
    .registers 5
    .param p1    # I

    iget-object v1, p0, Lcom/android/server/print/PrintManagerService;->mUserStates:Landroid/util/SparseArray;

    invoke-virtual {v1, p1}, Landroid/util/SparseArray;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/android/server/print/UserState;

    if-nez v0, :cond_18

    new-instance v0, Lcom/android/server/print/UserState;

    iget-object v1, p0, Lcom/android/server/print/PrintManagerService;->mContext:Landroid/content/Context;

    iget-object v2, p0, Lcom/android/server/print/PrintManagerService;->mLock:Ljava/lang/Object;

    invoke-direct {v0, v1, p1, v2}, Lcom/android/server/print/UserState;-><init>(Landroid/content/Context;ILjava/lang/Object;)V

    iget-object v1, p0, Lcom/android/server/print/PrintManagerService;->mUserStates:Landroid/util/SparseArray;

    invoke-virtual {v1, p1, v0}, Landroid/util/SparseArray;->put(ILjava/lang/Object;)V

    :cond_18
    return-object v0
.end method

.method private registerBoradcastReceivers()V
    .registers 8

    new-instance v6, Lcom/android/server/print/PrintManagerService$3;

    invoke-direct {v6, p0}, Lcom/android/server/print/PrintManagerService$3;-><init>(Lcom/android/server/print/PrintManagerService;)V

    iget-object v0, p0, Lcom/android/server/print/PrintManagerService;->mContext:Landroid/content/Context;

    invoke-static {}, Lcom/android/internal/os/BackgroundThread;->getHandler()Landroid/os/Handler;

    move-result-object v1

    invoke-virtual {v1}, Landroid/os/Handler;->getLooper()Landroid/os/Looper;

    move-result-object v1

    sget-object v2, Landroid/os/UserHandle;->ALL:Landroid/os/UserHandle;

    const/4 v4, 0x1

    invoke-virtual {v6, v0, v1, v2, v4}, Lcom/android/internal/content/PackageMonitor;->register(Landroid/content/Context;Landroid/os/Looper;Landroid/os/UserHandle;Z)V

    new-instance v3, Landroid/content/IntentFilter;

    invoke-direct {v3}, Landroid/content/IntentFilter;-><init>()V

    const-string v0, "android.intent.action.USER_SWITCHED"

    invoke-virtual {v3, v0}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    const-string v0, "android.intent.action.USER_REMOVED"

    invoke-virtual {v3, v0}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    iget-object v0, p0, Lcom/android/server/print/PrintManagerService;->mContext:Landroid/content/Context;

    new-instance v1, Lcom/android/server/print/PrintManagerService$4;

    invoke-direct {v1, p0}, Lcom/android/server/print/PrintManagerService$4;-><init>(Lcom/android/server/print/PrintManagerService;)V

    sget-object v2, Landroid/os/UserHandle;->ALL:Landroid/os/UserHandle;

    const/4 v4, 0x0

    invoke-static {}, Lcom/android/internal/os/BackgroundThread;->getHandler()Landroid/os/Handler;

    move-result-object v5

    invoke-virtual/range {v0 .. v5}, Landroid/content/Context;->registerReceiverAsUser(Landroid/content/BroadcastReceiver;Landroid/os/UserHandle;Landroid/content/IntentFilter;Ljava/lang/String;Landroid/os/Handler;)Landroid/content/Intent;

    return-void
.end method

.method private registerContentObservers()V
    .registers 6

    const-string v2, "enabled_print_services"

    invoke-static {v2}, Landroid/provider/Settings$Secure;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v0

    new-instance v1, Lcom/android/server/print/PrintManagerService$2;

    invoke-static {}, Lcom/android/internal/os/BackgroundThread;->getHandler()Landroid/os/Handler;

    move-result-object v2

    invoke-direct {v1, p0, v2, v0}, Lcom/android/server/print/PrintManagerService$2;-><init>(Lcom/android/server/print/PrintManagerService;Landroid/os/Handler;Landroid/net/Uri;)V

    iget-object v2, p0, Lcom/android/server/print/PrintManagerService;->mContext:Landroid/content/Context;

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

    move-result-object v2

    const/4 v3, 0x0

    const/4 v4, -0x1

    invoke-virtual {v2, v0, v3, v1, v4}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V

    return-void
.end method

.method private removeUser(I)V
    .registers 5
    .param p1    # I

    iget-object v2, p0, Lcom/android/server/print/PrintManagerService;->mLock:Ljava/lang/Object;

    monitor-enter v2

    :try_start_3
    iget-object v1, p0, Lcom/android/server/print/PrintManagerService;->mUserStates:Landroid/util/SparseArray;

    invoke-virtual {v1, p1}, Landroid/util/SparseArray;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/android/server/print/UserState;

    if-eqz v0, :cond_15

    invoke-virtual {v0}, Lcom/android/server/print/UserState;->destroyLocked()V

    iget-object v1, p0, Lcom/android/server/print/PrintManagerService;->mUserStates:Landroid/util/SparseArray;

    invoke-virtual {v1, p1}, Landroid/util/SparseArray;->remove(I)V

    :cond_15
    monitor-exit v2

    return-void

    :catchall_17
    move-exception v1

    monitor-exit v2
    :try_end_19
    .catchall {:try_start_3 .. :try_end_19} :catchall_17

    throw v1
.end method

.method private resolveCallingAppEnforcingPermissions(I)I
    .registers 7
    .param p1    # I

    invoke-static {}, Landroid/os/Binder;->getCallingUid()I

    move-result v1

    if-eqz v1, :cond_e

    const/16 v2, 0x3e8

    if-eq v1, v2, :cond_e

    const/16 v2, 0x7d0

    if-ne v1, v2, :cond_f

    :cond_e
    return p1

    :cond_f
    invoke-static {v1}, Landroid/os/UserHandle;->getAppId(I)I

    move-result v0

    if-eq p1, v0, :cond_e

    iget-object v2, p0, Lcom/android/server/print/PrintManagerService;->mContext:Landroid/content/Context;

    const-string v3, "com.android.printspooler.permission.ACCESS_ALL_PRINT_JOBS"

    invoke-virtual {v2, v3}, Landroid/content/Context;->checkCallingPermission(Ljava/lang/String;)I

    move-result v2

    if-eqz v2, :cond_e

    new-instance v2, Ljava/lang/SecurityException;

    new-instance v3, Ljava/lang/StringBuilder;

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

    const-string v4, "Call from app "

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

    move-result-object v3

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, " as app "

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

    move-result-object v3

    invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, " without com.android.printspooler.permission"

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

    move-result-object v3

    const-string v4, ".ACCESS_ALL_PRINT_JOBS"

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

    move-result-object v3

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

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/lang/SecurityException;-><init>(Ljava/lang/String;)V

    throw v2
.end method

.method private resolveCallingPackageNameEnforcingSecurity(Ljava/lang/String;)Ljava/lang/String;
    .registers 8
    .param p1    # Ljava/lang/String;

    const/4 v3, 0x0

    invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v4

    if-eqz v4, :cond_9

    move-object p1, v3

    :cond_8
    :goto_8
    return-object p1

    :cond_9
    iget-object v4, p0, Lcom/android/server/print/PrintManagerService;->mContext:Landroid/content/Context;

    invoke-virtual {v4}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v4

    invoke-static {}, Landroid/os/Binder;->getCallingUid()I

    move-result v5

    invoke-virtual {v4, v5}, Landroid/content/pm/PackageManager;->getPackagesForUid(I)[Ljava/lang/String;

    move-result-object v2

    array-length v1, v2

    const/4 v0, 0x0

    :goto_19
    if-ge v0, v1, :cond_26

    aget-object v4, v2, v0

    invoke-virtual {p1, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-nez v4, :cond_8

    add-int/lit8 v0, v0, 0x1

    goto :goto_19

    :cond_26
    move-object p1, v3

    goto :goto_8
.end method

.method private resolveCallingUserEnforcingPermissions(I)I
    .registers 7
    .param p1    # I

    const/4 v4, -0x3

    invoke-static {}, Landroid/os/Binder;->getCallingUid()I

    move-result v0

    if-eqz v0, :cond_f

    const/16 v2, 0x3e8

    if-eq v0, v2, :cond_f

    const/16 v2, 0x7d0

    if-ne v0, v2, :cond_10

    :cond_f
    :goto_f
    return p1

    :cond_10
    invoke-static {v0}, Landroid/os/UserHandle;->getUserId(I)I

    move-result v1

    if-eq v1, p1, :cond_f

    iget-object v2, p0, Lcom/android/server/print/PrintManagerService;->mContext:Landroid/content/Context;

    const-string v3, "android.permission.INTERACT_ACROSS_USERS_FULL"

    invoke-virtual {v2, v3}, Landroid/content/Context;->checkCallingPermission(Ljava/lang/String;)I

    move-result v2

    if-nez v2, :cond_2a

    iget-object v2, p0, Lcom/android/server/print/PrintManagerService;->mContext:Landroid/content/Context;

    const-string v3, "android.permission.INTERACT_ACROSS_USERS"

    invoke-virtual {v2, v3}, Landroid/content/Context;->checkCallingPermission(Ljava/lang/String;)I

    move-result v2

    if-eqz v2, :cond_5d

    :cond_2a
    if-ne p1, v4, :cond_2e

    move p1, v1

    goto :goto_f

    :cond_2e
    new-instance v2, Ljava/lang/SecurityException;

    new-instance v3, Ljava/lang/StringBuilder;

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

    const-string v4, "Call from user "

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

    move-result-object v3

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

    move-result-object v3

    const-string v4, " as user "

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

    move-result-object v3

    invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, " without permission INTERACT_ACROSS_USERS or "

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

    move-result-object v3

    const-string v4, "INTERACT_ACROSS_USERS_FULL not allowed."

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

    move-result-object v3

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

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/lang/SecurityException;-><init>(Ljava/lang/String;)V

    throw v2

    :cond_5d
    const/4 v2, -0x2

    if-eq p1, v2, :cond_62

    if-ne p1, v4, :cond_65

    :cond_62
    iget p1, p0, Lcom/android/server/print/PrintManagerService;->mCurrentUserId:I

    goto :goto_f

    :cond_65
    new-instance v2, Ljava/lang/IllegalArgumentException;

    const-string v3, "Calling user can be changed to only UserHandle.USER_CURRENT or UserHandle.USER_CURRENT_OR_SELF."

    invoke-direct {v2, v3}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v2
.end method

.method private showEnableInstalledPrintServiceNotification(Landroid/content/ComponentName;Ljava/lang/String;I)V
    .registers 16
    .param p1    # Landroid/content/ComponentName;
    .param p2    # Ljava/lang/String;
    .param p3    # I

    const/4 v11, 0x1

    const/4 v1, 0x0

    new-instance v5, Landroid/os/UserHandle;

    invoke-direct {v5, p3}, Landroid/os/UserHandle;-><init>(I)V

    new-instance v2, Landroid/content/Intent;

    const-string v0, "android.settings.ACTION_PRINT_SETTINGS"

    invoke-direct {v2, v0}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    const-string v0, "EXTRA_PRINT_SERVICE_COMPONENT_NAME"

    invoke-virtual {p1}, Landroid/content/ComponentName;->flattenToString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v0, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    iget-object v0, p0, Lcom/android/server/print/PrintManagerService;->mContext:Landroid/content/Context;

    const/high16 v3, 0x50000000

    const/4 v4, 0x0

    invoke-static/range {v0 .. v5}, Landroid/app/PendingIntent;->getActivityAsUser(Landroid/content/Context;ILandroid/content/Intent;ILandroid/os/Bundle;Landroid/os/UserHandle;)Landroid/app/PendingIntent;

    move-result-object v9

    new-instance v0, Landroid/app/Notification$Builder;

    iget-object v3, p0, Lcom/android/server/print/PrintManagerService;->mContext:Landroid/content/Context;

    invoke-direct {v0, v3}, Landroid/app/Notification$Builder;-><init>(Landroid/content/Context;)V

    const v3, 0x1080390

    invoke-virtual {v0, v3}, Landroid/app/Notification$Builder;->setSmallIcon(I)Landroid/app/Notification$Builder;

    move-result-object v0

    iget-object v3, p0, Lcom/android/server/print/PrintManagerService;->mContext:Landroid/content/Context;

    const v4, 0x10405e7

    new-array v10, v11, [Ljava/lang/Object;

    aput-object p2, v10, v1

    invoke-virtual {v3, v4, v10}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Landroid/app/Notification$Builder;->setContentTitle(Ljava/lang/CharSequence;)Landroid/app/Notification$Builder;

    move-result-object v0

    iget-object v3, p0, Lcom/android/server/print/PrintManagerService;->mContext:Landroid/content/Context;

    const v4, 0x10405e8

    invoke-virtual {v3, v4}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Landroid/app/Notification$Builder;->setContentText(Ljava/lang/CharSequence;)Landroid/app/Notification$Builder;

    move-result-object v0

    invoke-virtual {v0, v9}, Landroid/app/Notification$Builder;->setContentIntent(Landroid/app/PendingIntent;)Landroid/app/Notification$Builder;

    move-result-object v0

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v3

    invoke-virtual {v0, v3, v4}, Landroid/app/Notification$Builder;->setWhen(J)Landroid/app/Notification$Builder;

    move-result-object v0

    invoke-virtual {v0, v11}, Landroid/app/Notification$Builder;->setAutoCancel(Z)Landroid/app/Notification$Builder;

    move-result-object v0

    invoke-virtual {v0, v11}, Landroid/app/Notification$Builder;->setShowWhen(Z)Landroid/app/Notification$Builder;

    move-result-object v6

    iget-object v0, p0, Lcom/android/server/print/PrintManagerService;->mContext:Landroid/content/Context;

    const-string v3, "notification"

    invoke-virtual {v0, v3}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v7

    check-cast v7, Landroid/app/NotificationManager;

    new-instance v0, Ljava/lang/StringBuilder;

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

    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v3

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

    move-result-object v0

    const-string v3, ":"

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

    move-result-object v0

    invoke-virtual {p1}, Landroid/content/ComponentName;->flattenToString()Ljava/lang/String;

    move-result-object v3

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

    move-result-object v0

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

    move-result-object v8

    invoke-virtual {v6}, Landroid/app/Notification$Builder;->build()Landroid/app/Notification;

    move-result-object v0

    invoke-virtual {v7, v8, v1, v0, v5}, Landroid/app/NotificationManager;->notifyAsUser(Ljava/lang/String;ILandroid/app/Notification;Landroid/os/UserHandle;)V

    return-void
.end method

.method private switchUser(I)V
    .registers 6
    .param p1    # I

    iget-object v2, p0, Lcom/android/server/print/PrintManagerService;->mLock:Ljava/lang/Object;

    monitor-enter v2

    :try_start_3
    iget v1, p0, Lcom/android/server/print/PrintManagerService;->mCurrentUserId:I

    if-ne p1, v1, :cond_9

    monitor-exit v2

    :goto_8
    return-void

    :cond_9
    iput p1, p0, Lcom/android/server/print/PrintManagerService;->mCurrentUserId:I

    iget-object v1, p0, Lcom/android/server/print/PrintManagerService;->mUserStates:Landroid/util/SparseArray;

    iget v3, p0, Lcom/android/server/print/PrintManagerService;->mCurrentUserId:I

    invoke-virtual {v1, v3}, Landroid/util/SparseArray;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/android/server/print/UserState;

    if-nez v0, :cond_23

    invoke-direct {p0}, Lcom/android/server/print/PrintManagerService;->getCurrentUserStateLocked()Lcom/android/server/print/UserState;

    move-result-object v0

    invoke-virtual {v0}, Lcom/android/server/print/UserState;->updateIfNeededLocked()V

    :goto_1e
    monitor-exit v2
    :try_end_1f
    .catchall {:try_start_3 .. :try_end_1f} :catchall_27

    invoke-virtual {v0}, Lcom/android/server/print/UserState;->removeObsoletePrintJobs()V

    goto :goto_8

    :cond_23
    :try_start_23
    invoke-virtual {v0}, Lcom/android/server/print/UserState;->updateIfNeededLocked()V

    goto :goto_1e

    :catchall_27
    move-exception v1

    monitor-exit v2
    :try_end_29
    .catchall {:try_start_23 .. :try_end_29} :catchall_27

    throw v1
.end method

# virtual methods
.method public addPrintJobStateChangeListener(Landroid/print/IPrintJobStateChangeListener;II)V
    .registers 11
    .param p1    # Landroid/print/IPrintJobStateChangeListener;
    .param p2    # I
    .param p3    # I
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    invoke-direct {p0, p3}, Lcom/android/server/print/PrintManagerService;->resolveCallingUserEnforcingPermissions(I)I

    move-result v3

    invoke-direct {p0, p2}, Lcom/android/server/print/PrintManagerService;->resolveCallingAppEnforcingPermissions(I)I

    move-result v2

    iget-object v6, p0, Lcom/android/server/print/PrintManagerService;->mLock:Ljava/lang/Object;

    monitor-enter v6

    :try_start_b
    invoke-direct {p0, v3}, Lcom/android/server/print/PrintManagerService;->getOrCreateUserStateLocked(I)Lcom/android/server/print/UserState;

    move-result-object v4

    monitor-exit v6
    :try_end_10
    .catchall {:try_start_b .. :try_end_10} :catchall_1b

    invoke-static {}, Landroid/os/Binder;->clearCallingIdentity()J

    move-result-wide v0

    :try_start_14
    invoke-virtual {v4, p1, v2}, Lcom/android/server/print/UserState;->addPrintJobStateChangeListener(Landroid/print/IPrintJobStateChangeListener;I)V
    :try_end_17
    .catchall {:try_start_14 .. :try_end_17} :catchall_1e

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    return-void

    :catchall_1b
    move-exception v5

    :try_start_1c
    monitor-exit v6
    :try_end_1d
    .catchall {:try_start_1c .. :try_end_1d} :catchall_1b

    throw v5

    :catchall_1e
    move-exception v5

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    throw v5
.end method

.method public cancelPrintJob(Landroid/print/PrintJobId;II)V
    .registers 11
    .param p1    # Landroid/print/PrintJobId;
    .param p2    # I
    .param p3    # I

    invoke-direct {p0, p2}, Lcom/android/server/print/PrintManagerService;->resolveCallingAppEnforcingPermissions(I)I

    move-result v2

    invoke-direct {p0, p3}, Lcom/android/server/print/PrintManagerService;->resolveCallingUserEnforcingPermissions(I)I

    move-result v3

    iget-object v6, p0, Lcom/android/server/print/PrintManagerService;->mLock:Ljava/lang/Object;

    monitor-enter v6

    :try_start_b
    invoke-direct {p0, v3}, Lcom/android/server/print/PrintManagerService;->getOrCreateUserStateLocked(I)Lcom/android/server/print/UserState;

    move-result-object v4

    monitor-exit v6
    :try_end_10
    .catchall {:try_start_b .. :try_end_10} :catchall_1b

    invoke-static {}, Landroid/os/Binder;->clearCallingIdentity()J

    move-result-wide v0

    :try_start_14
    invoke-virtual {v4, p1, v2}, Lcom/android/server/print/UserState;->cancelPrintJob(Landroid/print/PrintJobId;I)V
    :try_end_17
    .catchall {:try_start_14 .. :try_end_17} :catchall_1e

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    return-void

    :catchall_1b
    move-exception v5

    :try_start_1c
    monitor-exit v6
    :try_end_1d
    .catchall {:try_start_1c .. :try_end_1d} :catchall_1b

    throw v5

    :catchall_1e
    move-exception v5

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    throw v5
.end method

.method public createPrinterDiscoverySession(Landroid/print/IPrinterDiscoveryObserver;I)V
    .registers 9
    .param p1    # Landroid/print/IPrinterDiscoveryObserver;
    .param p2    # I

    invoke-direct {p0, p2}, Lcom/android/server/print/PrintManagerService;->resolveCallingUserEnforcingPermissions(I)I

    move-result v2

    iget-object v5, p0, Lcom/android/server/print/PrintManagerService;->mLock:Ljava/lang/Object;

    monitor-enter v5

    :try_start_7
    invoke-direct {p0, v2}, Lcom/android/server/print/PrintManagerService;->getOrCreateUserStateLocked(I)Lcom/android/server/print/UserState;

    move-result-object v3

    monitor-exit v5
    :try_end_c
    .catchall {:try_start_7 .. :try_end_c} :catchall_17

    invoke-static {}, Landroid/os/Binder;->clearCallingIdentity()J

    move-result-wide v0

    :try_start_10
    invoke-virtual {v3, p1}, Lcom/android/server/print/UserState;->createPrinterDiscoverySession(Landroid/print/IPrinterDiscoveryObserver;)V
    :try_end_13
    .catchall {:try_start_10 .. :try_end_13} :catchall_1a

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    return-void

    :catchall_17
    move-exception v4

    :try_start_18
    monitor-exit v5
    :try_end_19
    .catchall {:try_start_18 .. :try_end_19} :catchall_17

    throw v4

    :catchall_1a
    move-exception v4

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    throw v4
.end method

.method public destroyPrinterDiscoverySession(Landroid/print/IPrinterDiscoveryObserver;I)V
    .registers 9
    .param p1    # Landroid/print/IPrinterDiscoveryObserver;
    .param p2    # I

    invoke-direct {p0, p2}, Lcom/android/server/print/PrintManagerService;->resolveCallingUserEnforcingPermissions(I)I

    move-result v2

    iget-object v5, p0, Lcom/android/server/print/PrintManagerService;->mLock:Ljava/lang/Object;

    monitor-enter v5

    :try_start_7
    invoke-direct {p0, v2}, Lcom/android/server/print/PrintManagerService;->getOrCreateUserStateLocked(I)Lcom/android/server/print/UserState;

    move-result-object v3

    monitor-exit v5
    :try_end_c
    .catchall {:try_start_7 .. :try_end_c} :catchall_17

    invoke-static {}, Landroid/os/Binder;->clearCallingIdentity()J

    move-result-wide v0

    :try_start_10
    invoke-virtual {v3, p1}, Lcom/android/server/print/UserState;->destroyPrinterDiscoverySession(Landroid/print/IPrinterDiscoveryObserver;)V
    :try_end_13
    .catchall {:try_start_10 .. :try_end_13} :catchall_1a

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    return-void

    :catchall_17
    move-exception v4

    :try_start_18
    monitor-exit v5
    :try_end_19
    .catchall {:try_start_18 .. :try_end_19} :catchall_17

    throw v4

    :catchall_1a
    move-exception v4

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    throw v4
.end method

.method public dump(Ljava/io/FileDescriptor;Ljava/io/PrintWriter;[Ljava/lang/String;)V
    .registers 9
    .param p1    # Ljava/io/FileDescriptor;
    .param p2    # Ljava/io/PrintWriter;
    .param p3    # [Ljava/lang/String;

    iget-object v3, p0, Lcom/android/server/print/PrintManagerService;->mContext:Landroid/content/Context;

    const-string v4, "android.permission.DUMP"

    invoke-virtual {v3, v4}, Landroid/content/Context;->checkCallingOrSelfPermission(Ljava/lang/String;)I

    move-result v3

    if-eqz v3, :cond_33

    new-instance v3, Ljava/lang/StringBuilder;

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

    const-string v4, "Permission Denial: can\'t dump PrintManager from from pid="

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

    move-result-object v3

    invoke-static {}, Landroid/os/Binder;->getCallingPid()I

    move-result v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, ", uid="

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

    move-result-object v3

    invoke-static {}, Landroid/os/Binder;->getCallingUid()I

    move-result v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v3

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

    move-result-object v3

    invoke-virtual {p2, v3}, Ljava/io/PrintWriter;->println(Ljava/lang/String;)V

    :goto_32
    return-void

    :cond_33
    iget-object v4, p0, Lcom/android/server/print/PrintManagerService;->mLock:Ljava/lang/Object;

    monitor-enter v4

    :try_start_36
    const-string v3, "PRINT MANAGER STATE (dumpsys print)"

    invoke-virtual {p2, v3}, Ljava/io/PrintWriter;->println(Ljava/lang/String;)V

    iget-object v3, p0, Lcom/android/server/print/PrintManagerService;->mUserStates:Landroid/util/SparseArray;

    invoke-virtual {v3}, Landroid/util/SparseArray;->size()I

    move-result v2

    const/4 v0, 0x0

    :goto_42
    if-ge v0, v2, :cond_57

    iget-object v3, p0, Lcom/android/server/print/PrintManagerService;->mUserStates:Landroid/util/SparseArray;

    invoke-virtual {v3, v0}, Landroid/util/SparseArray;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/android/server/print/UserState;

    const-string v3, ""

    invoke-virtual {v1, p1, p2, v3}, Lcom/android/server/print/UserState;->dump(Ljava/io/FileDescriptor;Ljava/io/PrintWriter;Ljava/lang/String;)V

    invoke-virtual {p2}, Ljava/io/PrintWriter;->println()V

    add-int/lit8 v0, v0, 0x1

    goto :goto_42

    :cond_57
    monitor-exit v4

    goto :goto_32

    :catchall_59
    move-exception v3

    monitor-exit v4
    :try_end_5b
    .catchall {:try_start_36 .. :try_end_5b} :catchall_59

    throw v3
.end method

.method public getEnabledPrintServices(I)Ljava/util/List;
    .registers 8
    .param p1    # I
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(I)",
            "Ljava/util/List",
            "<",
            "Landroid/printservice/PrintServiceInfo;",
            ">;"
        }
    .end annotation

    invoke-direct {p0, p1}, Lcom/android/server/print/PrintManagerService;->resolveCallingUserEnforcingPermissions(I)I

    move-result v2

    iget-object v5, p0, Lcom/android/server/print/PrintManagerService;->mLock:Ljava/lang/Object;

    monitor-enter v5

    :try_start_7
    invoke-direct {p0, v2}, Lcom/android/server/print/PrintManagerService;->getOrCreateUserStateLocked(I)Lcom/android/server/print/UserState;

    move-result-object v3

    monitor-exit v5
    :try_end_c
    .catchall {:try_start_7 .. :try_end_c} :catchall_18

    invoke-static {}, Landroid/os/Binder;->clearCallingIdentity()J

    move-result-wide v0

    :try_start_10
    invoke-virtual {v3}, Lcom/android/server/print/UserState;->getEnabledPrintServices()Ljava/util/List;
    :try_end_13
    .catchall {:try_start_10 .. :try_end_13} :catchall_1b

    move-result-object v4

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    return-object v4

    :catchall_18
    move-exception v4

    :try_start_19
    monitor-exit v5
    :try_end_1a
    .catchall {:try_start_19 .. :try_end_1a} :catchall_18

    throw v4

    :catchall_1b
    move-exception v4

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    throw v4
.end method

.method public getInstalledPrintServices(I)Ljava/util/List;
    .registers 8
    .param p1    # I
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(I)",
            "Ljava/util/List",
            "<",
            "Landroid/printservice/PrintServiceInfo;",
            ">;"
        }
    .end annotation

    invoke-direct {p0, p1}, Lcom/android/server/print/PrintManagerService;->resolveCallingUserEnforcingPermissions(I)I

    move-result v2

    iget-object v5, p0, Lcom/android/server/print/PrintManagerService;->mLock:Ljava/lang/Object;

    monitor-enter v5

    :try_start_7
    invoke-direct {p0, v2}, Lcom/android/server/print/PrintManagerService;->getOrCreateUserStateLocked(I)Lcom/android/server/print/UserState;

    move-result-object v3

    monitor-exit v5
    :try_end_c
    .catchall {:try_start_7 .. :try_end_c} :catchall_18

    invoke-static {}, Landroid/os/Binder;->clearCallingIdentity()J

    move-result-wide v0

    :try_start_10
    invoke-virtual {v3}, Lcom/android/server/print/UserState;->getInstalledPrintServices()Ljava/util/List;
    :try_end_13
    .catchall {:try_start_10 .. :try_end_13} :catchall_1b

    move-result-object v4

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    return-object v4

    :catchall_18
    move-exception v4

    :try_start_19
    monitor-exit v5
    :try_end_1a
    .catchall {:try_start_19 .. :try_end_1a} :catchall_18

    throw v4

    :catchall_1b
    move-exception v4

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    throw v4
.end method

.method public getPrintJobInfo(Landroid/print/PrintJobId;II)Landroid/print/PrintJobInfo;
    .registers 11
    .param p1    # Landroid/print/PrintJobId;
    .param p2    # I
    .param p3    # I

    invoke-direct {p0, p2}, Lcom/android/server/print/PrintManagerService;->resolveCallingAppEnforcingPermissions(I)I

    move-result v2

    invoke-direct {p0, p3}, Lcom/android/server/print/PrintManagerService;->resolveCallingUserEnforcingPermissions(I)I

    move-result v3

    iget-object v6, p0, Lcom/android/server/print/PrintManagerService;->mLock:Ljava/lang/Object;

    monitor-enter v6

    :try_start_b
    invoke-direct {p0, v3}, Lcom/android/server/print/PrintManagerService;->getOrCreateUserStateLocked(I)Lcom/android/server/print/UserState;

    move-result-object v4

    monitor-exit v6
    :try_end_10
    .catchall {:try_start_b .. :try_end_10} :catchall_1c

    invoke-static {}, Landroid/os/Binder;->clearCallingIdentity()J

    move-result-wide v0

    :try_start_14
    invoke-virtual {v4, p1, v2}, Lcom/android/server/print/UserState;->getPrintJobInfo(Landroid/print/PrintJobId;I)Landroid/print/PrintJobInfo;
    :try_end_17
    .catchall {:try_start_14 .. :try_end_17} :catchall_1f

    move-result-object v5

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    return-object v5

    :catchall_1c
    move-exception v5

    :try_start_1d
    monitor-exit v6
    :try_end_1e
    .catchall {:try_start_1d .. :try_end_1e} :catchall_1c

    throw v5

    :catchall_1f
    move-exception v5

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    throw v5
.end method

.method public getPrintJobInfos(II)Ljava/util/List;
    .registers 10
    .param p1    # I
    .param p2    # I
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(II)",
            "Ljava/util/List",
            "<",
            "Landroid/print/PrintJobInfo;",
            ">;"
        }
    .end annotation

    invoke-direct {p0, p1}, Lcom/android/server/print/PrintManagerService;->resolveCallingAppEnforcingPermissions(I)I

    move-result v2

    invoke-direct {p0, p2}, Lcom/android/server/print/PrintManagerService;->resolveCallingUserEnforcingPermissions(I)I

    move-result v3

    iget-object v6, p0, Lcom/android/server/print/PrintManagerService;->mLock:Ljava/lang/Object;

    monitor-enter v6

    :try_start_b
    invoke-direct {p0, v3}, Lcom/android/server/print/PrintManagerService;->getOrCreateUserStateLocked(I)Lcom/android/server/print/UserState;

    move-result-object v4

    monitor-exit v6
    :try_end_10
    .catchall {:try_start_b .. :try_end_10} :catchall_1c

    invoke-static {}, Landroid/os/Binder;->clearCallingIdentity()J

    move-result-wide v0

    :try_start_14
    invoke-virtual {v4, v2}, Lcom/android/server/print/UserState;->getPrintJobInfos(I)Ljava/util/List;
    :try_end_17
    .catchall {:try_start_14 .. :try_end_17} :catchall_1f

    move-result-object v5

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    return-object v5

    :catchall_1c
    move-exception v5

    :try_start_1d
    monitor-exit v6
    :try_end_1e
    .catchall {:try_start_1d .. :try_end_1e} :catchall_1c

    throw v5

    :catchall_1f
    move-exception v5

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    throw v5
.end method

.method public print(Ljava/lang/String;Landroid/print/IPrintDocumentAdapter;Landroid/print/PrintAttributes;Ljava/lang/String;II)Landroid/os/Bundle;
    .registers 16
    .param p1    # Ljava/lang/String;
    .param p2    # Landroid/print/IPrintDocumentAdapter;
    .param p3    # Landroid/print/PrintAttributes;
    .param p4    # Ljava/lang/String;
    .param p5    # I
    .param p6    # I

    invoke-direct {p0, p5}, Lcom/android/server/print/PrintManagerService;->resolveCallingAppEnforcingPermissions(I)I

    move-result v5

    invoke-direct {p0, p6}, Lcom/android/server/print/PrintManagerService;->resolveCallingUserEnforcingPermissions(I)I

    move-result v8

    invoke-direct {p0, p4}, Lcom/android/server/print/PrintManagerService;->resolveCallingPackageNameEnforcingSecurity(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    iget-object v2, p0, Lcom/android/server/print/PrintManagerService;->mLock:Ljava/lang/Object;

    monitor-enter v2

    :try_start_f
    invoke-direct {p0, v8}, Lcom/android/server/print/PrintManagerService;->getOrCreateUserStateLocked(I)Lcom/android/server/print/UserState;

    move-result-object v0

    monitor-exit v2
    :try_end_14
    .catchall {:try_start_f .. :try_end_14} :catchall_23

    invoke-static {}, Landroid/os/Binder;->clearCallingIdentity()J

    move-result-wide v6

    move-object v1, p1

    move-object v2, p2

    move-object v3, p3

    :try_start_1b
    invoke-virtual/range {v0 .. v5}, Lcom/android/server/print/UserState;->print(Ljava/lang/String;Landroid/print/IPrintDocumentAdapter;Landroid/print/PrintAttributes;Ljava/lang/String;I)Landroid/os/Bundle;
    :try_end_1e
    .catchall {:try_start_1b .. :try_end_1e} :catchall_26

    move-result-object v1

    invoke-static {v6, v7}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    return-object v1

    :catchall_23
    move-exception v1

    :try_start_24
    monitor-exit v2
    :try_end_25
    .catchall {:try_start_24 .. :try_end_25} :catchall_23

    throw v1

    :catchall_26
    move-exception v1

    invoke-static {v6, v7}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    throw v1
.end method

.method public removePrintJobStateChangeListener(Landroid/print/IPrintJobStateChangeListener;I)V
    .registers 9
    .param p1    # Landroid/print/IPrintJobStateChangeListener;
    .param p2    # I

    invoke-direct {p0, p2}, Lcom/android/server/print/PrintManagerService;->resolveCallingUserEnforcingPermissions(I)I

    move-result v2

    iget-object v5, p0, Lcom/android/server/print/PrintManagerService;->mLock:Ljava/lang/Object;

    monitor-enter v5

    :try_start_7
    invoke-direct {p0, v2}, Lcom/android/server/print/PrintManagerService;->getOrCreateUserStateLocked(I)Lcom/android/server/print/UserState;

    move-result-object v3

    monitor-exit v5
    :try_end_c
    .catchall {:try_start_7 .. :try_end_c} :catchall_17

    invoke-static {}, Landroid/os/Binder;->clearCallingIdentity()J

    move-result-wide v0

    :try_start_10
    invoke-virtual {v3, p1}, Lcom/android/server/print/UserState;->removePrintJobStateChangeListener(Landroid/print/IPrintJobStateChangeListener;)V
    :try_end_13
    .catchall {:try_start_10 .. :try_end_13} :catchall_1a

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    return-void

    :catchall_17
    move-exception v4

    :try_start_18
    monitor-exit v5
    :try_end_19
    .catchall {:try_start_18 .. :try_end_19} :catchall_17

    throw v4

    :catchall_1a
    move-exception v4

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    throw v4
.end method

.method public restartPrintJob(Landroid/print/PrintJobId;II)V
    .registers 11
    .param p1    # Landroid/print/PrintJobId;
    .param p2    # I
    .param p3    # I

    invoke-direct {p0, p2}, Lcom/android/server/print/PrintManagerService;->resolveCallingAppEnforcingPermissions(I)I

    move-result v2

    invoke-direct {p0, p3}, Lcom/android/server/print/PrintManagerService;->resolveCallingUserEnforcingPermissions(I)I

    move-result v3

    iget-object v6, p0, Lcom/android/server/print/PrintManagerService;->mLock:Ljava/lang/Object;

    monitor-enter v6

    :try_start_b
    invoke-direct {p0, v3}, Lcom/android/server/print/PrintManagerService;->getOrCreateUserStateLocked(I)Lcom/android/server/print/UserState;

    move-result-object v4

    monitor-exit v6
    :try_end_10
    .catchall {:try_start_b .. :try_end_10} :catchall_1b

    invoke-static {}, Landroid/os/Binder;->clearCallingIdentity()J

    move-result-wide v0

    :try_start_14
    invoke-virtual {v4, p1, v2}, Lcom/android/server/print/UserState;->restartPrintJob(Landroid/print/PrintJobId;I)V
    :try_end_17
    .catchall {:try_start_14 .. :try_end_17} :catchall_1e

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    return-void

    :catchall_1b
    move-exception v5

    :try_start_1c
    monitor-exit v6
    :try_end_1d
    .catchall {:try_start_1c .. :try_end_1d} :catchall_1b

    throw v5

    :catchall_1e
    move-exception v5

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    throw v5
.end method

.method public startPrinterDiscovery(Landroid/print/IPrinterDiscoveryObserver;Ljava/util/List;I)V
    .registers 10
    .param p1    # Landroid/print/IPrinterDiscoveryObserver;
    .param p3    # I
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/print/IPrinterDiscoveryObserver;",
            "Ljava/util/List",
            "<",
            "Landroid/print/PrinterId;",
            ">;I)V"
        }
    .end annotation

    invoke-direct {p0, p3}, Lcom/android/server/print/PrintManagerService;->resolveCallingUserEnforcingPermissions(I)I

    move-result v2

    iget-object v5, p0, Lcom/android/server/print/PrintManagerService;->mLock:Ljava/lang/Object;

    monitor-enter v5

    :try_start_7
    invoke-direct {p0, v2}, Lcom/android/server/print/PrintManagerService;->getOrCreateUserStateLocked(I)Lcom/android/server/print/UserState;

    move-result-object v3

    monitor-exit v5
    :try_end_c
    .catchall {:try_start_7 .. :try_end_c} :catchall_17

    invoke-static {}, Landroid/os/Binder;->clearCallingIdentity()J

    move-result-wide v0

    :try_start_10
    invoke-virtual {v3, p1, p2}, Lcom/android/server/print/UserState;->startPrinterDiscovery(Landroid/print/IPrinterDiscoveryObserver;Ljava/util/List;)V
    :try_end_13
    .catchall {:try_start_10 .. :try_end_13} :catchall_1a

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    return-void

    :catchall_17
    move-exception v4

    :try_start_18
    monitor-exit v5
    :try_end_19
    .catchall {:try_start_18 .. :try_end_19} :catchall_17

    throw v4

    :catchall_1a
    move-exception v4

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    throw v4
.end method

.method public startPrinterStateTracking(Landroid/print/PrinterId;I)V
    .registers 9
    .param p1    # Landroid/print/PrinterId;
    .param p2    # I

    invoke-direct {p0, p2}, Lcom/android/server/print/PrintManagerService;->resolveCallingUserEnforcingPermissions(I)I

    move-result v2

    iget-object v5, p0, Lcom/android/server/print/PrintManagerService;->mLock:Ljava/lang/Object;

    monitor-enter v5

    :try_start_7
    invoke-direct {p0, v2}, Lcom/android/server/print/PrintManagerService;->getOrCreateUserStateLocked(I)Lcom/android/server/print/UserState;

    move-result-object v3

    monitor-exit v5
    :try_end_c
    .catchall {:try_start_7 .. :try_end_c} :catchall_17

    invoke-static {}, Landroid/os/Binder;->clearCallingIdentity()J

    move-result-wide v0

    :try_start_10
    invoke-virtual {v3, p1}, Lcom/android/server/print/UserState;->startPrinterStateTracking(Landroid/print/PrinterId;)V
    :try_end_13
    .catchall {:try_start_10 .. :try_end_13} :catchall_1a

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    return-void

    :catchall_17
    move-exception v4

    :try_start_18
    monitor-exit v5
    :try_end_19
    .catchall {:try_start_18 .. :try_end_19} :catchall_17

    throw v4

    :catchall_1a
    move-exception v4

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    throw v4
.end method

.method public stopPrinterDiscovery(Landroid/print/IPrinterDiscoveryObserver;I)V
    .registers 9
    .param p1    # Landroid/print/IPrinterDiscoveryObserver;
    .param p2    # I

    invoke-direct {p0, p2}, Lcom/android/server/print/PrintManagerService;->resolveCallingUserEnforcingPermissions(I)I

    move-result v2

    iget-object v5, p0, Lcom/android/server/print/PrintManagerService;->mLock:Ljava/lang/Object;

    monitor-enter v5

    :try_start_7
    invoke-direct {p0, v2}, Lcom/android/server/print/PrintManagerService;->getOrCreateUserStateLocked(I)Lcom/android/server/print/UserState;

    move-result-object v3

    monitor-exit v5
    :try_end_c
    .catchall {:try_start_7 .. :try_end_c} :catchall_17

    invoke-static {}, Landroid/os/Binder;->clearCallingIdentity()J

    move-result-wide v0

    :try_start_10
    invoke-virtual {v3, p1}, Lcom/android/server/print/UserState;->stopPrinterDiscovery(Landroid/print/IPrinterDiscoveryObserver;)V
    :try_end_13
    .catchall {:try_start_10 .. :try_end_13} :catchall_1a

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    return-void

    :catchall_17
    move-exception v4

    :try_start_18
    monitor-exit v5
    :try_end_19
    .catchall {:try_start_18 .. :try_end_19} :catchall_17

    throw v4

    :catchall_1a
    move-exception v4

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    throw v4
.end method

.method public stopPrinterStateTracking(Landroid/print/PrinterId;I)V
    .registers 9
    .param p1    # Landroid/print/PrinterId;
    .param p2    # I

    invoke-direct {p0, p2}, Lcom/android/server/print/PrintManagerService;->resolveCallingUserEnforcingPermissions(I)I

    move-result v2

    iget-object v5, p0, Lcom/android/server/print/PrintManagerService;->mLock:Ljava/lang/Object;

    monitor-enter v5

    :try_start_7
    invoke-direct {p0, v2}, Lcom/android/server/print/PrintManagerService;->getOrCreateUserStateLocked(I)Lcom/android/server/print/UserState;

    move-result-object v3

    monitor-exit v5
    :try_end_c
    .catchall {:try_start_7 .. :try_end_c} :catchall_17

    invoke-static {}, Landroid/os/Binder;->clearCallingIdentity()J

    move-result-wide v0

    :try_start_10
    invoke-virtual {v3, p1}, Lcom/android/server/print/UserState;->stopPrinterStateTracking(Landroid/print/PrinterId;)V
    :try_end_13
    .catchall {:try_start_10 .. :try_end_13} :catchall_1a

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    return-void

    :catchall_17
    move-exception v4

    :try_start_18
    monitor-exit v5
    :try_end_19
    .catchall {:try_start_18 .. :try_end_19} :catchall_17

    throw v4

    :catchall_1a
    move-exception v4

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    throw v4
.end method

.method public systemRuning()V
    .registers 3

    invoke-static {}, Lcom/android/internal/os/BackgroundThread;->getHandler()Landroid/os/Handler;

    move-result-object v0

    new-instance v1, Lcom/android/server/print/PrintManagerService$1;

    invoke-direct {v1, p0}, Lcom/android/server/print/PrintManagerService$1;-><init>(Lcom/android/server/print/PrintManagerService;)V

    invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    return-void
.end method

.method public validatePrinters(Ljava/util/List;I)V
    .registers 9
    .param p2    # I
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Landroid/print/PrinterId;",
            ">;I)V"
        }
    .end annotation

    invoke-direct {p0, p2}, Lcom/android/server/print/PrintManagerService;->resolveCallingUserEnforcingPermissions(I)I

    move-result v2

    iget-object v5, p0, Lcom/android/server/print/PrintManagerService;->mLock:Ljava/lang/Object;

    monitor-enter v5

    :try_start_7
    invoke-direct {p0, v2}, Lcom/android/server/print/PrintManagerService;->getOrCreateUserStateLocked(I)Lcom/android/server/print/UserState;

    move-result-object v3

    monitor-exit v5
    :try_end_c
    .catchall {:try_start_7 .. :try_end_c} :catchall_17

    invoke-static {}, Landroid/os/Binder;->clearCallingIdentity()J

    move-result-wide v0

    :try_start_10
    invoke-virtual {v3, p1}, Lcom/android/server/print/UserState;->validatePrinters(Ljava/util/List;)V
    :try_end_13
    .catchall {:try_start_10 .. :try_end_13} :catchall_1a

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    return-void

    :catchall_17
    move-exception v4

    :try_start_18
    monitor-exit v5
    :try_end_19
    .catchall {:try_start_18 .. :try_end_19} :catchall_17

    throw v4

    :catchall_1a
    move-exception v4

    invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V

    throw v4
.end method


text:
@interface NSObject (LNLog)

@end

redpajama_set_name: RedPajamaGithub


text:
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Wordprocessing;
using System.Collections.Generic;
using Trifolia.DB;
using Trifolia.Plugins;
using Trifolia.Shared;

namespace Trifolia.Export.MSWord
{
    public interface IConstraintGenerator
    {
        IIGTypePlugin IGTypePlugin { get; set; }
        IGSettingsManager IGSettings { get; set; }
        MainDocumentPart MainPart { get; set; }
        Body DocumentBody { get; set; }
        FigureCollection Figures { get; set; }
        bool IncludeSamples { get; set; }
        IObjectRepository DataSource { get; set; }
        List<TemplateConstraint> RootConstraints { get; set; }
        List<TemplateConstraint> AllConstraints { get; set; }
        Template CurrentTemplate { get; set; }
        List<Template> AllTemplates { get; set; }
        string ConstraintHeadingStyle { get; set; }
        CommentManager CommentManager { get; set; }
        bool IncludeCategory { get; set; }
        List<string> SelectedCategories { get; set; }
        List<ConstraintReference> ConstraintReferences { get; set; }
        HyperlinkTracker HyperlinkTracker { get; set; }

        void GenerateConstraints(bool aCreateHyperlinksForValueSetNames = false, bool includeNotes = false);
    }
}


text:
package org.perfcake.idea.model;

import com.intellij.util.xml.DomElement;
import org.jetbrains.annotations.NotNull;

import java.util.List;

/**
 * Created by miron on 15. 11. 2014.
 */
public interface IProperties extends DomElement {
    /**
     * Returns the list of property children.
     *
     * @return the list of property children.
     */
    @NotNull
    List<Property> getProperties();

    /**
     * Adds new child to the list of property children.
     *
     * @return created child
     */
    Property addProperty();

}


text:
namespace net {
namespace test {

TEST(QuicTimeDeltaTest, Zero) {
  EXPECT_TRUE(QuicTime::Delta::Zero().IsZero());
  EXPECT_FALSE(QuicTime::Delta::Zero().IsInfinite());
  EXPECT_FALSE(QuicTime::Delta::FromMilliseconds(1).IsZero());
}

TEST(QuicTimeDeltaTest, Infinite) {
  EXPECT_TRUE(QuicTime::Delta::Infinite().IsInfinite());
  EXPECT_FALSE(QuicTime::Delta::Zero().IsInfinite());
  EXPECT_FALSE(QuicTime::Delta::FromMilliseconds(1).IsInfinite());
}

TEST(QuicTimeDeltaTest, FromTo) {
  EXPECT_EQ(QuicTime::Delta::FromMilliseconds(1),
            QuicTime::Delta::FromMicroseconds(1000));
  EXPECT_EQ(QuicTime::Delta::FromSeconds(1),
            QuicTime::Delta::FromMilliseconds(1000));
  EXPECT_EQ(QuicTime::Delta::FromSeconds(1),
            QuicTime::Delta::FromMicroseconds(1000000));

  EXPECT_EQ(1, QuicTime::Delta::FromMicroseconds(1000).ToMilliseconds());
  EXPECT_EQ(2, QuicTime::Delta::FromMilliseconds(2000).ToSeconds());
  EXPECT_EQ(1000, QuicTime::Delta::FromMilliseconds(1).ToMicroseconds());
  EXPECT_EQ(1, QuicTime::Delta::FromMicroseconds(1000).ToMilliseconds());
  EXPECT_EQ(QuicTime::Delta::FromMilliseconds(2000).ToMicroseconds(),
            QuicTime::Delta::FromSeconds(2).ToMicroseconds());
}

TEST(QuicTimeDeltaTest, Add) {
  EXPECT_EQ(QuicTime::Delta::FromMicroseconds(2000),
            QuicTime::Delta::Zero() + QuicTime::Delta::FromMilliseconds(2));
}

TEST(QuicTimeDeltaTest, Subtract) {
  EXPECT_EQ(QuicTime::Delta::FromMicroseconds(1000),
            QuicTime::Delta::FromMilliseconds(2) -
                QuicTime::Delta::FromMilliseconds(1));
}

TEST(QuicTimeDeltaTest, Multiply) {
  int i = 2;
  EXPECT_EQ(QuicTime::Delta::FromMicroseconds(4000),
            QuicTime::Delta::FromMilliseconds(2) * i);
  EXPECT_EQ(QuicTime::Delta::FromMicroseconds(4000),
            i * QuicTime::Delta::FromMilliseconds(2));
  double d = 2;
  EXPECT_EQ(QuicTime::Delta::FromMicroseconds(4000),
            QuicTime::Delta::FromMilliseconds(2) * d);
  EXPECT_EQ(QuicTime::Delta::FromMicroseconds(4000),
            d * QuicTime::Delta::FromMilliseconds(2));

  // Ensure we are rounding correctly within a single-bit level of precision.
  EXPECT_EQ(QuicTime::Delta::FromMicroseconds(5),
            QuicTime::Delta::FromMicroseconds(9) * 0.5);
  EXPECT_EQ(QuicTime::Delta::FromMicroseconds(2),
            QuicTime::Delta::FromMicroseconds(12) * 0.2);
}

TEST(QuicTimeDeltaTest, Max) {
  EXPECT_EQ(QuicTime::Delta::FromMicroseconds(2000),
            std::max(QuicTime::Delta::FromMicroseconds(1000),
                     QuicTime::Delta::FromMicroseconds(2000)));
}

TEST(QuicTimeDeltaTest, NotEqual) {
  EXPECT_TRUE(QuicTime::Delta::FromSeconds(0) !=
              QuicTime::Delta::FromSeconds(1));
  EXPECT_FALSE(QuicTime::Delta::FromSeconds(0) !=
               QuicTime::Delta::FromSeconds(0));
}

TEST(QuicTimeDeltaTest, DebugValue) {
  const QuicTime::Delta one_us = QuicTime::Delta::FromMicroseconds(1);
  const QuicTime::Delta one_ms = QuicTime::Delta::FromMilliseconds(1);
  const QuicTime::Delta one_s = QuicTime::Delta::FromSeconds(1);

  EXPECT_EQ("3s", (3 * one_s).ToDebugValue());
  EXPECT_EQ("3ms", (3 * one_ms).ToDebugValue());
  EXPECT_EQ("3us", (3 * one_us).ToDebugValue());

  EXPECT_EQ("3001us", (3 * one_ms + one_us).ToDebugValue());
  EXPECT_EQ("3001ms", (3 * one_s + one_ms).ToDebugValue());
  EXPECT_EQ("3000001us", (3 * one_s + one_us).ToDebugValue());
}

class QuicTimeTest : public ::testing::Test {
 protected:
  MockClock clock_;
};

TEST_F(QuicTimeTest, Initialized) {
  EXPECT_FALSE(QuicTime::Zero().IsInitialized());
  EXPECT_TRUE((QuicTime::Zero() + QuicTime::Delta::FromMicroseconds(1))
                  .IsInitialized());
}

TEST_F(QuicTimeTest, Add) {
  QuicTime time_1 = QuicTime::Zero() + QuicTime::Delta::FromMilliseconds(1);
  QuicTime time_2 = QuicTime::Zero() + QuicTime::Delta::FromMilliseconds(2);

  QuicTime::Delta diff = time_2 - time_1;

  EXPECT_EQ(QuicTime::Delta::FromMilliseconds(1), diff);
  EXPECT_EQ(1000, diff.ToMicroseconds());
  EXPECT_EQ(1, diff.ToMilliseconds());
}

TEST_F(QuicTimeTest, Subtract) {
  QuicTime time_1 = QuicTime::Zero() + QuicTime::Delta::FromMilliseconds(1);
  QuicTime time_2 = QuicTime::Zero() + QuicTime::Delta::FromMilliseconds(2);

  EXPECT_EQ(QuicTime::Delta::FromMilliseconds(1), time_2 - time_1);
}

TEST_F(QuicTimeTest, SubtractDelta) {
  QuicTime time = QuicTime::Zero() + QuicTime::Delta::FromMilliseconds(2);
  EXPECT_EQ(QuicTime::Zero() + QuicTime::Delta::FromMilliseconds(1),
            time - QuicTime::Delta::FromMilliseconds(1));
}

TEST_F(QuicTimeTest, Max) {
  QuicTime time_1 = QuicTime::Zero() + QuicTime::Delta::FromMilliseconds(1);
  QuicTime time_2 = QuicTime::Zero() + QuicTime::Delta::FromMilliseconds(2);

  EXPECT_EQ(time_2, std::max(time_1, time_2));
}

TEST_F(QuicTimeTest, MockClock) {
  clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1));

  QuicTime now = clock_.ApproximateNow();
  QuicTime time = QuicTime::Zero() + QuicTime::Delta::FromMicroseconds(1000);

  EXPECT_EQ(now, time);

  clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1));
  now = clock_.ApproximateNow();

  EXPECT_NE(now, time);

  time = time + QuicTime::Delta::FromMilliseconds(1);
  EXPECT_EQ(now, time);
}

TEST_F(QuicTimeTest, LE) {
  const QuicTime zero = QuicTime::Zero();
  const QuicTime one = zero + QuicTime::Delta::FromSeconds(1);
  EXPECT_TRUE(zero <= zero);
  EXPECT_TRUE(zero <= one);
  EXPECT_TRUE(one <= one);
  EXPECT_FALSE(one <= zero);
}

}  // namespace test
}  // namespace net


text:
title: PHP
date: 2000-07-01
category: section
---

PHP to interpretowany język programowania, pierwotnie stworzony do tworzenia dynamicznych stron WWW. Obecnie jego wykorzystanie sięga również aplikacji konsolowych (np. Composer) i innych.

Aby rozpocząć pisanie w PHP, potrzebujesz jego interpretera, ponieważ PHP jest językiem skryptowym i jego kod nie przetwarza przeglądarka a właśnie specjalny program na serwerze. Jeżeli jesteś na Windowsie, to najszybszym wyjściem będzie instalacja środowiska [XAMPP]. Następnie po prostu wrzuć kod źródłowy Twoich stron napisanych w PHP do katalogu `C:\xampp\htdocs` i przejdź pod adres [http://localhost][localhost] w swojej przeglądarce.

- [PHP - Wikibooks] - kurs PHP, który początkującego postawi na nogi i pozwoli mu nabrać swobody w poruszaniu się w tym języku.
- [(The only proper) PDO tutorial] - kurs przeznaczony konkretnie rozszerzeniu PDO, które odpowiada za komunikację z bazami danych. Po przeczytaniu i zrozumieniu tego możesz się nazywać *senseiem PDO*!
- [PHP: The Right Way.] - absolutnie obowiązkowa lektura dla każdego, kto chce brać PHP na poważnie.
- [Od zera do WebDeva] - kanał pokazujący w bardzo dobry sposób kolejne etapy nauki PHP w praktyce.
- [Awesome PHP] - zbiór świetnych bibliotek na każdy wypadek.
- [PHP-FIG] - Strona grupy, która opracowuje i ogłasza standardy tworząc PSR (PHP Standard Recommendations).

[XAMPP]: https://www.apachefriends.org/pl/index.html
[localhost]: http://localhost
[PHP - Wikibooks]: https://pl.wikibooks.org/wiki/PHP
[(The only proper) PDO tutorial]: https://phpdelusions.net/pdo
[PHP: The Right Way.]: http://pl.phptherightway.com/
[Od zera do WebDeva]: https://www.youtube.com/channel/UCrSxel4Mheo6XA8IPMA-3ZQ
[Awesome PHP]: https://github.com/ziadoz/awesome-php
[PHP-FIG]: http://www.php-fig.org


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.42000
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Playlister.Properties {

    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
    public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {

        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));

        public static Settings Default {
            get {
                return defaultInstance;
            }
        }

        [global::System.Configuration.UserScopedSettingAttribute()]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.Configuration.DefaultSettingValueAttribute("")]
        public string sessionKey {
            get {
                return ((string)(this["sessionKey"]));
            }
            set {
                this["sessionKey"] = value;
            }
        }

        [global::System.Configuration.UserScopedSettingAttribute()]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.Configuration.DefaultSettingValueAttribute("")]
        public string keyUser {
            get {
                return ((string)(this["keyUser"]));
            }
            set {
                this["keyUser"] = value;
            }
        }

        [global::System.Configuration.ApplicationScopedSettingAttribute()]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.Configuration.DefaultSettingValueAttribute("http://ws.audioscrobbler.com/2.0/?")]
        public string apiAddr {
            get {
                return ((string)(this["apiAddr"]));
            }
        }

        [global::System.Configuration.ApplicationScopedSettingAttribute()]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.Configuration.DefaultSettingValueAttribute("d4153ce5c6605af07bf23651b14bfcc3")]
        public string apiKey {
            get {
                return ((string)(this["apiKey"]));
            }
        }

        [global::System.Configuration.ApplicationScopedSettingAttribute()]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.Configuration.DefaultSettingValueAttribute("e40049bcff4ef495115924cb5a6fce76")]
        public string apiSecret {
            get {
                return ((string)(this["apiSecret"]));
            }
        }
    }
}


text:
<!DOCTYPE html>

<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="/releases/4.2.0/css/style.css" rel="stylesheet" />

<title>md5 ';' RESOURCE</title>
<meta name="generator" content="Jekyll v3.7.4" />
<meta property="og:title" content="md5 ';' RESOURCE" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="layout: default" />
<meta property="og:description" content="layout: default" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2019-10-12T19:48:23-04:00" />

			Intro
			Headers
			Instructions
			Macros
			Commands

<button class="dropbtn">4.2.0</button>

Introduction

How to install bnd

Guided Tour

Guided Tour Workspace & Projects

Concepts

Best practices

Build

Generating JARs

Versioning

Baselining

Service Components

Metatype

Contracts

Manifest Annotations

Resolving Dependencies

Launching

Plain JUnit Testing with OSGi (PRELIMENARY)

Testing

Packaging Applications

Wrapping Libraries to OSGi Bundles

Commands

For Developers

Tools bound to bnd

Headers

Instruction Reference

Instruction Index

Macro Reference

Macro Index

Plugins

Settings

Errors

Warnings

Frequently Asked Questions

 md5 ';' RESOURCE

layout: default

/**
 * md5 macro
 */

static String	_md5Help	= "${md5;path}";

public String _md5(String args[]) throws Exception {
	Macro.verifyCommand(args, _md5Help, new Pattern[] {
			null, null, Pattern.compile("base64|hex")
	}, 2, 3);

	Digester<MD5> digester = MD5.getDigester();
	Resource r = dot.getResource(args[1]);
	if (r == null)
		throw new FileNotFoundException("From " + digester + ", not found " + args[1]);

	IO.copy(r.openInputStream(), digester);
	boolean hex = args.length > 2 && args[2].equals("hex");
	if (hex)
		return Hex.toHexString(digester.digest().digest());

	return Base64.encodeBase64(digester.digest().digest());
}

GitHub


text:
package lila.game

import scala.concurrent.duration._

import org.joda.time.DateTime
import play.api.libs.json.JsObject

import lila.db.api.$count
import lila.db.BSON._
import lila.memo.{ AsyncCache, MongoCache, ExpireSetMemo, Builder }
import lila.user.{ User, UidNb }
import tube.gameTube
import UidNb.UidNbBSONHandler

final class Cached(
    mongoCache: MongoCache.Builder,
    defaultTtl: FiniteDuration) {

  def nbImportedBy(userId: String): Fu[Int] = count(Query imported userId)
  def clearNbImportedByCache(userId: String) = count.remove(Query imported userId)

  def nbRelayed: Fu[Int] = count(Query.relayed)

  def nbPlaying(userId: String): Fu[Int] = countShortTtl(Query nowPlaying userId)

  private implicit val userHandler = User.userBSONHandler

  val rematch960 = new ExpireSetMemo(3.hours)

  val isRematch = new ExpireSetMemo(3.hours)

  val activePlayerUidsDay = mongoCache[Int, List[UidNb]](
    prefix = "player:active:day",
    (nb: Int) => GameRepo.activePlayersSince(DateTime.now minusDays 1, nb),
    timeToLive = 1 hour)

  val activePlayerUidsWeek = mongoCache[Int, List[UidNb]](
    prefix = "player:active:week",
    (nb: Int) => GameRepo.activePlayersSince(DateTime.now minusWeeks 1, nb),
    timeToLive = 6 hours)

  private val countShortTtl = AsyncCache[JsObject, Int](
    f = (o: JsObject) => $count(o),
    timeToLive = 5.seconds)

  private val count = mongoCache(
      prefix = "game:count",
      f = (o: JsObject) => $count(o),
      timeToLive = defaultTtl)

  object Divider {

    private val cache = Builder.size[String, chess.Division](5000)

    def apply(game: Game, initialFen: Option[String]): chess.Division = {
      Option(cache getIfPresent game.id) | {
        val div = chess.Replay.boards(
          moveStrs = game.pgnMoves,
          initialFen = initialFen,
          variant = game.variant
        ).toOption.fold(chess.Division.empty)(chess.Divider.apply)
        cache.put(game.id, div)
        div
      }
    }
  }
}


text:
<TITLE>Review for Evil Dead, The (1982)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Evil Dead, The (1982)

reviewed by
Frankie Paiva

The Evil Dead

rated NC-17
85 minutes
released in 1982 by New Line Cinema
starring Bruce Campbell, Ellen Sandweiss, and Hal Delrich
written and directed by Sam Raimi

An Archive Review by Frankie Paiva

Stephen King said The Evil Dead was, "The most ferociously original horror
movie I have ever seen." The author supported this film, and helped it to
become the cult classic it is now. Two sequels, Evil Dead II and Army of
Darkness followed in later years. So what does the original have going for
it, besides a rave from a horror novelist? It has nothing, nothing at all.
It's just a by-the-numbers horror picture. The type a Scream movie destroys
with delicious malice.

A group of teens head out to a remote cabin in the mountains. Their plans for
endless midnight orgies and marijuana highs get put on hold by their
lodging's creepy aura. After some investigation, they find the cottage used
to be a lab for a scary professor. He discovered the Book of the Dead, a
publication that puts a curse on whoever reads it. The only way to break the
hex is by dismembering the victim. Our hero, Ash (Bruce Campbell), reads the
book, unaware of its power. Soon his friends are turning into zombies and
chasing him through the house. It seems doubtful Ash has what it takes to
stay alive, and cut up his former pals.

This is a movie that puts recent supposedly violent flicks like The Cell to
shame. If you cannot handle a large, continuous amount of gore, this is not
for you. The blood is extremely frequent and bursts out often. Prepare to see
pencils, knives, clocks, chainsaws, trees, and more all used as weapons of
destruction. Just because the carnage is excessive doesn't mean it's
realistic. From first to last frame this is obviously a student film. The
blood often looks like badly colored water. Clay gets employed near the end
for beheadings, flesh explosions, and other bodily mishaps. Prepare not to
eat oatmeal for a long time. Prepare to never look at trees the same way
again. Despite the bloodshed, there is some nice composition in the first
half an hour or so. After which the cinematography tries to follow two simple
questions. Can the camera get closer? and Can we make it seem bloodier?

Head out into the woods with some of the worst actors and least intelligent
human beings ever. Overused, supposedly ominous music is your guide through
the forest of an '80s Blair Witch. This overly gross gorefest is slightly
scary about once, somewhere between zombie one's face being blown off and
zombie two's foot being severed. It is occasionally good for a laugh, but
director Sam Raimi tries too hard.

The sequels fared much better than this movie, which many consider inferior.
Yet I really had to ask myself whether I would survive two more Evil Dead
movies. My unsettled stomach screams no.

D+

Frankie Paiva
SwpStke@aol.com
http://homestead.com/cinemaparadise/mainpage.html

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
require 'tk'
require 'tkextlib/tcllib.rb'

# TkPackage.require('widget::calendar', '0.9')
TkPackage.require('widget::calendar')

module Tk::Tcllib
  module Widget
    class Calendar < TkCanvas
      PACKAGE_NAME = 'widget::calendar'.freeze
      def self.package_name
        PACKAGE_NAME
      end

      def self.package_version
        begin
          TkPackage.require('widget::calendar')
        rescue
          ''
        end
      end
    end
  end
end

class Tk::Tcllib::Widget::Calendar
  TkCommandNames = ['::widget::calendar'.freeze].freeze

  def __boolval_optkeys
    super() << 'showpast'
  end
  private :__boolval_optkeys

  def create_self(keys)
    if keys and keys != None
      tk_call_without_enc(self.class::TkCommandNames[0], @path,
                          *hash_kv(keys, true))
    else
      tk_call_without_enc(self.class::TkCommandNames[0], @path)
    end
  end
  private :create_self

  def get(what = 'all')
    tk_send('get', what)
  end
end


text:
package com.baidubce.http;

/**
 * Common BOS HTTP header values used throughout the BCE BOS Java client.
 */
public interface Headers {

    /*
     * Standard HTTP Headers
     */

    public static final String AUTHORIZATION = "Authorization";

    public static final String CONTENT_DISPOSITION = "Content-Disposition";

    public static final String CONTENT_ENCODING = "Content-Encoding";

    public static final String CONTENT_LENGTH = "Content-Length";

    public static final String CONTENT_MD5 = "Content-MD5";

    public static final String CONTENT_RANGE = "Content-Range";

    public static final String CONTENT_TYPE = "Content-Type";

    public static final String DATE = "Date";

    public static final String ETAG = "ETag";

    public static final String EXPIRES = "Expires";

    public static final String HOST = "Host";

    public static final String LAST_MODIFIED = "Last-Modified";

    public static final String RANGE = "Range";

    public static final String SERVER = "Server";

    public static final String USER_AGENT = "User-Agent";

    /*
     * BCE Common HTTP Headers
     */

    public static final String BCE_PREFIX = "x-bce-";

    public static final String BCE_ACL = "x-bce-acl";

    public static final String BCE_CONTENT_SHA256 = "x-bce-content-sha256";

    public static final String BCE_COPY_METADATA_DIRECTIVE = "x-bce-metadata-directive";

    public static final String BCE_COPY_SOURCE = "x-bce-copy-source";

    public static final String BCE_COPY_SOURCE_IF_MATCH = "x-bce-copy-source-if-match";

    public static final String BCE_DATE = "x-bce-date";

    public static final String BCE_USER_METADATA_PREFIX = "x-bce-meta-";

    public static final String BCE_REQUEST_ID = "x-bce-request-id";

    /*
     * BOS HTTP Headers
     */

    public static final String BOS_DEBUG_ID = "x-bce-bos-debug-id";

}


text:
define([
  'config',
  'angular',
  'filter/<%= _.slugify(name) %>-filter'
], function(cfg, A) {
  describe('<%= _.humanize(name) %> filter', function() {
    var $location,
        filter;

    beforeEach(module(cfg.ngApp));
    beforeEach(inject(function($injector) {
      var $filter = $injector.get('$filter');

      $location = $injector.get('$location');
      filter = $filter('<%= _.camelize(name) %>Filter');
    }));

    it('should run the filter', function() {
      var filtered,
          input;

      input = 'foo';
      filtered = filter(input);

      expect(filtered).toBe("input " + input + ", $location.path() " + ($location.path()));
    });
  });
});