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:
@@ -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()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user