Table of Contents

Class UpdateReadyReceiver

Namespace
VpnHood.AppLib.App.Android
Assembly
VpnHood.AppLib.App.Android.dll

Provides the notification that the update the person started downloading is ready, when the app is not in front to show it in its notice.

[BroadcastReceiver(Exported = true, Permission = "android.permission.SEND_DOWNLOAD_COMPLETED_INTENTS")]
[IntentFilter(new string[] { "android.intent.action.DOWNLOAD_COMPLETE" })]
public class UpdateReadyReceiver : BroadcastReceiver, IJavaPeerable, IJavaObject, IDisposable
Inheritance
UpdateReadyReceiver
Implements
Inherited Members

Remarks

It is in the manifest, as Android 14 may hold the broadcast to a receiver registered at run time until the app is in front again. It is inert in a head whose app updates through its store, and Android drops the notification without the notification permission; the notice still shows Install at the next open.

Methods

OnReceive(Context?, Intent?)

This method is called when the BroadcastReceiver is receiving an Intent broadcast.

public override void OnReceive(Context? context, Intent? intent)

Parameters

context Context

The Context in which the receiver is running.

intent Intent

The Intent being received.

Remarks

This method is called when the BroadcastReceiver is receiving an Intent broadcast. During this time you can use the other methods on BroadcastReceiver to view/modify the current result values. This method is always called within the main thread of its process, unless you explicitly asked for it to be scheduled on a different thread using android.content.Context#registerReceiver(BroadcastReceiver, IntentFilter, String, android.os.Handler). When it runs on the main thread you should never perform long-running operations in it (there is a timeout of 10 seconds that the system allows before considering the receiver to be blocked and a candidate to be killed). You cannot launch a popup dialog in your implementation of onReceive().

<b>If this BroadcastReceiver was launched through a &lt;receiver&gt; tag, then the object is no longer alive after returning from this function.</b> This means you should not perform any operations that return a result to you asynchronously. If you need to perform any follow up background work, schedule a android.app.job.JobService with android.app.job.JobScheduler.

If you wish to interact with a service that is already running and previously bound using android.content.Context#bindService(Intent, ServiceConnection, int) bindService(), you can use #peekService.

The Intent filters used in android.content.Context#registerReceiver and in application manifests are <em>not</em> guaranteed to be exclusive. They are hints to the operating system about how to find suitable recipients. It is possible for senders to force delivery to specific recipients, bypassing filter resolution. For this reason, #onReceive(Context, Intent) onReceive() implementations should respond only to known actions, ignoring any unexpected Intents that they may receive.

Java documentation for

        <pre><code class="lang-csharp">android.content.BroadcastReceiver.onReceive(android.content.Context, android.content.Intent)</code></pre>

        .</a>
    </format>
</p>
<p>
    Portions of this page are modifications based on work created and shared by the 
    <format type="text/html"><a href="https://developers.google.com/terms/site-policies" title="Android Open Source Project">Android Open Source Project</a></format>
     and used according to terms described in the 
    <format type="text/html"><a href="https://creativecommons.org/licenses/by/2.5/" title="Creative Commons 2.5 Attribution License">Creative Commons 2.5 Attribution License.</a></format></p>