Closed Bug 965033 Opened 6 years ago Closed 6 years ago

Hook up DynamicPanel to HomeProvider

Categories

(Firefox for Android :: Data Providers, defect)

ARM
Android
defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 29

People

(Reporter: Margaret, Assigned: Margaret)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached patch patchSplinter Review
With some minor HomeProvider tweaks... it works! \o/

We should file a bug to do proper schema migration somewhere, but for now, I just set the schema version where we create the table.

To test, I used this panel hack: https://www.dropbox.com/s/a9ku3y14btrhul3/panel-hack.patch

And then used this JS snippet to store the data:

  Task.spawn(function() {
    let storage = HomeProvider.getStorage("mydatasetid");
    yield storage.save([{
      "url": "http://mozilla.org",
      "title": "Mozilla",
      "description": "This is an example"
    }, {
      "url": "http://margaretleibovic.com",
      "title": "Margaret Leibovic",
      "description": "This is a second example"
    }, {
      "url": "http://nytimes.com",
      "title": "New York Times",
      "description": "Yet another example"
    }]);
  }).then(function(result) {
    dump("*** result - " + JSON.stringify(result));
  }, function(error) {
    dump("*** error - " + JSON.stringify(error));    
  });
Attachment #8366973 - Flags: review?(lucasr.at.mozilla)
Assignee: nobody → margaret.leibovic
Blocks: lists
Comment on attachment 8366973 [details] [diff] [review]
patch

Review of attachment 8366973 [details] [diff] [review]:
-----------------------------------------------------------------

::: mobile/android/base/home/DynamicPanel.java
@@ -220,5 @@
>              final ContentResolver cr = getContext().getContentResolver();
>  
> -            // XXX: Use the test URI for static fake data
> -            final Uri fakeItemsUri = HomeItems.CONTENT_FAKE_URI.buildUpon().
> -                appendQueryParameter(BrowserContract.PARAM_PROFILE, "default").build();

Note: SQLiteBridgeContentProvider gets the correct profile for us if it's not specified, so we don't need to add this param.
Attachment #8366973 - Flags: review?(lucasr.at.mozilla) → review+
https://hg.mozilla.org/mozilla-central/rev/fa98b6aefa34
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 29
You need to log in before you can comment on or make changes to this bug.