[Merge] lp:~thomas-voss/platform-api/retry-loading-of-gps-hal into lp:platform-api

Alfonso Sanchez-Beato alfonso.sanchez-beato at canonical.com
Thu May 19 15:29:14 UTC 2016


Review: Needs Information

See inline comment.

Diff comments:

> === modified file 'android/hybris/ubuntu_application_gps_for_hybris.cpp'
> --- android/hybris/ubuntu_application_gps_for_hybris.cpp	2016-02-02 09:04:07 +0000
> +++ android/hybris/ubuntu_application_gps_for_hybris.cpp	2016-05-19 14:21:42 +0000
> @@ -430,13 +408,19 @@
>      UHardwareGps u_hardware_gps = new UHardwareGps_(params);
>      hybris_gps_instance = u_hardware_gps;
>  
> -    if (!u_hardware_gps->init())
> -    {
> -        delete u_hardware_gps;
> -        u_hardware_gps = NULL;
> -    }
> +    // Try ten times to initialize the GPS HAL interface,
> +    // sleeping for 200ms per iteration in case of issues.

Is two seconds really enough? If the container needs to start so all fw is loaded, etc, it can be a bit more than that. Rising this to something like 5 secs appease me more.

> +    for (unsigned int i = 0; i < 10; i++)
> +        if (u_hardware_gps->init())
> +            return hybris_gps_instance = u_hardware_gps;
> +        else
> +            // Sleep for some time and leave some time for the system
> +            // to finish initialization.
> +            ::usleep(200 * 1000);
>  
> -    return u_hardware_gps;
> +    // This is the error case, as we did not succeed in initializing the GPS interface.
> +    delete u_hardware_gps;
> +    return hybris_gps_instance;
>  }
>  
>  void u_hardware_gps_delete(UHardwareGps handle)


-- 
https://code.launchpad.net/~thomas-voss/platform-api/retry-loading-of-gps-hal/+merge/295216
Your team Ubuntu Phablet Team is subscribed to branch lp:platform-api.



More information about the Ubuntu-reviews mailing list