Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #10919 from comoyo/hidden_apps
Browse files Browse the repository at this point in the history
Bug 892397 - Specify hidden apps in their respective manifests. r=fabrice
  • Loading branch information
janjongboom committed Jul 16, 2013
2 parents f2e2403 + 22b14e9 commit 92d85bf
Show file tree
Hide file tree
Showing 13 changed files with 11 additions and 39 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Expand Up @@ -9,8 +9,6 @@ manifest.appcache
/apps/calendar/js/presets.js
/apps/email/built/
/apps/homescreen/js/init.json
/apps/homescreen/js/hiddenapps.js
/apps/settings/js/hiddenapps.js
/apps/costcontrol/js/config.json
/apps/sms/js/blacklist.json
/test_apps/test-agent/test/config.json
Expand Down
3 changes: 2 additions & 1 deletion apps/bluetooth/manifest.webapp
@@ -1,6 +1,7 @@
{
"name": "Send To Bluetooth Device",
"type": "certified",
"role": "system",
"description": "Gaia Bluetooth Transfer",
"launch_path": "/transfer.html",
"developer": {
Expand All @@ -23,7 +24,7 @@
"disposition": "inline",
"returnValue": true,
"href": "/transfer.html"
}
}
},
"permissions": {
"bluetooth":{},
Expand Down
1 change: 0 additions & 1 deletion apps/homescreen/index.html
Expand Up @@ -41,7 +41,6 @@
<script type="text/javascript" defer src="js/homescreen.js"></script>
<script type="text/javascript" defer src="js/configurator.js"></script>
<script type="text/javascript" defer src="js/wallpaper.js"></script>
<script type="text/javascript" defer src="js/hiddenapps.js"></script>

<link rel="resource" type="application/l10n" href="locales/locales.ini">
<link rel="resource" type="application/l10n" href="shared/locales/date.ini">
Expand Down
9 changes: 3 additions & 6 deletions apps/homescreen/js/grid.js
Expand Up @@ -8,6 +8,7 @@ var GridManager = (function() {
var BASE_HEIGHT = 460; // 480 - 20 (status bar height)
var DEVICE_HEIGHT = window.innerHeight;
var OPACITY_STEPS = 40; // opacity steps between [0,1]
var HIDDEN_ROLES = ['system', 'keyboard', 'homescreen'];

var container;

Expand Down Expand Up @@ -960,18 +961,14 @@ var GridManager = (function() {
* points, each one is represented as an icon.)
*/
function processApp(app, callback) {
// Ignore system apps.
if (HIDDEN_APPS.indexOf(app.manifestURL) != -1)
return;

appsByOrigin[app.origin] = app;

var manifest = app.manifest ? app.manifest : app.updateManifest;
if (!manifest)
if (!manifest || HIDDEN_ROLES.indexOf(manifest.role) !== -1)
return;

var entryPoints = manifest.entry_points;
if (!entryPoints || manifest.type != 'certified') {
if (!entryPoints || manifest.type !== 'certified') {
createOrUpdateIconForApp(app);
return;
}
Expand Down
1 change: 1 addition & 0 deletions apps/homescreen/manifest.webapp
Expand Up @@ -3,6 +3,7 @@
"description": "Gaia Homescreen",
"launch_path": "/index.html#root",
"type": "certified",
"role": "homescreen",
"developer": {
"name": "The Gaia Team",
"url": "https://github.com/andreasgal/gaia"
Expand Down
1 change: 1 addition & 0 deletions apps/keyboard/manifest.webapp
Expand Up @@ -2,6 +2,7 @@
"name": "Keyboard",
"description": "Gaia Keyboard",
"type": "certified",
"role": "keyboard",
"developer": {
"name": "The Gaia Team",
"url": "https://github.com/mozilla-b2g/gaia"
Expand Down
1 change: 1 addition & 0 deletions apps/pdfjs/manifest.webapp
Expand Up @@ -2,6 +2,7 @@
"name": "PDF Viewer",
"description": "Portable Document Format(PDF) Viewer",
"type": "certified",
"role": "system",
"developer": {
"name": "The pdf.js Team",
"url": "https://github.com/mozilla/pdf.js"
Expand Down
1 change: 0 additions & 1 deletion apps/settings/index.html
Expand Up @@ -1974,7 +1974,6 @@ <h1 data-l10n-id="confirmClearBookmarkAppsDataTitle">Clear private data from boo
</form>
<script type="application/javascript" src="shared/js/manifest_helper.js"></script>
<script src="js/hiddenapps.js"></script>
<script src="js/apps.js"></script>
-->
</section>
Expand Down
3 changes: 0 additions & 3 deletions apps/settings/js/apps.js
Expand Up @@ -120,9 +120,6 @@ var ApplicationsList = {
var apps = evt.target.result;

apps.forEach(function(app) {
if (HIDDEN_APPS.indexOf(app.manifestURL) != -1)
return;

var manifest = app.manifest ? app.manifest : app.updateManifest;
if (manifest.type != 'certified') {
self._apps.push(app);
Expand Down
1 change: 1 addition & 0 deletions apps/system/manifest.webapp
@@ -1,6 +1,7 @@
{
"name": "System",
"type": "certified",
"role": "system",
"description": "Main System",
"launch_path": "/index.html",
"developer": {
Expand Down
1 change: 1 addition & 0 deletions apps/wallpaper/manifest.webapp
Expand Up @@ -2,6 +2,7 @@
"name": "Wallpaper",
"description": "Gaia Wallpaper Picker",
"type": "certified",
"role": "system",
"orientation": "portrait-primary",
"developer": {
"name": "The Gaia Team",
Expand Down
24 changes: 0 additions & 24 deletions build/applications-data.js
Expand Up @@ -198,30 +198,6 @@ let init = getFile(GAIA_DIR, GAIA_CORE_APP_SRCDIR,
'homescreen', 'js', 'init.json');
writeContent(init, JSON.stringify(content));

// Apps that should never appear in settings > app permissions
// bug 830659: We want homescreen to appear in order to remove e.me geolocation
// permission
let hidden_apps = [
gaiaManifestURL('keyboard'),
gaiaManifestURL('wallpaper'),
gaiaManifestURL('bluetooth'),
gaiaManifestURL('pdfjs')
];

init = getFile(GAIA_DIR, GAIA_CORE_APP_SRCDIR, 'settings', 'js',
'hiddenapps.js');
writeContent(init, 'var HIDDEN_APPS = ' + JSON.stringify(hidden_apps));

// Apps that should never appear as icons in the homescreen grid or dock
hidden_apps = hidden_apps.concat([
gaiaManifestURL('homescreen'),
gaiaManifestURL('system')
]);

init = getFile(GAIA_DIR, GAIA_CORE_APP_SRCDIR, 'homescreen', 'js',
'hiddenapps.js');
writeContent(init, 'var HIDDEN_APPS = ' + JSON.stringify(hidden_apps));

// SMS
init = getFile(GAIA_DIR, 'apps', 'sms', 'js', 'blacklist.json');
content = ['4850', '7000'];
Expand Down
2 changes: 1 addition & 1 deletion build/lint-excluded-files.list
@@ -1 +1 @@
build/r.js,apps/communications/contacts/oauth2/js/parameters.js,apps/calendar/js/presets.js,apps/email/js/alameda.js,apps/email/js/text_builder.js,apps/homescreen/js/hiddenapps.js,apps/settings/js/hiddenapps.js
build/r.js,apps/communications/contacts/oauth2/js/parameters.js,apps/calendar/js/presets.js,apps/email/js/alameda.js,apps/email/js/text_builder.js

0 comments on commit 92d85bf

Please sign in to comment.