asif786ka / dashclock

Automatically exported from code.google.com/p/dashclock
0 stars 0 forks source link

Serializable/Parcelable extras ignore in ClickIntent #718

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create basic extension
2. Create an intent for an activity with a serializable/parcelable extra
3. Publish update with this click intent

What is the expected output? What do you see instead?
The serializable/parcelable extra is not included in the activity's intent

What version of the product are you using?
com.google.android.apps.dashclock:dashclock-api:2.0.0

Which device and Android version are you experiencing this issue on?
Simulator, galaxy nexus, nexus 7

Are you using a custom launcher or ROM? If so, which one? Note that custom
launchers and ROMs are not supported.
No.

Please provide any additional information below.
I think this is caused by the fact that the intent is converted to a URI.  Can 
the documentation be updated to prevent similar frustration by other developers 
in the future?  Or better yet, is there a way to fix the issue?
Here's the line in question:
        data.put(KEY_CLICK_INTENT, (mClickIntent == null) ? null : mClickIntent.toUri(0));

Original issue reported on code.google.com by jacob.ta...@gmail.com on 29 Jan 2014 at 2:35

GoogleCodeExporter commented 8 years ago
Will look into it, thanks.

Original comment by roman.nurik on 29 Jan 2014 at 6:26

GoogleCodeExporter commented 8 years ago
To answer the question, I don't think this is fixable since parcelables aren't 
serializable and serialization of extension data is critical to how DashClock 
works. I'll update this in the docs.

Original comment by roman.nurik on 30 Jan 2014 at 9:29

GoogleCodeExporter commented 8 years ago
Would it be possible to allow serializable extras in that case?  It seems like 
it would be a common use case to pre-load data in the service, and pass it to 
an activity via intent.  Right now it seems you have to save it to external 
storage or a database.

Original comment by jacob.ta...@gmail.com on 30 Jan 2014 at 9:31

GoogleCodeExporter commented 8 years ago
Serializables carry a lot of overhead. Just look at the source for Parcel:

https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/co
re/java/android/os/Parcel.java (line 1294)

    /**
     * Write a generic serializable object in to a Parcel.  It is strongly
     * recommended that this method be avoided, since the serialization
     * overhead is extremely large, and this approach will be much slower than
     * using the other approaches to writing data in to a Parcel.
     */

Original comment by roman.nurik on 4 Feb 2014 at 5:51