So I am making an app in which I needed some features. I am getting the package name of all installed apps on my android device using this code:
final PackageManager manager = getPackageManager();
List<ApplicationInfo> packages = manager.getInstalledApplications(PackageManager.GET_META_DATA);
for (ApplicationInfo info : packages) {
Log.i("Info", "Installed package:" + info.packageName);
}
Next, whenever my app is active on the Android device, if any other app triggers any kind of permission request then I am retrieving the name of that app from the permission window and displaying it in my logcat.
I am getting the name of the app in this case. Is there any way that I could get the package name of the app?