Tp 40973 ifsc search widget lambda api (#8064)

Co-authored-by: soumya-ranjan_navi <soumya.ranjan@navi.com>
Co-authored-by: sanjaypanjawani <sanjay.p@navi.com>
This commit is contained in:
Hitesh Kumar
2023-09-28 19:25:33 +05:30
committed by GitHub
parent cfbc88851f
commit 72a4bbee0b
20 changed files with 504 additions and 274 deletions

View File

@@ -517,4 +517,27 @@ object BaseUtils {
}
return false
}
fun isUpiAppExceptParticularAppsAvailable(
context: Context,
exceptionUpiApps: List<String>
): Boolean {
val upiIntent = Intent(Intent.ACTION_VIEW, Uri.parse(UPI_APP_INTENT_URL))
val packageManager = context.packageManager
val requestedUpiAppPackageNames = mutableListOf<String>()
packageManager?.let {
val allUpiAppsPackageNames = packageManager.queryIntentActivities(
upiIntent,
PackageManager.GET_META_DATA
).mapNotNull { it.activityInfo?.packageName }
allUpiAppsPackageNames.forEach { packageName ->
if (exceptionUpiApps.contains(packageName).not()) {
requestedUpiAppPackageNames.add(packageName)
}
}
}
return requestedUpiAppPackageNames.isNotEmpty()
}
}