64 lines
3 KiB
Java
64 lines
3 KiB
Java
package com.discord.utilities.system;
|
|
|
|
import android.os.Bundle;
|
|
import android.os.Handler;
|
|
import android.os.Message;
|
|
import android.os.Process;
|
|
import androidx.core.app.NotificationCompat;
|
|
import c.d.b.a.a;
|
|
import com.discord.utilities.logging.Logger;
|
|
import com.discord.utilities.logging.LoggingProvider;
|
|
import com.discord.utilities.system.RemoteIntentService;
|
|
import d0.z.d.m;
|
|
import java.util.Objects;
|
|
/* compiled from: RemoteIntentService.kt */
|
|
public final class RemoteIntentService$IpcCallback$handler$1 implements Handler.Callback {
|
|
public final /* synthetic */ RemoteIntentService.IpcCallback this$0;
|
|
|
|
public RemoteIntentService$IpcCallback$handler$1(RemoteIntentService.IpcCallback ipcCallback) {
|
|
this.this$0 = ipcCallback;
|
|
}
|
|
|
|
@Override // android.os.Handler.Callback
|
|
public final boolean handleMessage(Message message) {
|
|
m.checkNotNullParameter(message, NotificationCompat.CATEGORY_MESSAGE);
|
|
Logger logger = LoggingProvider.INSTANCE.get();
|
|
if (message.what == 1) {
|
|
StringBuilder J = a.J('[');
|
|
J.append(RemoteIntentService.IpcCallback.access$getName$p(this.this$0));
|
|
J.append("] in IpcCallback: app pid=");
|
|
J.append(Process.myPid());
|
|
Logger.d$default(logger, "RemoteIntentService", J.toString(), null, 4, null);
|
|
Object obj = message.obj;
|
|
if (obj instanceof Bundle) {
|
|
StringBuilder J2 = a.J('[');
|
|
J2.append(RemoteIntentService.IpcCallback.access$getName$p(this.this$0));
|
|
J2.append("] success after (");
|
|
Logger.d$default(logger, "RemoteIntentService", a.w(J2, message.arg1, " ms)"), null, 4, null);
|
|
RemoteIntentService.IpcCallback ipcCallback = this.this$0;
|
|
Object obj2 = message.obj;
|
|
Objects.requireNonNull(obj2, "null cannot be cast to non-null type android.os.Bundle");
|
|
ipcCallback.onSuccess((Bundle) obj2);
|
|
return true;
|
|
} else if ((obj instanceof Throwable) || obj == null) {
|
|
StringBuilder J3 = a.J('[');
|
|
J3.append(RemoteIntentService.IpcCallback.access$getName$p(this.this$0));
|
|
J3.append("] failure after (");
|
|
Logger.d$default(logger, "RemoteIntentService", a.w(J3, message.arg1, " ms)"), null, 4, null);
|
|
RemoteIntentService.IpcCallback ipcCallback2 = this.this$0;
|
|
Object obj3 = message.obj;
|
|
if (!(obj3 instanceof Throwable)) {
|
|
obj3 = null;
|
|
}
|
|
ipcCallback2.onFailure((Throwable) obj3);
|
|
return true;
|
|
}
|
|
}
|
|
StringBuilder J4 = a.J('[');
|
|
J4.append(RemoteIntentService.IpcCallback.access$getName$p(this.this$0));
|
|
J4.append("] unexpected message in handler: ");
|
|
J4.append(RemoteIntentService.Companion.access$messageToString(RemoteIntentService.Companion, message));
|
|
Logger.w$default(logger, "RemoteIntentService", J4.toString(), null, 4, null);
|
|
return false;
|
|
}
|
|
}
|