Skip to content

Commit

Permalink
Use a better check code for "Is default Home"
Browse files Browse the repository at this point in the history
  • Loading branch information
EmiyaSyahriel committed Dec 13, 2022
1 parent b81da63 commit 53779f5
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ class XMB : AppCompatActivity() {
}

private fun checkIsDefaultHomeIntent(intent: Intent) {
vsh.shouldShowExitOption = !(!intent.hasCategory(Intent.CATEGORY_DEFAULT) && intent.hasCategory(Intent.CATEGORY_HOME))
val i = Intent(Intent.ACTION_MAIN)
i.addCategory(Intent.CATEGORY_HOME)
val ri = packageManager.resolveActivity(i, 0)
vsh.shouldShowExitOption = ri?.activityInfo?.packageName != packageName
}

override fun onNewIntent(intent: Intent?) {
Expand Down

0 comments on commit 53779f5

Please sign in to comment.