51 lines
1.7 KiB
Java
51 lines
1.7 KiB
Java
package com.google.android.gms.common.stats;
|
|
|
|
import android.annotation.SuppressLint;
|
|
import android.content.ComponentName;
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.content.ServiceConnection;
|
|
import android.util.Log;
|
|
import com.google.android.gms.common.util.ClientLibraryUtils;
|
|
import java.util.Collections;
|
|
import java.util.List;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class ConnectionTracker {
|
|
private static final Object a = new Object();
|
|
private static volatile ConnectionTracker b;
|
|
|
|
private ConnectionTracker() {
|
|
List list = Collections.EMPTY_LIST;
|
|
}
|
|
|
|
public static ConnectionTracker a() {
|
|
if (b == null) {
|
|
synchronized (a) {
|
|
if (b == null) {
|
|
b = new ConnectionTracker();
|
|
}
|
|
}
|
|
}
|
|
return b;
|
|
}
|
|
|
|
public final boolean a(Context context, String str, Intent intent, ServiceConnection serviceConnection, int i) {
|
|
ComponentName component = intent.getComponent();
|
|
if (component == null ? false : ClientLibraryUtils.c(context, component.getPackageName())) {
|
|
Log.w("ConnectionTracker", "Attempted to bind to a service in a STOPPED package.");
|
|
return false;
|
|
}
|
|
return context.bindService(intent, serviceConnection, i);
|
|
}
|
|
|
|
public boolean a(Context context, Intent intent, ServiceConnection serviceConnection, int i) {
|
|
return a(context, context.getClass().getName(), intent, serviceConnection, i);
|
|
}
|
|
|
|
@SuppressLint({"UntrackedBindService"})
|
|
public void a(Context context, ServiceConnection serviceConnection) {
|
|
context.unbindService(serviceConnection);
|
|
}
|
|
}
|