77 lines
2.6 KiB
Java
77 lines
2.6 KiB
Java
package c.i.a.f.d;
|
|
|
|
import android.content.Context;
|
|
import android.os.Bundle;
|
|
import android.os.Message;
|
|
import android.os.Messenger;
|
|
import android.os.RemoteException;
|
|
import android.util.Log;
|
|
import com.google.android.gms.cloudmessaging.zza;
|
|
import java.util.Objects;
|
|
import java.util.concurrent.TimeUnit;
|
|
/* compiled from: com.google.android.gms:play-services-cloud-messaging@@16.0.0 */
|
|
public final /* synthetic */ class k implements Runnable {
|
|
public final g i;
|
|
|
|
public k(g gVar) {
|
|
this.i = gVar;
|
|
}
|
|
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
q<?> poll;
|
|
g gVar = this.i;
|
|
while (true) {
|
|
synchronized (gVar) {
|
|
if (gVar.i == 2) {
|
|
if (gVar.l.isEmpty()) {
|
|
gVar.c();
|
|
return;
|
|
}
|
|
poll = gVar.l.poll();
|
|
gVar.m.put(poll.a, poll);
|
|
gVar.n.f1025c.schedule(new m(gVar, poll), 30, TimeUnit.SECONDS);
|
|
} else {
|
|
return;
|
|
}
|
|
}
|
|
if (Log.isLoggable("MessengerIpcClient", 3)) {
|
|
String valueOf = String.valueOf(poll);
|
|
StringBuilder sb = new StringBuilder(valueOf.length() + 8);
|
|
sb.append("Sending ");
|
|
sb.append(valueOf);
|
|
Log.d("MessengerIpcClient", sb.toString());
|
|
}
|
|
Context context = gVar.n.b;
|
|
Messenger messenger = gVar.j;
|
|
Message obtain = Message.obtain();
|
|
obtain.what = poll.f1026c;
|
|
obtain.arg1 = poll.a;
|
|
obtain.replyTo = messenger;
|
|
Bundle bundle = new Bundle();
|
|
bundle.putBoolean("oneWay", poll.d());
|
|
bundle.putString("pkg", context.getPackageName());
|
|
bundle.putBundle("data", poll.d);
|
|
obtain.setData(bundle);
|
|
try {
|
|
p pVar = gVar.k;
|
|
Messenger messenger2 = pVar.a;
|
|
if (messenger2 != null) {
|
|
messenger2.send(obtain);
|
|
} else {
|
|
zza zza = pVar.b;
|
|
if (zza != null) {
|
|
Messenger messenger3 = zza.i;
|
|
Objects.requireNonNull(messenger3);
|
|
messenger3.send(obtain);
|
|
} else {
|
|
throw new IllegalStateException("Both messengers are null");
|
|
}
|
|
}
|
|
} catch (RemoteException e) {
|
|
gVar.a(2, e.getMessage());
|
|
}
|
|
}
|
|
}
|
|
}
|