Skip to content

Commit

Permalink
Merge pull request #43 from NitishGadangi/development
Browse files Browse the repository at this point in the history
Fix Crash in the Indicator service. Caused due to Package Manager.
  • Loading branch information
NitishGadangi authored Jun 23, 2021
2 parents 9ca8bc9 + 4b75de6 commit 2ad46f1
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,11 @@ class IndicatorService : AccessibilityService() {

private fun getAppName(packageName: String): String {
val packageManager = applicationContext.packageManager
return packageManager.getApplicationLabel(packageManager.getApplicationInfo(packageName, PackageManager.GET_META_DATA)) as String
return try{
packageManager.getApplicationLabel(packageManager.getApplicationInfo(packageName, PackageManager.GET_META_DATA)) as String
}catch (exp: PackageManager.NameNotFoundException){
packageName
}
}

private fun isLogEligible(currentAppId: String): Boolean {
Expand Down

0 comments on commit 2ad46f1

Please sign in to comment.