提交 0edd2746 编写于 作者: L Liu Xiao 提交者: GitHub

Merge pull request #63 from mrx1203/master

修改uid获取方式(修复流量获取异常)
......@@ -40,6 +40,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.net.wifi.WifiManager;
import android.os.BatteryManager;
......@@ -197,11 +198,18 @@ public class EmmageeService extends Service {
startForeground(startId, builder.build());
pid = intent.getExtras().getInt("pid");
uid = intent.getExtras().getInt("uid");
//uid = intent.getExtras().getInt("uid");
processName = intent.getExtras().getString("processName");
packageName = intent.getExtras().getString("packageName");
startActivity = intent.getExtras().getString("startActivity");
try {
PackageManager pm = getPackageManager();
ApplicationInfo ainfo = pm.getApplicationInfo(packageName, PackageManager.GET_ACTIVITIES);
uid = ainfo.uid;
}catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
cpuInfo = new CpuInfo(getBaseContext(), pid, Integer.toString(uid));
readSettingInfo();
if (isFloating) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册