山海小管家.apk(点击下载) / TrayContract.java


package net.grandcentrix.tray.provider;

import android.content.Context;
import android.content.pm.ProviderInfo;
import android.net.Uri;
import android.os.Process;
import android.provider.BaseColumns;
import android.util.Log;
import androidx.annotation.NonNull;
import java.util.List;
import net.grandcentrix.tray.R;
import net.grandcentrix.tray.core.TrayLog;
import net.grandcentrix.tray.core.TrayRuntimeException;

public class TrayContract {

    /* renamed from: a  reason: collision with root package name */
    public static String f3849a;

    public interface InternalPreferences extends Preferences {
    }

    public interface Preferences {

        public interface Columns extends BaseColumns {
        }
    }

    @NonNull
    public static Uri a(@NonNull Context context, String str) {
        String a2 = a(context);
        return Uri.withAppendedPath(Uri.parse("content://" + a2), str);
    }

    @NonNull
    public static synchronized String a(@NonNull Context context) {
        synchronized (TrayContract.class) {
            if (f3849a != null) {
                return f3849a;
            }
            if (!"legacyTrayAuthority".equals(context.getString(R.string.tray__authority))) {
                Log.e("Tray", "Deprecated way of defining the Tray authority detected\n#########################################\n#########################################\n#########################################\nDon't set the authority with `tray__authority` in your build.gradle.\nTo change the default authority override it inside the AndroidManifest\nSee https://github.com/grandcentrix/tray/wiki/Custom-Authority for instructions\n#########################################\n#########################################\n#########################################\n");
            }
            List<ProviderInfo> queryContentProviders = context.getPackageManager().queryContentProviders(context.getPackageName(), Process.myUid(), 0);
            if (queryContentProviders != null) {
                for (ProviderInfo providerInfo : queryContentProviders) {
                    if (providerInfo.name.equals(TrayContentProvider.class.getName())) {
                        f3849a = providerInfo.authority;
                        TrayLog.a("found authority: " + f3849a);
                        return f3849a;
                    }
                }
            }
            throw new TrayRuntimeException("Internal tray error. Could not find the provider authority. Please fill an issue at https://github.com/grandcentrix/tray/issues");
        }
    }
}