title: AOSP not loading due to one line of code
body: <p>So I had created a new Service and added to AOSP. The service runs fine when being called from apps. But I want to call few methods of the service from inside the framework code (Source/frameworks/base/core/java/android/content/pm/PackageParser.java).</p>
  
  <p>Is there a special way I need to call create the instance for the service in order for it to be used inside the frameworks.</p>
  
  <pre><code> ITestService om = ITestService.Stub.asInterface(ServiceManager.getService("Test"));</code></pre>
  
  <p>The above is the way I make an instance to the service inside the PackageParser.java, (the same worked fine when I tried to access it from an app).</p>
  
  <p>The below is the snippet of errors I got from logcat:</p>
  
  <pre><code>***********************************************
  F/SystemServer(  500): BOOT FAILURE starting Input Manager Service
  F/SystemServer(  500): java.lang.RuntimeException: Unable to get provider com.android.providers.settings.SettingsProvider: java.lang.ClassNotFoundException: com.android.providers.settings.SettingsProvider
  F/SystemServer(  500):  at android.app.ActivityThread.installProvider(ActivityThread.java:4201)
  F/SystemServer(  500):  at android.app.ActivityThread.getProvider(ActivityThread.java:4010)
  F/SystemServer(  500):  at android.app.ActivityThread.acquireProvider(ActivityThread.java:4026)
  F/SystemServer(  500):  at android.app.ContextImpl$ApplicationContentResolver.acquireProvider(ContextImpl.java:1612)
  F/SystemServer(  500):  at android.content.ContentResolver.acquireProvider(ContentResolver.java:948)
  F/SystemServer(  500):  at android.provider.Settings$NameValueCache.getString(Settings.java:701)
  F/SystemServer(  500):  at android.provider.Settings$Secure.getString(Settings.java:2207)
  F/SystemServer(  500):  at com.android.server.InputMethodManagerService.buildInputMethodListLocked(InputMethodManagerService.java:1966)
  F/SystemServer(  500):  at com.android.server.InputMethodManagerService.(InputMethodManagerService.java:556)
  F/SystemServer(  500):  at com.android.server.ServerThread.run(SystemServer.java:273)
  F/SystemServer(  500): Caused by: java.lang.ClassNotFoundException: com.android.providers.settings.SettingsProvider
  F/SystemServer(  500):  at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
  F/SystemServer(  500):  at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
  F/SystemServer(  500):  at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
  F/SystemServer(  500):  at android.app.ActivityThread.installProvider(ActivityThread.java:4186)
  F/SystemServer(  500):  ... 9 more
  I/SystemServer(  500): Accessibility Manager
  W/SystemServer(  500): ***********************************************
  F/SystemServer(  500): BOOT FAILURE making display ready
  </code></pre>
  
  <p>Just before this error I was able to see the success log message saying my service has been started.</p>
  
  <p>I just commented one line which makes instance to my service in PackageParser.java, and the code seemed to work creating the system.img</p>
  
  <p>Any inputs on this problem could help me a lot.</p>
  
  <p>Thank you in advance.</p>