[Android Apps and Games] romracer:
My phone is a Galaxy S2 Skyrocket (SGH-I727) running my Alien ROM from here which is GB 2.3.6. I tried to patch PDroid in using the auto-patcher and had no errors in doing so.

My phone boots, but it constantly FCs on the Touchwiz Launcher. I can't really test anything past that, because I can't get anywhere. I'm 99.9% sure the patches applied properly, but it seems the code is not fully 2.3.6+ compliant or something.

The error from logcat is "java.lang.IllegalStateException: System services not available to Activities before onCreate()".

The full stack trace is:

E/AndroidRuntime( 356): FATAL EXCEPTION: main
E/AndroidRuntime( 356): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sec.android.app.twlauncher/com.sec.android.app.twlauncher.Launcher}: java.lang.IllegalStateException: System services not available to Activities before onCreate()
E/AndroidRuntime( 356): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
E/AndroidRuntime( 356): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
E/AndroidRuntime( 356): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
E/AndroidRuntime( 356): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
E/AndroidRuntime( 356): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 356): at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime( 356): at android.app.ActivityThread.main(ActivityThread.java:3691)
E/AndroidRuntime( 356): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 356): at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime( 356): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
E/AndroidRuntime( 356): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
E/AndroidRuntime( 356): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 356): Caused by: java.lang.IllegalStateException: System services not available to Activities before onCreate()
E/AndroidRuntime( 356): at android.app.Activity.getSystemService(Activity.java:3578)
E/AndroidRuntime( 356): at android.privacy.surrogate.PrivacyTelephonyManager.<init>(PrivacyTelephonyManager.java:33)
E/AndroidRuntime( 356): at android.app.ContextImpl.getTelephonyManager(ContextImpl.java)
E/AndroidRuntime( 356): at android.app.ContextImpl.getSystemService(ContextImpl.java)
E/AndroidRuntime( 356): at android.app.ContextImpl$ApplicationPackageManager.getText(ContextImpl.java:2619)
E/AndroidRuntime( 356): at android.content.pm.ComponentInfo.loadLabel(ComponentInfo.java:94)
E/AndroidRuntime( 356): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1594)
E/AndroidRuntime( 356): ... 11 more

The code its *****ing about in particular is:

.line 33
const-string v0, "privacy"

invoke-virtual {p1, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

from the constructor in android/privacy/surrogate/PrivacyTelephonyManager.smali in framework.jar. Or in Java:

public PrivacyTelephonyManager(Context context) {
super(context);
this.context = context;
pSetMan = (PrivacySettingsManager) context.getSystemService("privacy");
}

from PrivacyTelephonyManager.java. Any idea how to fix this or if something else might be wrong?

EDIT: Maybe the private member "context" of PrivacyTelephonyManager can't be private and should be public instead? So getSystemService can read it? I don't know and I sure don't know how that would look in smali. But if so, the same problem would exist for PrivacyLocationManager and PrivacyAccountManager.