@DSVerified
  @DSBan(DSCat.DROIDSAFE_INTERNAL)
  public static void modelService(android.app.Service service) {
    if (mApplication != null) service.setApplication(mApplication);

    service.droidsafeAttachContext(context);

    service.onCreate();
    for (IntentFilter filter : service.__ds__intentFilters) {

      Intent intent = service.__ds__registerIntentFilter(filter);

      mApplication.__ds__intentsFromFilter.add(intent);

      service.onBind(intent);
      service.onRebind(intent);
      service.onStart(intent, DSUtils.FAKE_INT);
      service.onTaskRemoved(intent);
      service.onStartCommand(intent, DSUtils.FAKE_INT, DSUtils.FAKE_INT);
      service.onUnbind(intent);
      if (service instanceof IntentService) {
        ((IntentService) service).__ds__onHandleIntent(intent);
      }
    }
    service.droidsafeOnSubServiceHook();
    service.onConfigurationChanged(new Configuration());
    service.onLowMemory();
    service.onTrimMemory(0);
    service.stopSelf(0);
    service.onDestroy();
  }
Example #2
0
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   super.onConfigurationChanged(newConfig);
 }
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   // This prevents reload after configuration changes
   super.onConfigurationChanged(newConfig);
 }
 public void onConfigurationChanged(android.content.res.Configuration newConfig) {
   if (ScriptLoader.isCalledFromJRuby()) {
     super.onConfigurationChanged(newConfig);
     return;
   }
   if (JRubyAdapter.isInitialized()) {
     if (scriptInfo.getCallbackProcs() != null
         && scriptInfo.getCallbackProcs()[CB_CONFIGURATION_CHANGED] != null) {
       super.onConfigurationChanged(newConfig);
       JRubyAdapter.runRubyMethod(
           scriptInfo.getCallbackProcs()[CB_CONFIGURATION_CHANGED], "call", newConfig);
     } else {
       String rubyClassName = scriptInfo.getRubyClassName();
       if ((Boolean)
           JRubyAdapter.runScriptlet(
               "defined?("
                   + rubyClassName
                   + ") == 'constant' && "
                   + rubyClassName
                   + ".instance_methods(false).any?{|m| m.to_sym == :on_configuration_changed}")) {
         // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
         if (JRubyAdapter.isJRubyPreOneSeven()) {
           JRubyAdapter.put("$arg_newConfig", newConfig);
           JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
           JRubyAdapter.runScriptlet("$ruby_instance.on_configuration_changed($arg_newConfig)");
         } else {
           if (JRubyAdapter.isJRubyOneSeven()) {
             JRubyAdapter.runRubyMethod(
                 scriptInfo.getRubyInstance(), "on_configuration_changed", newConfig);
           } else {
             throw new RuntimeException(
                 "Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
           }
         }
       } else {
         if ((Boolean)
             JRubyAdapter.runScriptlet(
                 "defined?("
                     + rubyClassName
                     + ") == 'constant' && "
                     + rubyClassName
                     + ".instance_methods(false).any?{|m| m.to_sym == :onConfigurationChanged}")) {
           // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
           if (JRubyAdapter.isJRubyPreOneSeven()) {
             JRubyAdapter.put("$arg_newConfig", newConfig);
             JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
             JRubyAdapter.runScriptlet("$ruby_instance.onConfigurationChanged($arg_newConfig)");
           } else {
             if (JRubyAdapter.isJRubyOneSeven()) {
               JRubyAdapter.runRubyMethod(
                   scriptInfo.getRubyInstance(), "onConfigurationChanged", newConfig);
             } else {
               throw new RuntimeException(
                   "Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
             }
           }
         } else {
           {
             super.onConfigurationChanged(newConfig);
             return;
           }
         }
       }
     }
   } else {
     Log.i(
         "Method called before JRuby runtime was initialized: RubotoService#onConfigurationChanged");
     {
       super.onConfigurationChanged(newConfig);
       return;
     }
   }
 }
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   // TODO Auto-generated method stub
   super.onConfigurationChanged(newConfig);
 }