Skip to content
  • Robin Burchell's avatar
    Implement more full resource policy features. · 1c5ea956
    Robin Burchell authored
    
    
     * Handle released by manager properly.
    
    Signal resourcesReleasedByManager is different from signal
    handleResourcesLost and needs to be handled separately.
    Signal handleResourcesLost means some other client has acquired the
    resources, thus the resources are lost from us, but if the other client
    frees the resources, we will automatically get the resources back.
    With resourcesReleasedByManager we lose the resources, and resource
    manager releases them as well (same as if client would call release()),
    so only way to re-acquire resources in latter case is calling acquire()
    again.
    
    This distinction is useful for example in cases where user is listening
    to music with headphones connected and removes the headphones, then the
    music player shouldn't continue playback until user requests so. But if
    user is listening to music when phone call is received, it is convenient
    to resume the playback automatically after the call.
    
     * Implement availability changed.
    
    Availability changed is information whether resources the client is
    interested in are available (no higher priority resource classes have
    acquired the resources).
    
     * Implement missing resources released.
    
    Emit resourcesReleased signal when receiving corresponding signal from
    libresource-qt.
    
     * Add mechanism to change used resource class.
    
    Check for environment for special variable, and if the variable has
    proper data, use that as the resource class. Can be set with for example
    qputenv("NEMO_RESOURCE_CLASS_OVERRIDE", "game");
    
    Change-Id: I8e92f40cc5c01b6b94f54c3fa0f7a07775e87df0
    Done-with: Juho Hämäläinen <juho.hamalainen@tieto.com>
    Reviewed-by: default avatarAndrew den Exter <andrew.den.exter@qinetic.com.au>
    1c5ea956