From 01876018ef6af29a28a82c802fcc5de959e8109b Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 27 Oct 2017 01:13:52 +0000 Subject: data/org.ayatana.AccountsService.Sound: Use Ayatana namespace. * Namespace switch from com.ubuntu to org.ayatana. * Add AccountsServer interface for the greeter. Obtained from accountsservice-ubuntu-schemas and adapted. --- data/50-org.ayatana.AccountsService.Sound.pkla | 13 ++++++++++ data/CMakeLists.txt | 28 +++++++++++++++++++--- data/org.ayatana.AccountsService.Sound.policy | 24 +++++++++++++++++++ data/org.ayatana.AccountsService.Sound.xml | 27 +++++++++++++++++++++ src/accounts-service-access.vala | 2 +- tests/dbus-types/CMakeLists.txt | 2 +- .../com.ubuntu.AccountsService.Sound.xml | 9 ------- .../org.ayatana.sound.AccountsService.xml | 9 +++++++ tests/service-mocks/accounts-mock/AccountsDefs.h | 2 +- tests/service-mocks/accounts-mock/CMakeLists.txt | 4 ++-- .../com.ubuntu.AccountsService.Sound.Mock.xml | 7 ------ .../org.ayatana.AccountsService.Sound.Mock.xml | 7 ++++++ .../media-player-mpris-mock/MediaPlayerMprisDefs.h | 2 +- 13 files changed, 111 insertions(+), 25 deletions(-) create mode 100644 data/50-org.ayatana.AccountsService.Sound.pkla create mode 100644 data/org.ayatana.AccountsService.Sound.policy create mode 100644 data/org.ayatana.AccountsService.Sound.xml delete mode 100644 tests/dbus-types/com.ubuntu.AccountsService.Sound.xml create mode 100644 tests/dbus-types/org.ayatana.sound.AccountsService.xml delete mode 100644 tests/service-mocks/accounts-mock/com.ubuntu.AccountsService.Sound.Mock.xml create mode 100644 tests/service-mocks/accounts-mock/org.ayatana.AccountsService.Sound.Mock.xml 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 @@ + + + + + + + no + no + auth_admin_keep + + + + + + + no + no + no + + + 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + 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/com.ubuntu.AccountsService.Sound.xml deleted file mode 100644 index 27c915a..0000000 --- a/tests/dbus-types/com.ubuntu.AccountsService.Sound.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/tests/dbus-types/org.ayatana.sound.AccountsService.xml b/tests/dbus-types/org.ayatana.sound.AccountsService.xml new file mode 100644 index 0000000..aa05cf3 --- /dev/null +++ b/tests/dbus-types/org.ayatana.sound.AccountsService.xml @@ -0,0 +1,9 @@ + + + + + + + + + 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/com.ubuntu.AccountsService.Sound.Mock.xml deleted file mode 100644 index daf82e5..0000000 --- a/tests/service-mocks/accounts-mock/com.ubuntu.AccountsService.Sound.Mock.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/tests/service-mocks/accounts-mock/org.ayatana.AccountsService.Sound.Mock.xml b/tests/service-mocks/accounts-mock/org.ayatana.AccountsService.Sound.Mock.xml new file mode 100644 index 0000000..ae9170f --- /dev/null +++ b/tests/service-mocks/accounts-mock/org.ayatana.AccountsService.Sound.Mock.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file 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 -- cgit v1.2.3