When trying to open a file using content hub using C++ I get these errors:
Opening with peer com.ubuntu.music_music_2.1.857
Sdk-Launcher> Application was resumed
Sdk-Launcher> There has been a AppArmor denial for your application.
Sdk-Launcher> Most likely it is missing a policy in the AppArmor file.
Syslog> Jun 20 19:15:23 ubuntu-phablet kernel: [ 3561.148570] type=1400 audit(1434827723.595:155): apparmor="DENIED" operation="open" profile="com.nogzatalz.downow_downow_0.8.81" name="/home/phablet/.local/share/applications/com.ubuntu.music_music_2.1.857.desktop" pid=9282 comm="downow" requested_mask="r" denied_mask="r" fsuid=32011 ouid=32011
transfer state changed to 5
Sdk-Launcher> Application was focused
transfer state changed to 5
transfer state changed to 5
I checked in the Transfer::State enum and found that state 5 means aborted.
This is my apparmor.json file:
{
"policy_groups": [
"networking",
"content_exchange",
"content_exchange_source",
"audio"
],
"policy_version": 1.3
}
I'm using the ubuntu-sdk-15.04-qml framework.
My app worked fine until the last OTA update. On my Nexus 5 this is r20.
Any help is appreciated!
EDIT:
After trying to solve this problem for a while, I noticed that I'm able to import content from other applications, but exporting still doesn't seem to work.
Here is my simplified code for importing (which works):
QPointer<cuc::Hub> hub = cuc::Hub::Client::instance();
cuc::Peer peer = hub->default_source_for_type(cuc::Type::Known::pictures());
cuc::Transfer * t = hub->create_import_from_peer(peers);
t->start();
Here is my simplified code for exporting (which doesn't work):
QPointer<cuc::Hub> hub = cuc::Hub::Client::instance();
QVector<cuc::Peer> peers = hub->known_destinations_for_type(cuc::Type::Known::pictures());
cuc::Transfer * t = hub->create_export_to_peer(peers[0]);
QVector<cuc::Item> items;
items.append(cuc::Item(QUrl::fromLocalFile("/home/phablet/.local/share/com.nogzatalz.downow/download/Ed Sheeran – 5 (2015) (ALBUM) 320 KBPS/Cover.jpg")));
t->setSelectionType(cuc::Transfer::single);
t->charge(items);