Ah, I figured out why it only happens sometimes. gdu monitor's update_volume() sets automount flag to TRUE in general. However, it is set to FALSE if the media detection time is older than the "new volume" detection by 5 seconds or more. Thus if dk-disks was already running, starting gvfs will usually set automount to FALSE since the difference will be more than 5 seconds. The rationale is:
/* If a volume (partition) appear _much later_ than when media was insertion it
* can only be because the media was repartitioned. We don't want to automount
* such volumes.
*/
But if gvfs-gdu-volume-monitor triggers dk-disks startup, the "last media detection" time will be almost equal to "new volume", and automount will be TRUE.
I think we should generally disable automounting for system internal drives.
Ah, I figured out why it only happens sometimes. gdu monitor's update_volume() sets automount flag to TRUE in general. However, it is set to FALSE if the media detection time is older than the "new volume" detection by 5 seconds or more. Thus if dk-disks was already running, starting gvfs will usually set automount to FALSE since the difference will be more than 5 seconds. The rationale is:
/* If a volume (partition) appear _much later_ than when media was insertion it
* can only be because the media was repartitioned. We don't want to automount
* such volumes.
*/
But if gvfs-gdu- volume- monitor triggers dk-disks startup, the "last media detection" time will be almost equal to "new volume", and automount will be TRUE.
I think we should generally disable automounting for system internal drives.