package com.zswc.creativity.utils;

import android.app.ActivityManager;
import android.content.Context;
import android.os.Process;

public class ProcessUtil {

    public static String a(Context context) {
        int myPid = Process.myPid();
        for (ActivityManager.RunningAppProcessInfo runningAppProcessInfo : ((ActivityManager) context.getSystemService("activity")).getRunningAppProcesses()) {
            if (runningAppProcessInfo.pid == myPid) {
                return runningAppProcessInfo.processName;
            }
        }

        return null;
    }

    public static boolean b(Context context) {
        return true;
//        for (ActivityManager.RunningAppProcessInfo runningAppProcessInfo : ((ActivityManager) context.getSystemService("activity")).getRunningAppProcesses()) {
//            if (runningAppProcessInfo.processName.equals(context.getPackageName())) {
//                return true;
//            }
//        }
//        return false;
    }
}
