use of com.tencent.wstt.gt.utils.AppInfo in project GT by Tencent.
the class GTShowPackageActivity method backToSetting.
private void backToSetting(int pos) {
AppInfo appSelected = dataList.get(pos);
AUTManager.pkn = appSelected.packageName;
AUTManager.apn = appSelected.appName;
AUTManager.appic = appSelected.appIcon;
Env.CUR_APP_NAME = appSelected.packageName;
Env.CUR_APP_VER = appSelected.versionName;
// 清除旧的AUT_CLIENT
ClientManager.getInstance().removeClient(ClientManager.AUT_CLIENT);
// 创建新的AUT_CLIENT
ClientFactory cf = new SingleInstanceClientFactory();
cf.orderClient(ClientManager.AUT_CLIENT, ClientManager.AUT_CLIENT.hashCode(), null, null);
// MTA记录选中的AUT
Properties prop = new Properties();
prop.setProperty("pkgName", AUTManager.pkn);
StatService.trackCustomKVEvent(this, "Selected AUT", prop);
this.finish();
}
use of com.tencent.wstt.gt.utils.AppInfo in project GT by Tencent.
the class GTShowPackageActivity method getInstalledApp.
public void getInstalledApp() {
List<PackageInfo> packages = getPackageManager().getInstalledPackages(0);
ArrayList<AppInfo> tempList = new ArrayList<AppInfo>();
for (int i = 0; i < packages.size(); i++) {
PackageInfo packageInfo = packages.get(i);
AppInfo tmpInfo = new AppInfo();
tmpInfo.appName = packageInfo.applicationInfo.loadLabel(getPackageManager()).toString();
tmpInfo.packageName = packageInfo.packageName;
tmpInfo.versionName = packageInfo.versionName;
tmpInfo.versionCode = packageInfo.versionCode;
tmpInfo.appIcon = packageInfo.applicationInfo.loadIcon(getPackageManager());
// 非系统应用先加列表
if ((packageInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0) {
appList.add(tmpInfo);
} else {
tempList.add(tmpInfo);
}
}
// 系统应用加在列表后面
appList.addAll(tempList);
}
Aggregations