示例#1
0
 internal DeathMonitor(ServiceDispatcher _enclosing, android.content.ComponentName
                       name, android.os.IBinder service)
 {
     this._enclosing = _enclosing;
     this.mName      = name;
     this.mService   = service;
 }
示例#2
0
 public void death(android.content.ComponentName name, android.os.IBinder service)
 {
     android.app.LoadedApk.ServiceDispatcher.ConnectionInfo old;
     lock (this)
     {
         mDied = true;
         old   = mActiveConnections.remove(name);
         if (old == null || old.binder != service)
         {
             // Death for someone different than who we last
             // reported...  just ignore it.
             return;
         }
         old.binder.unlinkToDeath(old.deathMonitor, 0);
     }
     if (mActivityThread != null)
     {
         mActivityThread.post(new android.app.LoadedApk.ServiceDispatcher.RunConnection(this
                                                                                        , name, service, 1));
     }
     else
     {
         doDeath(name, service);
     }
 }
		public override void onReceive(Context context, Intent intent)
		{
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
			ComponentName comp = new ComponentName(context.PackageName, typeof(GcmIntentService).FullName);
			startWakefulService(context, (intent.setComponent(comp)));
			ResultCode = Activity.RESULT_OK;
		}
示例#4
0
        /// <summary>Gets the activity or application icon for an activity.</summary>
        /// <remarks>Gets the activity or application icon for an activity.</remarks>
        /// <param name="component">Name of an activity.</param>
        /// <returns>
        /// A drawable, or
        /// <code>null</code>
        /// if neither the acitivy or the application
        /// have an icon set.
        /// </returns>
        private android.graphics.drawable.Drawable getActivityIcon(android.content.ComponentName
                                                                   component)
        {
            android.content.pm.PackageManager pm = mContext.getPackageManager();
            android.content.pm.ActivityInfo   activityInfo;
            try
            {
                activityInfo = pm.getActivityInfo(component, android.content.pm.PackageManager.GET_META_DATA
                                                  );
            }
            catch (android.content.pm.PackageManager.NameNotFoundException ex)
            {
                android.util.Log.w(LOG_TAG, ex.ToString());
                return(null);
            }
            int iconId = activityInfo.getIconResource();

            if (iconId == 0)
            {
                return(null);
            }
            string pkg = component.getPackageName();

            android.graphics.drawable.Drawable drawable = pm.getDrawable(pkg, iconId, activityInfo
                                                                         .applicationInfo);
            if (drawable == null)
            {
                android.util.Log.w(LOG_TAG, "Invalid icon resource " + iconId + " for " + component
                                   .flattenToShortString());
                return(null);
            }
            return(drawable);
        }
示例#5
0
 public virtual void bindAppWidgetId(int appWidgetId, android.content.ComponentName
                                     provider)
 {
     android.os.Parcel _data  = android.os.Parcel.obtain();
     android.os.Parcel _reply = android.os.Parcel.obtain();
     try
     {
         _data.writeInterfaceToken(DESCRIPTOR);
         _data.writeInt(appWidgetId);
         if ((provider != null))
         {
             _data.writeInt(1);
             provider.writeToParcel(_data, 0);
         }
         else
         {
             _data.writeInt(0);
         }
         mRemote.transact(android.appwidget.@internal.IAppWidgetServiceClass.Stub.TRANSACTION_bindAppWidgetId
                          , _data, _reply, 0);
         _reply.readException();
     }
     finally
     {
         _reply.recycle();
         _data.recycle();
     }
 }
示例#6
0
 public virtual int[] getAppWidgetIds(android.content.ComponentName provider)
 {
     android.os.Parcel _data  = android.os.Parcel.obtain();
     android.os.Parcel _reply = android.os.Parcel.obtain();
     int[]             _result;
     try
     {
         _data.writeInterfaceToken(DESCRIPTOR);
         if ((provider != null))
         {
             _data.writeInt(1);
             provider.writeToParcel(_data, 0);
         }
         else
         {
             _data.writeInt(0);
         }
         mRemote.transact(android.appwidget.@internal.IAppWidgetServiceClass.Stub.TRANSACTION_getAppWidgetIds
                          , _data, _reply, 0);
         _reply.readException();
         _result = _reply.createIntArray();
     }
     finally
     {
         _reply.recycle();
         _data.recycle();
     }
     return(_result);
 }
示例#7
0
 public override void onServiceConnected(ComponentName className, IBinder binder)
 {
     Log.d(TAG, "onServiceConnected");
     outerInstance.mService = new WeakReference <MainService>(((MainService.LocalBinder)binder).getMainService(outerInstance));
     // Connection bridge is set to the FloatingController.
     // You can have only one AudioAppConnectionBridge in the application
     // so you need to pass it from service to FloatingController.
     if (outerInstance.mService != null && outerInstance.mService.get() != null && outerInstance.mFloatingController != null)
     {
         try
         {
             outerInstance.mFloatingController.SapaAppService = outerInstance.mService.get().SapaAppService;
         }
         catch (System.NullReferenceException)
         {
             ;
         }
     }
     // Set buttons in state from the service.
     if (outerInstance.mVisibleAppInfo != null)
     {
         outerInstance.CurrentState = outerInstance.mVisibleAppInfo.App;
     }
     if (outerInstance.mService != null && outerInstance.mService.get() != null)
     {
         try
         {
             outerInstance.updateVolumeTextView(outerInstance.mService.get().getVolumeText(outerInstance.mVisibleAppInfo));
         }
         catch (System.NullReferenceException)
         {
             ;
         }
     }
 }
示例#8
0
            public override void onServiceConnected(ComponentName className, IBinder binder)
            {
                ((ClearNotificationService.ClearBinder)binder).service.startService(new Intent(outerInstance, typeof(ClearNotificationService)));
                NotificationManager mNotificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);

                mNotificationManager.notify(ClearNotificationService.NOTIFICATION_ID, outerInstance.mNotifyBuilder.build());
            }
示例#9
0
        public virtual int addIntentOptions(int groupId, int itemId, int order, android.content.ComponentName
                                            caller, android.content.Intent[] specifics, android.content.Intent intent, int
                                            flags, android.view.MenuItem[] outSpecificItems)
        {
            android.content.pm.PackageManager pm = mContext.getPackageManager();
            java.util.List <android.content.pm.ResolveInfo> lri = pm.queryIntentActivityOptions
                                                                      (caller, specifics, intent, 0);
            int N = lri != null?lri.size() : 0;

            if ((flags & android.view.MenuClass.FLAG_APPEND_TO_GROUP) == 0)
            {
                removeGroup(groupId);
            }
            {
                for (int i = 0; i < N; i++)
                {
                    android.content.pm.ResolveInfo ri      = lri.get(i);
                    android.content.Intent         rintent = new android.content.Intent(ri.specificIndex < 0 ?
                                                                                        intent : specifics[ri.specificIndex]);
                    rintent.setComponent(new android.content.ComponentName(ri.activityInfo.applicationInfo
                                                                           .packageName, ri.activityInfo.name));
                    android.view.MenuItem item = add(groupId, itemId, order, ri.loadLabel(pm)).setIcon
                                                     (ri.loadIcon(pm)).setIntent(rintent);
                    if (outSpecificItems != null && ri.specificIndex >= 0)
                    {
                        outSpecificItems[ri.specificIndex] = item;
                    }
                }
            }
            return(N);
        }
示例#10
0
            public override void onServiceConnected(ComponentName className, IBinder binder)
            {
                Log.d(TAG, "onServiceConnected");
                outerInstance.mService = new WeakReference <MainService>(((MainService.LocalBinder)binder).getMainService(outerInstance));
                //Connection bridge is set to the FloatingController.
                //You can have only one AudioAppConnectionBridge in the application
                //so you need to pass it from service to FloatingController.

                if (outerInstance.mService != null && outerInstance.mService.get() != null && outerInstance.mFloatingController != null)
                {
                    try
                    {
                        outerInstance.mFloatingController.SapaAppService = outerInstance.mService.get().SapaAppService;
                    }
                    catch (System.NullReferenceException)
                    {
                        ;
                    }
                }

                if (outerInstance.mService != null && outerInstance.mService.get() != null)
                {
                    try
                    {
                        Log.d(TAG, "Connection bridge set " + outerInstance.mService.get().SapaAppService);
                    }
                    catch (System.NullReferenceException)
                    {
                        ;
                    }
                }
            }
示例#11
0
 internal RunConnection(ServiceDispatcher _enclosing, android.content.ComponentName
                        name, android.os.IBinder service, int command)
 {
     this._enclosing = _enclosing;
     this.mName      = name;
     this.mService   = service;
     this.mCommand   = command;
 }
示例#12
0
        public override void onReceive(Context context, Intent intent)
        {
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
            ComponentName comp = new ComponentName(context.PackageName, typeof(GcmIntentService).FullName);

            startWakefulService(context, (intent.setComponent(comp)));
            ResultCode = Activity.RESULT_OK;
        }
示例#13
0
 public override void connected(android.content.ComponentName name, android.os.IBinder
                                service)
 {
     android.app.LoadedApk.ServiceDispatcher sd = mDispatcher.get();
     if (sd != null)
     {
         sd.connected(name, service);
     }
 }
示例#14
0
		public override void onServiceDisconnected(ComponentName componentName)
		{
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
			if (typeof(SinchService).FullName.Equals(componentName.ClassName))
			{
				mSinchServiceInterface = null;
				onServiceDisconnected();
			}
		}
        public override void onServiceDisconnected(ComponentName componentName)
        {
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
            if (typeof(SinchService).FullName.Equals(componentName.ClassName))
            {
                mSinchServiceInterface = null;
                onServiceDisconnected();
            }
        }
示例#16
0
 public void doConnected(android.content.ComponentName name, android.os.IBinder service
                         )
 {
     android.app.LoadedApk.ServiceDispatcher.ConnectionInfo old;
     android.app.LoadedApk.ServiceDispatcher.ConnectionInfo info;
     lock (this)
     {
         old = mActiveConnections.get(name);
         if (old != null && old.binder == service)
         {
             // Huh, already have this one.  Oh well!
             return;
         }
         if (service != null)
         {
             // A new service is being connected... set it all up.
             mDied             = false;
             info              = new android.app.LoadedApk.ServiceDispatcher.ConnectionInfo();
             info.binder       = service;
             info.deathMonitor = new android.app.LoadedApk.ServiceDispatcher.DeathMonitor(this
                                                                                          , name, service);
             try
             {
                 service.linkToDeath(info.deathMonitor, 0);
                 mActiveConnections.put(name, info);
             }
             catch (android.os.RemoteException)
             {
                 // This service was dead before we got it...  just
                 // don't do anything with it.
                 mActiveConnections.remove(name);
                 return;
             }
         }
         else
         {
             // The named service is being disconnected... clean up.
             mActiveConnections.remove(name);
         }
         if (old != null)
         {
             old.binder.unlinkToDeath(old.deathMonitor, 0);
         }
     }
     // If there was an old service, it is not disconnected.
     if (old != null)
     {
         mConnection.onServiceDisconnected(name);
     }
     // If there is a new service, it is now connected.
     if (service != null)
     {
         mConnection.onServiceConnected(name, service);
     }
 }
示例#17
0
 /// <summary>
 /// Get the list of appWidgetIds that have been bound to the given AppWidget
 /// provider.
 /// </summary>
 /// <remarks>
 /// Get the list of appWidgetIds that have been bound to the given AppWidget
 /// provider.
 /// </remarks>
 /// <param name="provider">
 /// The
 /// <see cref="android.content.BroadcastReceiver">android.content.BroadcastReceiver</see>
 /// that is the
 /// AppWidget provider to find appWidgetIds for.
 /// </param>
 public virtual int[] getAppWidgetIds(android.content.ComponentName provider)
 {
     try
     {
         return(sService.getAppWidgetIds(provider));
     }
     catch (android.os.RemoteException e)
     {
         throw new java.lang.RuntimeException("system server dead?", e);
     }
 }
示例#18
0
 /// <summary>Set the component for a given appWidgetId.</summary>
 /// <remarks>
 /// Set the component for a given appWidgetId.
 /// <p class="note">You need the APPWIDGET_LIST permission.  This method is to be used by the
 /// AppWidget picker.
 /// </remarks>
 /// <param name="appWidgetId">The AppWidget instance for which to set the RemoteViews.
 ///     </param>
 /// <param name="provider">
 /// The
 /// <see cref="android.content.BroadcastReceiver">android.content.BroadcastReceiver</see>
 /// that will be the AppWidget
 /// provider for this AppWidget.
 /// </param>
 public virtual void bindAppWidgetId(int appWidgetId, android.content.ComponentName
                                     provider)
 {
     try
     {
         sService.bindAppWidgetId(appWidgetId, provider);
     }
     catch (android.os.RemoteException e)
     {
         throw new java.lang.RuntimeException("system server dead?", e);
     }
 }
示例#19
0
 /// <summary>Set the RemoteViews to use for all AppWidget instances for the supplied AppWidget provider.
 ///     </summary>
 /// <remarks>
 /// Set the RemoteViews to use for all AppWidget instances for the supplied AppWidget provider.
 /// <p>
 /// It is okay to call this method both inside an
 /// <see cref="ACTION_APPWIDGET_UPDATE">ACTION_APPWIDGET_UPDATE</see>
 /// broadcast,
 /// and outside of the handler.
 /// This method will only work when called from the uid that owns the AppWidget provider.
 /// </remarks>
 /// <param name="provider">
 /// The
 /// <see cref="android.content.ComponentName">android.content.ComponentName</see>
 /// for the
 /// <see cref="android.content.BroadcastReceiver">BroadcastReceiver</see>
 /// provider
 /// for your AppWidget.
 /// </param>
 /// <param name="views">The RemoteViews object to show.</param>
 public virtual void updateAppWidget(android.content.ComponentName provider, android.widget.RemoteViews
                                     views)
 {
     try
     {
         sService.updateAppWidgetProvider(provider, views);
     }
     catch (android.os.RemoteException e)
     {
         throw new java.lang.RuntimeException("system server dead?", e);
     }
 }
示例#20
0
 public int compareTo(android.content.ComponentName arg0)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         return(@__env.CallIntMethod(this.JvmHandle, global::android.content.ComponentName._compareTo1111, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0)));
     }
     else
     {
         return(@__env.CallNonVirtualIntMethod(this.JvmHandle, global::android.content.ComponentName.staticClass, global::android.content.ComponentName._compareTo1111, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0)));
     }
 }
示例#21
0
 public virtual global::android.app.SearchableInfo getSearchableInfo(android.content.ComponentName arg0)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         return(global::MonoJavaBridge.JavaBridge.WrapJavaObject(@__env.CallObjectMethod(this.JvmHandle, global::android.app.SearchManager._getSearchableInfo762, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0))) as android.app.SearchableInfo);
     }
     else
     {
         return(global::MonoJavaBridge.JavaBridge.WrapJavaObject(@__env.CallNonVirtualObjectMethod(this.JvmHandle, global::android.app.SearchManager.staticClass, global::android.app.SearchManager._getSearchableInfo762, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0))) as android.app.SearchableInfo);
     }
 }
示例#22
0
 public virtual void startSearch(java.lang.String arg0, bool arg1, android.content.ComponentName arg2, android.os.Bundle arg3, bool arg4)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         @__env.CallVoidMethod(this.JvmHandle, global::android.app.SearchManager._startSearch755, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg2), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg3), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg4));
     }
     else
     {
         @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.app.SearchManager.staticClass, global::android.app.SearchManager._startSearch755, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg2), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg3), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg4));
     }
 }
示例#23
0
 public virtual bool isAdminActive(android.content.ComponentName arg0)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         return(@__env.CallBooleanMethod(this.JvmHandle, global::android.app.admin.DevicePolicyManager._isAdminActive897, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0)));
     }
     else
     {
         return(@__env.CallNonVirtualBooleanMethod(this.JvmHandle, global::android.app.admin.DevicePolicyManager.staticClass, global::android.app.admin.DevicePolicyManager._isAdminActive897, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0)));
     }
 }
示例#24
0
 public virtual long getMaximumTimeToLock(android.content.ComponentName arg0)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         return(@__env.CallLongMethod(this.JvmHandle, global::android.app.admin.DevicePolicyManager._getMaximumTimeToLock911, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0)));
     }
     else
     {
         return(@__env.CallNonVirtualLongMethod(this.JvmHandle, global::android.app.admin.DevicePolicyManager.staticClass, global::android.app.admin.DevicePolicyManager._getMaximumTimeToLock911, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0)));
     }
 }
示例#25
0
 public virtual void removeActiveAdmin(android.content.ComponentName arg0)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         @__env.CallVoidMethod(this.JvmHandle, global::android.app.admin.DevicePolicyManager._removeActiveAdmin899, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
     }
     else
     {
         @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.app.admin.DevicePolicyManager.staticClass, global::android.app.admin.DevicePolicyManager._removeActiveAdmin899, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
     }
 }
示例#26
0
 int android.view.Menu.addIntentOptions(int arg0, int arg1, int arg2, android.content.ComponentName arg3, android.content.Intent[] arg4, android.content.Intent arg5, int arg6, android.view.MenuItem[] arg7)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         return(@__env.CallIntMethod(this.JvmHandle, global::android.view.SubMenu_._addIntentOptions9019, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg2), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg3), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg4), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg5), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg6), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg7)));
     }
     else
     {
         return(@__env.CallNonVirtualIntMethod(this.JvmHandle, global::android.view.SubMenu_.staticClass, global::android.view.SubMenu_._addIntentOptions9019, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg2), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg3), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg4), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg5), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg6), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg7)));
     }
 }
示例#27
0
 public virtual void bindAppWidgetId(int arg0, android.content.ComponentName arg1)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         @__env.CallVoidMethod(this.JvmHandle, global::android.appwidget.AppWidgetManager._bindAppWidgetId985, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1));
     }
     else
     {
         @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.appwidget.AppWidgetManager.staticClass, global::android.appwidget.AppWidgetManager._bindAppWidgetId985, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1));
     }
 }
示例#28
0
 public virtual int getPasswordQuality(android.content.ComponentName arg0)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         return(@__env.CallIntMethod(this.JvmHandle, global::android.app.admin.DevicePolicyManager._getPasswordQuality901, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0)));
     }
     else
     {
         return(@__env.CallNonVirtualIntMethod(this.JvmHandle, global::android.app.admin.DevicePolicyManager.staticClass, global::android.app.admin.DevicePolicyManager._getPasswordQuality901, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0)));
     }
 }
示例#29
0
 public virtual void setPasswordMinimumLength(android.content.ComponentName arg0, int arg1)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         @__env.CallVoidMethod(this.JvmHandle, global::android.app.admin.DevicePolicyManager._setPasswordMinimumLength902, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1));
     }
     else
     {
         @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.app.admin.DevicePolicyManager.staticClass, global::android.app.admin.DevicePolicyManager._setPasswordMinimumLength902, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1));
     }
 }
示例#30
0
 public virtual void onServiceDisconnected(android.content.ComponentName arg0)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         @__env.CallVoidMethod(this.JvmHandle, global::android.media.MediaScannerConnection._onServiceDisconnected5061, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
     }
     else
     {
         @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.media.MediaScannerConnection.staticClass, global::android.media.MediaScannerConnection._onServiceDisconnected5061, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
     }
 }
示例#31
0
 public virtual int[] getAppWidgetIds(android.content.ComponentName arg0)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         return(global::MonoJavaBridge.JavaBridge.WrapJavaArrayObject <int>(@__env.CallObjectMethod(this.JvmHandle, global::android.appwidget.AppWidgetManager._getAppWidgetIds986, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0))) as int[]);
     }
     else
     {
         return(global::MonoJavaBridge.JavaBridge.WrapJavaArrayObject <int>(@__env.CallNonVirtualObjectMethod(this.JvmHandle, global::android.appwidget.AppWidgetManager.staticClass, global::android.appwidget.AppWidgetManager._getAppWidgetIds986, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0))) as int[]);
     }
 }
示例#32
0
 void android.content.ServiceConnection.onServiceDisconnected(android.content.ComponentName arg0)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         @__env.CallVoidMethod(this.JvmHandle, global::android.content.ServiceConnection_._onServiceDisconnected1756, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
     }
     else
     {
         @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.content.ServiceConnection_.staticClass, global::android.content.ServiceConnection_._onServiceDisconnected1756, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
     }
 }
		public override void onServiceConnected(ComponentName componentName, IBinder iBinder)
		{
			if (mIntent == null)
			{
				return;
			}

			if (SinchHelpers.isSinchPushIntent(mIntent))
			{
				SinchService.SinchServiceInterface sinchService = (SinchService.SinchServiceInterface) iBinder;
				if (sinchService != null)
				{
					NotificationResult result = sinchService.relayRemotePushNotificationPayload(mIntent);
					// handle result, e.g. show a notification or similar
				}
			}

			GcmBroadcastReceiver.completeWakefulIntent(mIntent);
			mIntent = null;
		}
示例#34
0
		internal void attach(android.content.Context context, android.app.ActivityThread 
			aThread, android.app.Instrumentation instr, android.os.IBinder token, int ident, 
			android.app.Application application, android.content.Intent intent, android.content.pm.ActivityInfo
			 info, java.lang.CharSequence title, android.app.Activity parent, string id, android.app.Activity
			.NonConfigurationInstances lastNonConfigurationInstances, android.content.res.Configuration
			 config)
		{
			attachBaseContext(context);
			mFragments.attachActivity(this);
			mWindow = [email protected](this);
			mWindow.setCallback(this);
			mWindow.getLayoutInflater().setPrivateFactory(this);
			if (info.softInputMode != android.view.WindowManagerClass.LayoutParams.SOFT_INPUT_STATE_UNSPECIFIED)
			{
				mWindow.setSoftInputMode(info.softInputMode);
			}
			if (info.uiOptions != 0)
			{
				mWindow.setUiOptions(info.uiOptions);
			}
			mUiThread = java.lang.Thread.currentThread();
			mMainThread = aThread;
			mInstrumentation = instr;
			mToken = token;
			mIdent = ident;
			mApplication = application;
			mIntent = intent;
			mComponent = intent.getComponent();
			mActivityInfo = info;
			mTitle = title;
			mParent = parent;
			mEmbeddedID = id;
			mLastNonConfigurationInstances = lastNonConfigurationInstances;
			mWindow.setWindowManager(null, mToken, mComponent.flattenToString(), (info.flags 
				& android.content.pm.ActivityInfo.FLAG_HARDWARE_ACCELERATED) != 0);
			if (mParent != null)
			{
				mWindow.setContainer(mParent.getWindow());
			}
			mWindowManager = mWindow.getWindowManager();
			mCurrentConfig = config;
		}
示例#35
0
			public override void onServiceConnected(ComponentName className, IBinder binder)
			{
				Log.d(TAG, "onServiceConnected");
				outerInstance.mService = new WeakReference<MainService>(((MainService.LocalBinder) binder).getMainService(outerInstance));
				// Connection bridge is set to the FloatingController.
				// You can have only one AudioAppConnectionBridge in the application
				// so you need to pass it from service to FloatingController.
				if (outerInstance.mService != null && outerInstance.mService.get() != null && outerInstance.mFloatingController != null)
				{
					try
					{
						outerInstance.mFloatingController.SapaAppService = outerInstance.mService.get().SapaAppService;
					}
					catch (System.NullReferenceException)
					{
						;
					}
				}

				outerInstance.setButtonsState();
			}
		public override void onServiceDisconnected(ComponentName componentName)
		{
		}
示例#37
0
		internal android.app.Activity performLaunchActivity(android.app.ActivityThread.ActivityClientRecord
			 r, android.content.Intent customIntent)
		{
			// System.out.println("##### [" + System.currentTimeMillis() + "] ActivityThread.performLaunchActivity(" + r + ")");
			android.content.pm.ActivityInfo aInfo = r.activityInfo;
			if (r.packageInfo == null)
			{
				r.packageInfo = getPackageInfo(aInfo.applicationInfo, r.compatInfo, android.content.Context
					.CONTEXT_INCLUDE_CODE);
			}
			android.content.ComponentName component = r.intent.getComponent();
			if (component == null)
			{
				component = r.intent.resolveActivity(mInitialApplication.getPackageManager());
				r.intent.setComponent(component);
			}
			if (r.activityInfo.targetActivity != null)
			{
				component = new android.content.ComponentName(r.activityInfo.packageName, r.activityInfo
					.targetActivity);
			}
			android.app.Activity activity = null;
			try
			{
				java.lang.ClassLoader cl = r.packageInfo.getClassLoader();
				activity = mInstrumentation.newActivity(cl, component.getClassName(), r.intent);
				android.os.StrictMode.incrementExpectedActivityCount(activity.GetType());
				r.intent.setExtrasClassLoader(cl);
				if (r.state != null)
				{
					r.state.setClassLoader(cl);
				}
			}
			catch (System.Exception e)
			{
				if (!mInstrumentation.onException(activity, e))
				{
					throw new java.lang.RuntimeException("Unable to instantiate activity " + component
						 + ": " + e.ToString(), e);
				}
			}
			try
			{
				android.app.Application app = r.packageInfo.makeApplication(false, mInstrumentation
					);
				if (activity != null)
				{
					android.app.ContextImpl appContext = new android.app.ContextImpl();
					appContext.init(r.packageInfo, r.token, this);
					appContext.setOuterContext(activity);
					java.lang.CharSequence title = r.activityInfo.loadLabel(appContext.getPackageManager
						());
					android.content.res.Configuration config = new android.content.res.Configuration(
						mCompatConfiguration);
					activity.attach(appContext, this, getInstrumentation(), r.token, r.ident, app, r.
						intent, r.activityInfo, title, r.parent, r.embeddedID, r.lastNonConfigurationInstances
						, config);
					if (customIntent != null)
					{
						activity.mIntent = customIntent;
					}
					r.lastNonConfigurationInstances = null;
					activity.mStartedActivity = false;
					int theme = r.activityInfo.getThemeResource();
					if (theme != 0)
					{
						activity.setTheme(theme);
					}
					activity.mCalled = false;
					mInstrumentation.callActivityOnCreate(activity, r.state);
					if (!activity.mCalled)
					{
						throw new android.app.SuperNotCalledException("Activity " + r.intent.getComponent
							().toShortString() + " did not call through to super.onCreate()");
					}
					r.activity = activity;
					r.stopped = true;
					if (!r.activity.mFinished)
					{
						activity.performStart();
						r.stopped = false;
					}
					if (!r.activity.mFinished)
					{
						if (r.state != null)
						{
							mInstrumentation.callActivityOnRestoreInstanceState(activity, r.state);
						}
					}
					if (!r.activity.mFinished)
					{
						activity.mCalled = false;
						mInstrumentation.callActivityOnPostCreate(activity, r.state);
						if (!activity.mCalled)
						{
							throw new android.app.SuperNotCalledException("Activity " + r.intent.getComponent
								().toShortString() + " did not call through to super.onPostCreate()");
						}
					}
				}
				r.paused = true;
				mActivities.put(r.token, r);
			}
			catch (android.app.SuperNotCalledException e)
			{
				throw;
			}
			catch (System.Exception e)
			{
				if (!mInstrumentation.onException(activity, e))
				{
					throw new java.lang.RuntimeException("Unable to start activity " + component + ": "
						 + e.ToString(), e);
				}
			}
			return activity;
		}
示例#38
0
			public override void onServiceConnected(ComponentName className, IBinder binder)
			{
				Log.d(TAG, "onServiceConnected");
				outerInstance.mService = new WeakReference<MainService>(((MainService.LocalBinder) binder).getMainService(outerInstance));
				// Connection bridge is set to the FloatingController.
				// You can have only one AudioAppConnectionBridge in the application
				// so you need to pass it from service to FloatingController.
				if (outerInstance.mService != null && outerInstance.mService.get() != null && outerInstance.mFloatingController != null)
				{
					try
					{
						outerInstance.mFloatingController.SapaAppService = outerInstance.mService.get().SapaAppService;
					}
					catch (System.NullReferenceException)
					{
						;
					}
				}
				// Set buttons in state from the service.
				if (outerInstance.mVisibleAppInfo != null)
				{
					outerInstance.CurrentState = outerInstance.mVisibleAppInfo.App;
				}
				if (outerInstance.mService != null && outerInstance.mService.get() != null)
				{
					try
					{
						outerInstance.updateVolumeTextView(outerInstance.mService.get().getVolumeText(outerInstance.mVisibleAppInfo));
					}
					catch (System.NullReferenceException)
					{
						;
					}
				}
			}
			public override void onServiceDisconnected(ComponentName className)
			{
				outerInstance.mConnection = null;
			}
			public override void onServiceConnected(ComponentName className, IBinder binder)
			{
				((ClearNotificationService.ClearBinder) binder).service.startService(new Intent(outerInstance, typeof(ClearNotificationService)));
				NotificationManager mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
				mNotificationManager.notify(ClearNotificationService.NOTIFICATION_ID, outerInstance.mNotifyBuilder.build());
			}
示例#41
0
			public override void onServiceDisconnected(ComponentName name)
			{
				Log.d(TAG, "onServiceDisconnected");
				outerInstance.mService = null;
			}