aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/50-org.ayatana.AccountsService.Sound.pkla13
-rw-r--r--data/CMakeLists.txt28
-rw-r--r--data/org.ayatana.AccountsService.Sound.policy24
-rw-r--r--data/org.ayatana.AccountsService.Sound.xml27
-rw-r--r--src/accounts-service-access.vala2
-rw-r--r--tests/dbus-types/CMakeLists.txt2
-rw-r--r--tests/dbus-types/org.ayatana.sound.AccountsService.xml (renamed from tests/dbus-types/com.ubuntu.AccountsService.Sound.xml)2
-rw-r--r--tests/service-mocks/accounts-mock/AccountsDefs.h2
-rw-r--r--tests/service-mocks/accounts-mock/CMakeLists.txt4
-rw-r--r--tests/service-mocks/accounts-mock/org.ayatana.AccountsService.Sound.Mock.xml (renamed from tests/service-mocks/accounts-mock/com.ubuntu.AccountsService.Sound.Mock.xml)2
-rw-r--r--tests/service-mocks/media-player-mpris-mock/MediaPlayerMprisDefs.h2
11 files changed, 97 insertions, 11 deletions
diff --git a/data/50-org.ayatana.AccountsService.Sound.pkla b/data/50-org.ayatana.AccountsService.Sound.pkla
new file mode 100644
index 0000000..ac58f75
--- /dev/null
+++ b/data/50-org.ayatana.AccountsService.Sound.pkla
@@ -0,0 +1,13 @@
+[Allow greeter to set fields]
+Identity=unix-user:lightdm
+Action=org.ayatana.AccountsService.GreeterChangeAny
+ResultAny=no
+ResultInactive=yes
+ResultActive=yes
+
+[Allow greeter to read fields]
+Identity=unix-user:lightdm
+Action=org.ayatana.AccountsService.GreeterReadAny
+ResultAny=yes
+ResultInactive=yes
+ResultActive=yes
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
index a9ebf55..b99fff4 100644
--- a/data/CMakeLists.txt
+++ b/data/CMakeLists.txt
@@ -121,9 +121,9 @@ if(NOT EXISTS /usr/share/glib-2.0/schemas/com.ubuntu.sound.gschema.xml)
add_schema ("org.ayatana.sound.gschema.xml")
endif()
-###########################
-# Accounts Service
-###########################
+#########################################
+# Accounts Service Iface: Sound Indicator
+#########################################
set(POLKIT_LIB_DIR "${CMAKE_INSTALL_LOCALSTATEDIR}/lib/polkit-1")
@@ -148,3 +148,25 @@ DESTINATION "${POLKIT_DATA_DIR}/actions"
install(FILES 50-org.ayatana.indicator.sound.AccountsService.pkla
DESTINATION "${POLKIT_LIB_DIR}/localauthority/10-vendor.d"
)
+
+#######################################
+# Accounts Service Iface: Greeter Sound
+#######################################
+
+install(FILES org.ayatana.AccountsService.Sound.xml
+ DESTINATION "${DBUS_IFACE_DIR}"
+)
+
+# Create accountsservice symlink for above dbus interface
+install(CODE "
+ execute_process(COMMAND mkdir -p \"\$ENV{DESTDIR}${ACCOUNTS_IFACE_DIR}\")
+ execute_process(COMMAND ln -sf ../../dbus-1/interfaces/org.ayatana.AccountsService.Sound.xml \"\$ENV{DESTDIR}${ACCOUNTS_IFACE_DIR}\")
+")
+
+install(FILES org.ayatana.AccountsService.Sound.policy
+DESTINATION "${POLKIT_DATA_DIR}/actions"
+)
+
+install(FILES 50-org.ayatana.AccountsService.Sound.pkla
+DESTINATION "${POLKIT_LIB_DIR}/localauthority/10-vendor.d"
+)
diff --git a/data/org.ayatana.AccountsService.Sound.policy b/data/org.ayatana.AccountsService.Sound.policy
new file mode 100644
index 0000000..7140498
--- /dev/null
+++ b/data/org.ayatana.AccountsService.Sound.policy
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<policyconfig>
+ <!-- Same as org.freedesktop.accounts.user-administration, but we override
+ settings for the lightdm user in a pkla file. -->
+ <action id="org.ayatana.AccountsService.GreeterChangeAny">
+ <defaults>
+ <allow_any>no</allow_any>
+ <allow_inactive>no</allow_inactive>
+ <allow_active>auth_admin_keep</allow_active>
+ </defaults>
+ </action>
+
+ <!-- Normally anyone can read these, but for a little bit extra lock down,
+ disallow all access, but we'll let the lightdm user read them via the
+ pkla override. -->
+ <action id="org.ayatana.AccountsService.GreeterReadAny">
+ <defaults>
+ <allow_any>no</allow_any>
+ <allow_inactive>no</allow_inactive>
+ <allow_active>no</allow_active>
+ </defaults>
+ </action>
+</policyconfig>
diff --git a/data/org.ayatana.AccountsService.Sound.xml b/data/org.ayatana.AccountsService.Sound.xml
new file mode 100644
index 0000000..bfbdd09
--- /dev/null
+++ b/data/org.ayatana.AccountsService.Sound.xml
@@ -0,0 +1,27 @@
+<node>
+ <interface name="org.ayatana.AccountsService.Sound">
+
+ <annotation name="org.freedesktop.Accounts.VendorExtension" value="true"/>
+
+ <annotation name="org.freedesktop.Accounts.Authentication.ChangeAny"
+ value="org.ayatana.AccountsService.GreeterChangeAny"/>
+
+ <annotation name="org.freedesktop.Accounts.Authentication.ReadAny"
+ value="org.ayatana.AccountsService.GreeterReadAny"/>
+
+ <property name="Volume" type="d" access="readwrite">
+ <annotation name="org.freedesktop.Accounts.DefaultValue" value="-1.0"/>
+ </property>
+
+ <!-- Muted is all sound, SilentMode is only non-user-initiated sounds -->
+ <property name="Muted" type="b" access="readwrite">
+ <annotation name="org.freedesktop.Accounts.DefaultValue" value="false"/>
+ </property>
+
+ <property name="LastRunningPlayer" type="s" access="readwrite">
+ <annotation name="org.freedesktop.Accounts.DefaultValue.String"
+ value=""/>
+ </property>
+
+ </interface>
+</node>
diff --git a/src/accounts-service-access.vala b/src/accounts-service-access.vala
index 9d8b6ae..9ce7f66 100644
--- a/src/accounts-service-access.vala
+++ b/src/accounts-service-access.vala
@@ -142,7 +142,7 @@ public class AccountsServiceAccess : Object
string user_path;
if (user_path_variant.check_format_string ("(o)", true)) {
user_path_variant.get ("(o)", out user_path);
- _user_proxy = yield DBusProxy.create_for_bus (BusType.SYSTEM, DBusProxyFlags.GET_INVALIDATED_PROPERTIES, null, "org.freedesktop.Accounts", user_path, "com.ubuntu.AccountsService.Sound");
+ _user_proxy = yield DBusProxy.create_for_bus (BusType.SYSTEM, DBusProxyFlags.GET_INVALIDATED_PROPERTIES, null, "org.freedesktop.Accounts", user_path, "org.ayatana.AccountsService.Sound");
} else {
warning ("Unable to find user name after calling FindUserByName. Expected type: %s and obtained %s", "(o)", user_path_variant.get_type_string () );
return;
diff --git a/tests/dbus-types/CMakeLists.txt b/tests/dbus-types/CMakeLists.txt
index a50a5bb..aadc940 100644
--- a/tests/dbus-types/CMakeLists.txt
+++ b/tests/dbus-types/CMakeLists.txt
@@ -14,7 +14,7 @@ set(dbusinterface_accounts_xml "org.freedesktop.Accounts.xml")
set_source_files_properties(${dbusinterface_accounts_xml} PROPERTIES
CLASSNAME AccountsInterface)
-set(dbusinterface_accountssound_xml "com.ubuntu.AccountsService.Sound.xml")
+set(dbusinterface_accountssound_xml "org.ayatana.AccountsService.Sound.xml")
set_source_files_properties(${dbusinterface_accountssound_xml} PROPERTIES
CLASSNAME AccountsSoundInterface)
diff --git a/tests/dbus-types/com.ubuntu.AccountsService.Sound.xml b/tests/dbus-types/org.ayatana.sound.AccountsService.xml
index 27c915a..aa05cf3 100644
--- a/tests/dbus-types/com.ubuntu.AccountsService.Sound.xml
+++ b/tests/dbus-types/org.ayatana.sound.AccountsService.xml
@@ -1,5 +1,5 @@
<node>
- <interface name="com.ubuntu.AccountsService.Sound">
+ <interface name="org.ayatana.AccountsService.Sound">
<method name="Set">
<arg direction="in" type="s" name="interface" />
<arg direction="in" type="s" name="property" />
diff --git a/tests/service-mocks/accounts-mock/AccountsDefs.h b/tests/service-mocks/accounts-mock/AccountsDefs.h
index 0e4f270..9933af0 100644
--- a/tests/service-mocks/accounts-mock/AccountsDefs.h
+++ b/tests/service-mocks/accounts-mock/AccountsDefs.h
@@ -28,7 +28,7 @@ namespace testing
constexpr const char ACCOUNTS_SERVICE[] = "org.freedesktop.Accounts";
constexpr const char USER_PATH[] = "/org/freedesktop/Accounts/UserTest";
constexpr const char ACCOUNTS_PATH[] = "/org/freedesktop/Accounts";
- constexpr const char ACCOUNTS_SOUND_INTERFACE[] = "com.ubuntu.AccountsService.Sound";
+ constexpr const char ACCOUNTS_SOUND_INTERFACE[] = "org.ayatana.AccountsService.Sound";
} // namespace testing
} // namespace indicators
diff --git a/tests/service-mocks/accounts-mock/CMakeLists.txt b/tests/service-mocks/accounts-mock/CMakeLists.txt
index ad858bd..6eb9fb5 100644
--- a/tests/service-mocks/accounts-mock/CMakeLists.txt
+++ b/tests/service-mocks/accounts-mock/CMakeLists.txt
@@ -7,14 +7,14 @@ include_directories(${Qt5DBus_INCLUDE_DIRS}
add_definitions(-DQT_NO_KEYWORDS=1)
-set(dbusinterface_sound_xml "com.ubuntu.AccountsService.Sound.Mock.xml")
+set(dbusinterface_sound_xml "org.ayatana.AccountsService.Sound.Mock.xml")
set_source_files_properties(${dbusinterface_sound_xml} PROPERTIES
CLASSNAME AccountsServiceSoundMockInterface)
qt5_add_dbus_interface(interface_files ${dbusinterface_sound_xml} accountsservice_sound_interface)
qt5_add_dbus_adaptor(adaptor_files
- com.ubuntu.AccountsService.Sound.Mock.xml
+ org.ayatana.AccountsService.Sound.Mock.xml
AccountsServiceSoundMock.h
ubuntu::indicators::testing::AccountsServiceSoundMock
AccountsServiceSoundMockAdaptor)
diff --git a/tests/service-mocks/accounts-mock/com.ubuntu.AccountsService.Sound.Mock.xml b/tests/service-mocks/accounts-mock/org.ayatana.AccountsService.Sound.Mock.xml
index daf82e5..ae9170f 100644
--- a/tests/service-mocks/accounts-mock/com.ubuntu.AccountsService.Sound.Mock.xml
+++ b/tests/service-mocks/accounts-mock/org.ayatana.AccountsService.Sound.Mock.xml
@@ -1,6 +1,6 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
- <interface name="com.ubuntu.AccountsService.Sound">
+ <interface name="org.ayatana.AccountsService.Sound">
<property name="Volume" type="d" access="readwrite"/>
<property name="LastRunningPlayer" type="s" access="readwrite"/>
</interface>
diff --git a/tests/service-mocks/media-player-mpris-mock/MediaPlayerMprisDefs.h b/tests/service-mocks/media-player-mpris-mock/MediaPlayerMprisDefs.h
index 4d28b38..a000c4e 100644
--- a/tests/service-mocks/media-player-mpris-mock/MediaPlayerMprisDefs.h
+++ b/tests/service-mocks/media-player-mpris-mock/MediaPlayerMprisDefs.h
@@ -28,7 +28,7 @@ namespace testing
constexpr const char MEDIA_PLAYER_MPRIS_SERVICE[] = "org.freedesktop.Accounts";
constexpr const char USER_PATH[] = "/org/freedesktop/Accounts/UserTest";
constexpr const char ACCOUNTS_PATH[] = "/org/freedesktop/Accounts";
- constexpr const char ACCOUNTS_SOUND_INTERFACE[] = "com.ubuntu.AccountsService.Sound";
+ constexpr const char ACCOUNTS_SOUND_INTERFACE[] = "org.ayatana.AccountsService.Sound";
} // namespace testing
} // namespace indicators