/*prize added by zhongliming 20230616 incase app uninstalled by user start */
/*
* when app was disabled or uninstalled it will return false
*/
private boolean isAppInstalled(String pkg){
LauncherApps mLauncherApps = (LauncherApps)getSystemService(Context.LAUNCHER_APPS_SERVICE);
List<LauncherActivityInfo> labs = mLauncherApps.getActivityList(null, UserHandle.getUserHandleForUid(-1));
for (LauncherActivityInfo info : labs) {
ApplicationInfo app = info.getApplicationInfo();
//Log.i(TAG,"disableAllDefaultIceapp app.packageName=" + app.packageName);
if(pkg.equals(app.packageName)){
return true;
}
}
Log.e(TAG, pkg + " not found or disabled");
return false;
}
/*prize added by zhongliming 20230616 incase app uninstalled by user end*/