Share via


AppOpsManager.StartOp Method

Definition

Overloads

StartOp(String, Int32, String)

This member is deprecated.

StartOp(String, Int32, String, String, String)

Report that an application has started executing a long-running operation.

StartOp(String, Int32, String)

This member is deprecated.

[Android.Runtime.Register("startOp", "(Ljava/lang/String;ILjava/lang/String;)I", "GetStartOp_Ljava_lang_String_ILjava_lang_String_Handler")]
public virtual Android.App.AppOpsManagerMode StartOp (string op, int uid, string packageName);
[<Android.Runtime.Register("startOp", "(Ljava/lang/String;ILjava/lang/String;)I", "GetStartOp_Ljava_lang_String_ILjava_lang_String_Handler")>]
abstract member StartOp : string * int * string -> Android.App.AppOpsManagerMode
override this.StartOp : string * int * string -> Android.App.AppOpsManagerMode

Parameters

op
String

The operation to start. One of the OPSTR_* constants.

uid
Int32

The user id of the application attempting to perform the operation.

packageName
String

The name of the application attempting to perform the operation.

Returns

Attributes

Exceptions

If the app has been configured to crash on this op.

Remarks

This member is deprecated. use #startOp(String, int, String, String, String) instead

Java documentation for android.app.AppOpsManager.startOp(java.lang.String, int, java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

StartOp(String, Int32, String, String, String)

Report that an application has started executing a long-running operation.

[Android.Runtime.Register("startOp", "(Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)I", "GetStartOp_Ljava_lang_String_ILjava_lang_String_Ljava_lang_String_Ljava_lang_String_Handler", ApiSince=30)]
public virtual Android.App.AppOpsManagerMode StartOp (string op, int uid, string? packageName, string? attributionTag, string? message);
[<Android.Runtime.Register("startOp", "(Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)I", "GetStartOp_Ljava_lang_String_ILjava_lang_String_Ljava_lang_String_Ljava_lang_String_Handler", ApiSince=30)>]
abstract member StartOp : string * int * string * string * string -> Android.App.AppOpsManagerMode
override this.StartOp : string * int * string * string * string -> Android.App.AppOpsManagerMode

Parameters

op
String

The operation to start. One of the OPSTR_* constants.

uid
Int32

The user id of the application attempting to perform the operation.

packageName
String

The name of the application attempting to perform the operation.

attributionTag
String

The Context#createAttributionContext attribution tag or null for default attribution

message
String

Description why op was started

Returns

Returns #MODE_ALLOWED if the operation is allowed, or #MODE_IGNORED if it is not allowed and should be silently ignored (without causing the app to crash).

Attributes

Remarks

Report that an application has started executing a long-running operation.

For more details how to determine the callingPackageName, callingAttributionTag, and message, please check the description in #noteOp(String, int, String, String, String)

Java documentation for android.app.AppOpsManager.startOp(java.lang.String, int, java.lang.String, java.lang.String, java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to