Commit ccf877b9 authored by John Hu's avatar John Hu
Browse files

Merge pull request #11161 from huchengtw-moz/media/Bug_891797-2

Bug 891797 - [OTA][Data Migration][MediaDB] Data of Gallery, Video, and ...r=djf
parents 3542c485 82b67c93
Loading
Loading
Loading
Loading
+10 −1
Changes for apps/gallery/js/gallery.js: 10 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -220,6 +220,11 @@ function initDB() {
    });
  }

  // show dialog in upgradestart, when it finished, it will turned to ready.
  photodb.onupgrading = function(evt) {
    showOverlay('upgrade');
  };

  // This is called when DeviceStorage becomes unavailable because the
  // sd card is removed or because it is mounted for USB mass storage
  // This may be called before onready if it is unavailable to begin with
@@ -247,7 +252,8 @@ function initDB() {

  photodb.onready = function() {
    // Hide the nocard or pluggedin overlay if it is displayed
    if (currentOverlay === 'nocard' || currentOverlay === 'pluggedin')
    if (currentOverlay === 'nocard' || currentOverlay === 'pluggedin' ||
        currentOverlay === 'upgrade')
      showOverlay(null);

    initThumbnails();
@@ -1142,6 +1148,9 @@ function showOverlay(id) {
    case 'emptygallery':
      title = navigator.mozL10n.get('emptygallery2-title');
      text = navigator.mozL10n.get('emptygallery2-text');
    case 'upgrade':
      title = navigator.mozL10n.get('upgrade-title');
      text = navigator.mozL10n.get('upgrade-text');
      break;
    default:
      console.warn('Reference to undefined overlay', currentOverlay);
+3 −0
Changes for apps/gallery/locales/gallery.en-US.properties: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -53,6 +53,9 @@ pluggedin2-text = Unplug the phone to use this app.
scanning-title = Scanning
scanning-text  = Looking for photos and videos.

upgrade-title = Database Upgrade
upgrade-text = Please wait while Gallery updates its database.

share-noprovider = Can not share this image file type.

memorycardfull = Can not edit photos: Memory card is full.
+7 −1
Changes for apps/music/js/music.js: 7 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -130,6 +130,11 @@ function init() {
    });
  }

  // show dialog in upgradestart, when it finished, it will turned to ready.
  musicdb.onupgrading = function() {
    showOverlay('upgrade');
  };

  // This is called when DeviceStorage becomes unavailable because the
  // sd card is removed or because it is mounted for USB mass storage
  // This may be called before onready if it is unavailable to begin with
@@ -173,7 +178,8 @@ function init() {

  musicdb.onready = function() {
    // Hide the nocard or pluggedin overlay if it is displayed
    if (currentOverlay === 'nocard' || currentOverlay === 'pluggedin')
    if (currentOverlay === 'nocard' || currentOverlay === 'pluggedin' ||
        currentOverlay === 'upgrade')
      showOverlay(null);

    // Display music that we already know about
+3 −0
Changes for apps/music/locales/music.en-US.properties: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -23,6 +23,9 @@ nocard-text = Insert a memory card to listen to songs.
pluggedin-title = Music can not be used while phone is plugged in
pluggedin-text  = Unplug the phone to play music.

upgrade-title = Database Upgrade
upgrade-text = Please wait while Music updates its database.

search-music.placeholder = Search Music
search-cancel = Cancel
search-artists = Artists
+6 −0
Changes for apps/video/js/db.js: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -5,6 +5,12 @@
function initDB() {
  videodb = new MediaDB('videos');

  videodb.onupgrading = function(evt) {
    // show dialog in upgradestart, when it finished, it will turned to ready.
    storageState = MediaDB.UPGRADING;
    updateDialog();
  };

  videodb.onunavailable = function(event) {
    storageState = event.detail;
    // If player is playing, we need to hide the player which pauses the player
Loading