File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
OneSignalSDK/onesignal/src/main/java/com/onesignal Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -369,11 +369,19 @@ int getDeviceType() {
369
369
if (supportsADM ())
370
370
return UserState .DEVICE_TYPE_FIREOS ;
371
371
372
- if (supportsGooglePush ())
372
+ boolean preferHMS = false ;
373
+ boolean supportsHMS = supportsHMS ();
374
+ boolean supportsFCM = supportsGooglePush ();
375
+
376
+ if (supportsFCM && supportsHMS ) {
377
+ return preferHMS ? UserState .DEVICE_TYPE_HUAWEI : UserState .DEVICE_TYPE_ANDROID ;
378
+ }
379
+
380
+ if (supportsFCM )
373
381
return UserState .DEVICE_TYPE_ANDROID ;
374
382
375
383
// Some Huawei devices have both FCM & HMS support, but prefer FCM (Google push) over HMS
376
- if (supportsHMS () )
384
+ if (supportsHMS )
377
385
return UserState .DEVICE_TYPE_HUAWEI ;
378
386
379
387
// Start - Fallback logic
You can’t perform that action at this time.
0 commit comments