Sdílet prostřednictvím


Context.UpdateServiceGroup(IServiceConnection, Int32, Int32) Method

Definition

For a service previously bound with #bindService or a related method, change how the system manages that service's process in relation to other processes.

[Android.Runtime.Register("updateServiceGroup", "(Landroid/content/ServiceConnection;II)V", "GetUpdateServiceGroup_Landroid_content_ServiceConnection_IIHandler", ApiSince=29)]
public virtual void UpdateServiceGroup (Android.Content.IServiceConnection conn, int group, int importance);
[<Android.Runtime.Register("updateServiceGroup", "(Landroid/content/ServiceConnection;II)V", "GetUpdateServiceGroup_Landroid_content_ServiceConnection_IIHandler", ApiSince=29)>]
abstract member UpdateServiceGroup : Android.Content.IServiceConnection * int * int -> unit
override this.UpdateServiceGroup : Android.Content.IServiceConnection * int * int -> unit

Parameters

conn
IServiceConnection

The connection interface previously supplied to bindService(). This parameter must not be null.

group
Int32

A group to put this connection's process in. Upon calling here, this will override any previous group that was set for that process. The group tells the system about processes that are logically grouped together, so should be managed as one unit of importance (such as when being considered a recently used app). All processes in the same app with the same group are considered to be related. Supplying 0 reverts to the default behavior of not grouping.

importance
Int32

Additional importance of the processes within a group. Upon calling here, this will override any previous importance that was set for that process. The most important process is 0, and higher values are successively less important. You can view this as describing how to order the processes in an array, with the processes at the end of the array being the least important. This value has no meaning besides indicating how processes should be ordered in that array one after the other. This provides a way to fine-tune the system's process killing, guiding it to kill processes at the end of the array first.

Attributes

Remarks

For a service previously bound with #bindService or a related method, change how the system manages that service's process in relation to other processes. This doesn't modify the original bind flags that were passed in when binding, but adjusts how the process will be managed in some cases based on those flags. Currently only works on isolated processes (will be ignored for non-isolated processes).

Note that this call does not take immediate effect, but will be applied the next time the impacted process is adjusted for some other reason. Typically you would call this before then calling a new #bindIsolatedService on the service of interest, with that binding causing the process to be shuffled accordingly.

Java documentation for android.content.Context.updateServiceGroup(android.content.ServiceConnection, int, int).

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