Ejemplo n.º 1
0
 public virtual void notify(java.lang.String arg0, int arg1, android.app.Notification arg2)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         @__env.CallVoidMethod(this.JvmHandle, global::android.app.NotificationManager._notify703, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg2));
     }
     else
     {
         @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.app.NotificationManager.staticClass, global::android.app.NotificationManager._notify703, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg2));
     }
 }
Ejemplo n.º 2
0
 public virtual void startForeground(int arg0, android.app.Notification arg1)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         @__env.CallVoidMethod(this.JvmHandle, global::android.app.Service._startForeground806, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1));
     }
     else
     {
         @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.app.Service.staticClass, global::android.app.Service._startForeground806, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1));
     }
 }
Ejemplo n.º 3
0
 public virtual void readFromParcel(android.os.Parcel @in)
 {
     this.pkg = @in.readString();
     this.id  = @in.readInt();
     if (@in.readInt() != 0)
     {
         this.tag = @in.readString();
     }
     else
     {
         this.tag = null;
     }
     this.uid          = @in.readInt();
     this.initialPid   = @in.readInt();
     this.priority     = @in.readInt();
     this.notification = new android.app.Notification(@in);
 }
Ejemplo n.º 4
0
 public StatusBarNotification(string pkg, int id, string tag, int uid, int initialPid
                              , android.app.Notification notification)
 {
     if (pkg == null)
     {
         throw new System.ArgumentNullException();
     }
     if (notification == null)
     {
         throw new System.ArgumentNullException();
     }
     this.pkg          = pkg;
     this.id           = id;
     this.tag          = tag;
     this.uid          = uid;
     this.initialPid   = initialPid;
     this.notification = notification;
     this.priority     = PRIORITY_NORMAL;
 }
Ejemplo n.º 5
0
 public abstract void enqueueNotificationWithTagPriority(string arg1, string arg2,
                                                         int arg3, int arg4, android.app.Notification arg5, int[] arg6);
Ejemplo n.º 6
0
 public abstract void enqueueNotification(string arg1, int arg2, android.app.Notification
                                          arg3, int[] arg4);
Ejemplo n.º 7
0
 public abstract void enqueueNotificationWithTag(string arg1, string arg2, int arg3
                                                 , android.app.Notification arg4, int[] arg5);
Ejemplo n.º 8
0
 public virtual void enqueueNotificationWithTagPriority(string pkg, string tag, int
                                                        id, int priority, android.app.Notification notification, int[] idReceived)
 {
     throw new System.NotImplementedException();
 }
Ejemplo n.º 9
0
 public virtual void enqueueNotification(string pkg, int id, android.app.Notification
                                         notification, int[] idReceived)
 {
     throw new System.NotImplementedException();
 }
Ejemplo n.º 10
0
 public virtual void notify(string tag, int id, android.app.Notification notification
                            )
 {
     throw new System.NotImplementedException();
 }
        /*
         * Show the notification in the Android notification drawer
         */
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @TargetApi(android.os.Build.VERSION_CODES.KITKAT_WATCH) private void showNotification(com.twilio.voice.IncomingCallMessage incomingCallMessage, int notificationId)
        private void showNotification(IncomingCallMessage incomingCallMessage, int notificationId)
        {
            string callSid = incomingCallMessage.CallSid;

            if (!incomingCallMessage.Cancelled)
            {
                /*
                 * Create a PendingIntent to specify the action when the notification is
                 * selected in the notification drawer
                 */
                Intent intent = new Intent(this, typeof(VoiceActivity));
                intent.Action = VoiceActivity.ACTION_INCOMING_CALL;
                intent.putExtra(VoiceActivity.INCOMING_CALL_MESSAGE, incomingCallMessage);
                intent.putExtra(VoiceActivity.INCOMING_CALL_NOTIFICATION_ID, notificationId);
                intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_ONE_SHOT);

                /*
                 * Pass the notification id and call sid to use as an identifier to cancel the
                 * notification later
                 */
                Bundle extras = new Bundle();
                extras.putInt(NOTIFICATION_ID_KEY, notificationId);
                extras.putString(CALL_SID_KEY, callSid);

                /*
                 * Create the notification shown in the notification drawer
                 */
                NotificationCompat.Builder notificationBuilder = (new NotificationCompat.Builder(this)).setSmallIcon(R.drawable.ic_call_white_24px).setContentTitle(getString([email protected]_name)).setContentTextuniquetempvar.setAutoCancel(true).setExtras(extras).setContentIntent(pendingIntent).setColor(Color.rgb(214, 10, 37));

                notificationManager.notify(notificationId, notificationBuilder.build());
            }
            else
            {
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
                {
                    /*
                     * If the incoming call was cancelled then remove the notification by matching
                     * it with the call sid from the list of notifications in the notification drawer.
                     */
                    StatusBarNotification[] activeNotifications = notificationManager.ActiveNotifications;
                    foreach (StatusBarNotification statusBarNotification in activeNotifications)
                    {
                        Notification notification        = statusBarNotification.Notification;
                        Bundle       extras              = notification.extras;
                        string       notificationCallSid = extras.getString(CALL_SID_KEY);
                        if (callSid.Equals(notificationCallSid))
                        {
                            notificationManager.cancel(extras.getInt(NOTIFICATION_ID_KEY));
                        }
                    }
                }
                else
                {
                    /*
                     * Prior to Android M the notification manager did not provide a list of
                     * active notifications so we lazily clear all the notifications when
                     * receiving a cancelled call.
                     *
                     * In order to properly cancel a notification using
                     * NotificationManager.cancel(notificationId) we should store the call sid &
                     * notification id of any incoming calls using shared preferences or some other form
                     * of persistent storage.
                     */
                    notificationManager.cancelAll();
                }
            }
        }
Ejemplo n.º 12
0
 public void startForeground(int id, android.app.Notification notification)
 {
     throw new System.NotImplementedException();
 }