2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00

[fenix] Close https://github.com/mozilla-mobile/fenix/issues/26495: Move Huawei checks to ManufacturerCodes

This commit is contained in:
Jonathan Almeida 2022-08-16 18:21:53 -04:00 committed by mergify[bot]
parent 9a86122ddb
commit c1700709e3
2 changed files with 3 additions and 2 deletions

View File

@ -127,6 +127,7 @@ import org.mozilla.fenix.theme.DefaultThemeManager
import org.mozilla.fenix.theme.ThemeManager import org.mozilla.fenix.theme.ThemeManager
import org.mozilla.fenix.trackingprotection.TrackingProtectionPanelDialogFragmentDirections import org.mozilla.fenix.trackingprotection.TrackingProtectionPanelDialogFragmentDirections
import org.mozilla.fenix.utils.BrowsersCache import org.mozilla.fenix.utils.BrowsersCache
import org.mozilla.fenix.utils.ManufacturerCodes
import org.mozilla.fenix.utils.Settings import org.mozilla.fenix.utils.Settings
import java.lang.ref.WeakReference import java.lang.ref.WeakReference
@ -617,8 +618,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
Build.VERSION.SDK_INT == Build.VERSION_CODES.N || Build.VERSION.SDK_INT == Build.VERSION_CODES.N_MR1 Build.VERSION.SDK_INT == Build.VERSION_CODES.N || Build.VERSION.SDK_INT == Build.VERSION_CODES.N_MR1
// Huawei devices seem to have problems with onKeyLongPress // Huawei devices seem to have problems with onKeyLongPress
// See https://github.com/mozilla-mobile/fenix/issues/13498 // See https://github.com/mozilla-mobile/fenix/issues/13498
val isHuawei = Build.MANUFACTURER.equals("huawei", ignoreCase = true) return isAndroidN || ManufacturerCodes.isHuawei
return isAndroidN || isHuawei
} }
private fun handleBackLongPress(): Boolean { private fun handleBackLongPress(): Boolean {

View File

@ -19,4 +19,5 @@ object ManufacturerCodes {
val isLG get() = Build.MANUFACTURER.equals(LG, ignoreCase = true) val isLG get() = Build.MANUFACTURER.equals(LG, ignoreCase = true)
val isSamsung get() = Build.MANUFACTURER.equals(SAMSUNG, ignoreCase = true) val isSamsung get() = Build.MANUFACTURER.equals(SAMSUNG, ignoreCase = true)
val isHuawei get() = Build.MANUFACTURER.equals(HUAWEI, ignoreCase = true)
} }