Question

I'm in the final stages of developing an app, and today my Galaxy Nexus (running 4.0.4) threw an error message when I brought back from "sleep". The phone had been sitting idle for about an hour or so.

Unfortunately, I did not write down the exact error message, but I was able to pull the following from logcat.

My app has a BroadcastReceiver that looks at phone intents, as well as service that registers a few ContentObservers. I do not receive an errors when I'm testing the app.

Can someone take a look at the below errors from logcat and help me determine if my app could have caused them?

    2012-07-15 22:36:57.213 I 8661/ActivityManager: Start proc com.google.android.apps.uploader for broadcast com.google.android.apps.uploader/.ConnectivityBroadcastReceiver: pid=13497 uid=10035 gids={3003}
    2012-07-15 22:36:57.221 I 13497/dalvikvm: Turning on JNI app bug workarounds for target SDK version 11...        
    2012-07-15 22:36:57.245 I 13497/ActivityThread: Pub com.google.android.apps.uploader: com.google.android.apps.uploader.UploadsContentProvider
    2012-07-15 22:36:57.245 I 13497/ActivityThread: Pub com.google.photos.provider.Album: com.google.android.apps.uploader.clients.picasa.AlbumProvider
    2012-07-15 22:36:57.245 D 13497/MediaUploader: UploaderApplication.onCreate
    2012-07-15 22:36:57.260 D 13497/MediaUploader: nonWifiLimit=20971520, default=20971520
    2012-07-15 22:36:57.260 I 13497/MediaUploader: No need to wake up
    2012-07-15 22:36:57.268 D 9772/PicasaSyncManager: active network: NetworkInfo: type: WIFI[], state: CONNECTED/CONNECTED, reason: (unspecified), extra: (none), roaming: false, failover: false, isAvailable: true
    2012-07-15 22:36:57.268 D 9772/PicasaSyncManager: background data: true
    2012-07-15 22:36:57.268 I 8661/ActivityManager: No longer want com.android.voicedialer (pid 9435): hidden #16
    2012-07-15 22:36:57.291 I 13103/DMApp: Constructor()
    2012-07-15 22:36:57.291 I 13103/DMApp: onCreate...... 
    2012-07-15 22:36:57.315 I 13103/SyncmlService: onBind 
    2012-07-15 22:36:57.370 I 13497/MediaUploader: No need to wake up
    2012-07-15 22:36:57.370 D 9772/PicasaSyncManager: active network: NetworkInfo: type: WIFI[], state: CONNECTED/CONNECTED, reason: (unspecified), extra: (none), roaming: false, failover: false, isAvailable: true
    2012-07-15 22:36:57.370 D 9772/PicasaSyncManager: background data: true
    2012-07-15 22:36:57.682 D 8661/ConnectivityService: handleInetConditionHoldEnd: net=1, condition=100, published condition=100
    2012-07-15 22:36:59.166 D 8861/IMSFW: ImsSMSInterface$1: EVENT_DEREGISTER_DONE_TIMEOUT occured
    2012-07-15 22:36:59.174 D 8861/IMSFW: IIL: Instantiaing IIL 
    2012-07-15 22:36:59.174 D 8861/AndroidRuntime: Shutting down VM

    2012-07-15 22:36:59.174 W 8861/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x40a4f1f8)
    2012-07-15 22:36:59.182 E 8861/AndroidRuntime: FATAL EXCEPTION: main
    android.content.ReceiverCallNotAllowedException: IntentReceiver components are not allowed to register to receive intents
    at android.app.ReceiverRestrictedContext.registerReceiver(ContextImpl.java:116)
    at android.app.ReceiverRestrictedContext.registerReceiver(ContextImpl.java:110)
    at com.sec.android.internal.ims.sms.SMS3GPP.smsrelaylayer.SmsRLInterface.<init>(SmsRLInterface.java:126)
    at com.sec.android.internal.ims.sms.SMS3GPP.smsrelaylayer.SmsRLInterface.getInstance(SmsRLInterface.java:86)
    at com.sec.android.internal.ims.sms.SMS3GPP.smsrelaylayer.RLMessageQueue.<init>(RLMessageQueue.java:65)
    at com.sec.android.internal.ims.sms.SMS3GPP.smsrelaylayer.RLMessageQueue.getInstance(RLMessageQueue.java:57)
    at com.sec.android.internal.ims.sms.SmsImsDispatcher.<init>(SmsImsDispatcher.java:77)
    at com.sec.android.internal.ims.sms.SmsImsDispatcher.getInstance(SmsImsDispatcher.java:85)
    at com.sec.android.internal.ims.sms.ImsSMSInterface.postIMSRegStatus(ImsSMSInterface.java:811)
    at com.sec.android.internal.ims.sms.ImsSMSInterface$1.handleMessage(ImsSMSInterface.java:287)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4424)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
    at dalvik.system.NativeStart.main(Native Method)

    2012-07-15 22:36:59.190 D 8861/IMSFW: IIL: Connected to '7467' socket
    2012-07-15 22:36:59.190 E 8861/IIL: Uncaught exception 
    java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
    at android.os.Handler.<init>(Handler.java:121)
    at com.sec.android.internal.ims.sms.SmsImsDispatcher.<init>(SmsImsDispatcher.java:64)
    at com.sec.android.internal.ims.sms.SmsImsDispatcher.getInstance(SmsImsDispatcher.java:85)
    at com.sec.android.ims.IIL.notifySocketConnection(IIL.java:316)
    at com.sec.android.ims.IIL.access$100(IIL.java:28)
    at com.sec.android.ims.IIL$IILReceiver.run(IIL.java:381)
    at java.lang.Thread.run(Thread.java:856)

EDIT

Here is all of my code that relates to Receivers . I never actually call registerReceiver . To verify, I ran a FileSearch in Eclipse looking for registerReceiver.

Here is my manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.myproject" android:versionCode="1" android:versionName="1.0">
    <uses-permission android:name="android.permission.READ_CONTACTS"></uses-permission>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>

    <application android:icon="@drawable/ic_icon" android:label="@string/app_name" android:theme="@android:style/Theme.Light">
        <activity android:name=".CallListActivity"
                  android:label="@string/app_name" 
                  android:theme="@android:style/Theme.Light"
                  android:configChanges="orientation"
            android:launchMode="singleTop">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>        

    <receiver android:name="MyPhoneReceiver">
        <intent-filter>
            <action android:name="android.intent.action.PHONE_STATE" />
            <action android:name="com.myproject.MY_ACTION" />
        </intent-filter>
    </receiver>
        <service android:name=".MyService" />
</manifest> 

Here is my Service:

public class MyService extends Service {

    private static MyContentObserver mContentObserver;
    private static ContactContentObserver mContactContentObserver;
    private Context mCtx;
    public int onStartCommand(Intent intent, int flags, int startId) {
        try {
            if(mContentObserver == null) {
                mContentObserver = new MyContentObserver();

                mCtx = this.getApplicationContext();
                mCtx.getContentResolver().registerContentObserver(CallLog.Calls.CONTENT_URI, true, mContentObserver);
            }

            mCtx = this.getApplicationContext();
            if(mContactContentObserver == null) {
                mContactContentObserver = new ContactContentObserver();
                this.getApplicationContext().getContentResolver().registerContentObserver(ContactsContract.Contacts.CONTENT_URI, true, mContactContentObserver);
            }
        }
        catch (Exception e) {
        }
        return START_STICKY;
    }

        public IBinder onBind(Intent intent) {
        // We don't provide binding, so return null
        return null;
    }

    public void onPause() {
    }

    public void onDestroy() {
        try {
            if(mContentObserver != null)
                this.getApplicationContext().getContentResolver().unregisterContentObserver(mContentObserver);

            if(mContactContentObserver != null)
                this.getApplicationContext().getContentResolver().unregisterContentObserver(mContactContentObserver);
            super.onDestroy();
        }
        catch (Exception e) {
        }
    }

    private class MyContentObserver extends ContentObserver {
        public MyContentObserver() {
            super(null);

        }

            @Override
        public void onChange(boolean selfChange) {
            try {

                Intent intent = new Intent();
                intent.setAction("com.myproject.MY_ACTION");
                sendBroadcast(intent);
                super.onChange(selfChange);
            }
            catch (Exception e) { 
            }
        }
    }

    private class ContactContentObserver extends ContentObserver {
        public ContactContentObserver() {
            super(null);

        }

        @Override
        public void onChange(boolean selfChange) {

            super.onChange(selfChange);

            try {

                ContactUpdateTask updateContactsTask = new ContactUpdateTask(mCtx);
                updateContactsTask.execute(null);
            }
            catch (Exception e) { 
            }

        }


        private class ContactUpdateTask extends AsyncTask<Void, Void, Void> {
            private Context mCtx;

            private ContactUpdateTask(Context _ctx) {
                mCtx = _ctx;

            }
            protected Void doInBackground(Void... arg0) {
                try {

                 // DB stuff
            }
                catch (Exception e) { 
                }
                return null;

            }

            protected void onProgressUpdate(Void... arg0) {
                switch (mType) {
                }
            }

            protected void onPostExecute(Void arg0) {
                publishProgress((Void)null);

            }
        }
    }

}

Here is my BroadcastReceiver:

public class MyPhoneReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        try {
            Bundle extras = intent.getExtras();

            if (extras != null) { // Intent == android.intent.action.PHONE_STATE            

                //DB stuff
                if (something)
                    flag = false;
                else
                    flag = true;
            }
            else if (flag){
                try {
                    // DB Stuff
                }
                catch (Exception e) {
                }

                try {
                    // DB Stuff
                }
                catch (Exception e) {
                }
                Intent startActivity = new Intent();
                startActivity.setClass(context, NewActivity.class );
                startActivity.setAction(NewActivity.class.getName());
                startActivity.setFlags(
                        Intent.FLAG_ACTIVITY_NEW_TASK |
                        Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
                context.startActivity(startActivity);

            }
        }
        catch (Exception e) {

        }

    }
}
Was it helpful?

Solution

So ... it turns out that I have been inadvertently creating debug reports by pressing Volume (both Up and Down) and Power at the same time.

I've taken to turning off Debugging mode on my device when I'm not working on my app, and the reports have stopped generating.

The error that I was most likely unrelated to my app.

Here is the link to google's page on generating debug reports: http://support.google.com/mobile/bin/request.py?&src=6279961&contact_type=android_bugreport

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top