Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.freedesktop.dbus;

import org.freedesktop.dbus.annotations.DBusBoundProperty;
import org.freedesktop.dbus.annotations.MethodAllowInteractiveAutorization;
import org.freedesktop.dbus.annotations.MethodNoReply;
import org.freedesktop.dbus.connections.AbstractConnection;
import org.freedesktop.dbus.errors.NoReply;
Expand Down Expand Up @@ -196,6 +197,9 @@ public static Object executeRemoteMethod(boolean _methodCall, final RemoteObject
if (_m.isAnnotationPresent(MethodNoReply.class)) {
flags |= Flags.NO_REPLY_EXPECTED;
}
if (_m.isAnnotationPresent(MethodAllowInteractiveAutorization.class)) {
flags |= Flags.ALLOW_INTERACTIVE_AUTHORIZATION;
}
try {
String name = DBusNamingUtil.getMethodName(_m);
if (null == _ro.getInterface()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package org.freedesktop.dbus.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Methods allow interactive autorization
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@DBusInterfaceName("org.freedesktop.DBus.Method.AllowInteractiveAutorization")
public @interface MethodAllowInteractiveAutorization {

/**
* Annotation value, true by default
*
* @return true when a method allow interactive autorization, false otherwise
*/
boolean value() default true;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
* @since 5.0.0 - 2023-10-23
*/
public final class Flags {
public static final byte NO_REPLY_EXPECTED = 0x01;
public static final byte NO_AUTO_START = 0x02;
public static final byte ASYNC = 0x40;
public static final byte NO_REPLY_EXPECTED = 0x01;
public static final byte NO_AUTO_START = 0x02;
public static final byte ALLOW_INTERACTIVE_AUTHORIZATION = 0x04;
public static final byte ASYNC = 0x40;

private Flags() {

Expand Down