Skip to content

Commit

Permalink
Check for Galaxy Wearable app as well for Galaxy Watch 4 users (#1826)
Browse files Browse the repository at this point in the history
  • Loading branch information
dshokouhi authored Oct 24, 2021
1 parent 578ec93 commit e1cc6c8
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ class SettingsFragment : PreferenceFragmentCompat(), SettingsView {

val pm = requireContext().packageManager
val hasWearApp = pm.getLaunchIntentForPackage("com.google.android.wearable.app")
findPreference<PreferenceCategory>("wear_category")?.isVisible = hasWearApp != null
val hasSamsungApp = pm.getLaunchIntentForPackage("com.samsung.android.app.watchmanager")
findPreference<PreferenceCategory>("wear_category")?.isVisible = hasWearApp != null || hasSamsungApp != null
findPreference<Preference>("wear_settings")?.setOnPreferenceClickListener {
startActivity(SettingsWearActivity.newInstance(requireContext()))
return@setOnPreferenceClickListener true
Expand Down

0 comments on commit e1cc6c8

Please sign in to comment.