Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Replaced Soup branding with Apps-from-Mozilla-Labs (icons and text).

Removed Dashboard from application list.
  • Loading branch information...
commit b9a83c813c79c7173986052599b3eba6fd4b6c5c 1 parent 7743233
Harald Kirschner digitarald authored
12 AndroidManifest.xml
@@ -31,7 +31,7 @@
31 31 <uses-sdk android:minSdkVersion="8" />
32 32
33 33 <application
34   - android:icon="@drawable/soup"
  34 + android:icon="@drawable/ic_launcher_rt"
35 35 android:label="@string/app_name"
36 36 android:name=".app.SoupApplication" >
37 37 <activity
@@ -47,7 +47,8 @@
47 47
48 48 <category android:name="android.intent.category.LAUNCHER" />
49 49 </intent-filter>
50   - <!-- Planned, to be verified
  50 + <!--
  51 + Planned, to be verified
51 52 <intent-filter >
52 53 <action android:name="android.intent.action.VIEW" />
53 54
@@ -72,11 +73,6 @@
72 73 android:name=".app.LauncherActivity"
73 74 android:taskAffinity=".app.LauncherActivity"
74 75 android:theme="@android:style/Theme.NoTitleBar" >
75   - <intent-filter >
76   - <action android:name="android.intent.action.MAIN" />
77   -
78   - <category android:name="android.intent.category.LAUNCHER" />
79   - </intent-filter>
80 76 </activity>
81 77 <activity
82 78 android:alwaysRetainTaskState="true"
@@ -119,7 +115,7 @@
119 115 <!-- Shortcuts -->
120 116
121 117 <activity
122   - android:icon="@drawable/soup"
  118 + android:icon="@drawable/ic_launcher_rt"
123 119 android:label="@string/app_name_live"
124 120 android:name=".app.LiveFolderActivity" >
125 121 <intent-filter >
BIN  res/drawable-hdpi/ic_launcher_rt.png
BIN  res/drawable-hdpi/icon.png
BIN  res/drawable-ldpi/ic_launcher_rt.png
BIN  res/drawable-ldpi/icon.png
BIN  res/drawable-mdpi/ic_launcher_rt.png
BIN  res/drawable-mdpi/icon.png
BIN  res/drawable/ic_launcher_rt.png
BIN  res/drawable/soup.png
12 res/values/strings.xml
... ... @@ -1,11 +1,11 @@
1 1 <?xml version="1.0" encoding="utf-8"?>
2 2 <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
3 3
4   - <string name="app_name">Soup</string>
5   - <string name="app_create_shortcut">Soup App</string>
6   - <string name="app_name_launcher">Soup Dashboard</string>
7   - <string name="app_name_store">Soup Market</string>
8   - <string name="app_name_live">Soup Apps</string>
  4 + <string name="app_name">App Marketplace from Mozilla Labs</string>
  5 + <string name="app_create_shortcut">App from Mozilla Labs</string>
  6 + <string name="app_name_launcher">App from Mozilla Labs</string>
  7 + <string name="app_name_store">App Marketplace from Mozilla Labs</string>
  8 + <string name="app_name_live">App Dashboard from Mozilla Labs</string>
9 9
10 10 <!-- Preferences -->
11 11
@@ -24,7 +24,7 @@
24 24 <item>https://apps.mozillalabs.com/appdir/</item>
25 25 </string-array>
26 26
27   - <string name="store_default">https://apps-preview-dev.allizom.org</string>
  27 + <string name="store_default">https://apps-preview.mozilla.org</string>
28 28
29 29 <string-array name="identity_array">
30 30 <item>dev.diresworb.org</item>
4 res/xml/authenticator.xml
... ... @@ -1,6 +1,6 @@
1 1 <?xml version="1.0" encoding="utf-8"?>
2 2 <account-authenticator xmlns:android="http://schemas.android.com/apk/res/android"
3 3 android:accountType="org.mozilla.labs.Soup"
4   - android:icon="@drawable/soup"
  4 + android:icon="@drawable/ic_launcher_rt"
5 5 android:label="@string/app_name"
6   - android:smallIcon="@drawable/soup" />
  6 + android:smallIcon="@drawable/ic_launcher_rt" />
2  src/org/mozilla/labs/Soup/app/LiveFolderActivity.java
@@ -38,7 +38,7 @@ protected void onCreate(Bundle savedInstanceState) {
38 38 liveFolderIntent.setData(CONTENT_URI);
39 39 liveFolderIntent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_NAME, getString(R.string.app_name_live));
40 40 liveFolderIntent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_ICON,
41   - Intent.ShortcutIconResource.fromContext(this, R.drawable.soup));
  41 + Intent.ShortcutIconResource.fromContext(this, R.drawable.ic_launcher_rt));
42 42 liveFolderIntent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_DISPLAY_MODE, LiveFolders.DISPLAY_MODE_LIST);
43 43 liveFolderIntent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_BASE_INTENT, new Intent(Intent.ACTION_EDIT,
44 44 APPS_URI));
554 src/org/mozilla/labs/Soup/service/SyncService.java
... ... @@ -1,3 +1,4 @@
  1 +
1 2 package org.mozilla.labs.Soup.service;
2 3
3 4 import java.util.HashMap;
@@ -27,284 +28,293 @@
27 28
28 29 public class SyncService extends IntentService {
29 30
30   - private static final String TAG = "SyncService";
  31 + private static final String TAG = "SyncService";
  32 +
  33 + public static final String EXTRA_STATUS_RECEIVER = "org.mozilla.labs.soup.extra.STATUS_RECEIVER";
  34 +
  35 + public static final int STATUS_RUNNING = 0x1;
  36 +
  37 + public static final int STATUS_ERROR = 0x2;
  38 +
  39 + public static final int STATUS_FINISHED = 0x3;
  40 +
  41 + public static final String EXTRA_STATUS_INSTALLED = "org.mozilla.labs.soup.extra.STATUS_INSTALLED";
  42 +
  43 + public static final String EXTRA_STATUS_UPDATED = "org.mozilla.labs.soup.extra.STATUS_UPDATED";
  44 +
  45 + public static final String EXTRA_STATUS_UPLOADED = "org.mozilla.labs.soup.extra.STATUS_UPLOADED";
  46 +
  47 + private ContentResolver resolver;
  48 +
  49 + private NotificationManager mNM;
  50 +
  51 + private int NOTIFY_ID = 1001;
  52 +
  53 + public SyncService() {
  54 + super(TAG);
  55 + }
  56 +
  57 + @Override
  58 + public void onCreate() {
  59 + super.onCreate();
  60 +
  61 + resolver = getContentResolver();
  62 + mNM = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
  63 + }
  64 +
  65 + @Override
  66 + protected void onHandleIntent(Intent intent) {
  67 + Log.d(TAG, "onHandleIntent " + intent);
  68 +
  69 + showNotification();
  70 +
  71 + final ResultReceiver receiver = intent.getParcelableExtra(EXTRA_STATUS_RECEIVER);
  72 + if (receiver != null)
  73 + receiver.send(STATUS_RUNNING, Bundle.EMPTY);
  74 +
  75 + final Context ctx = this;
  76 + final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ctx);
  77 + final long localSince = prefs.getLong("sync_since", 0);
  78 +
  79 + Log.d(TAG, "Sync since " + localSince);
  80 +
  81 + int uploaded = 0;
  82 + int updated = 0;
  83 + int installed = 0;
  84 +
  85 + try {
  86 +
  87 + if (!HttpFactory.authorize(this)) {
  88 + throw new Exception("Current user is not authorized.");
  89 + }
  90 +
  91 + /**
  92 + * Local list
  93 + */
  94 +
  95 + Cursor cur = resolver.query(Apps.CONTENT_URI, Apps.APP_PROJECTION, null, null,
  96 + Apps.DEFAULT_SORT_ORDER);
  97 +
  98 + cur.moveToFirst();
  99 +
  100 + HashMap<String, JSONObject> localList = new HashMap<String, JSONObject>();
  101 +
  102 + while (cur.isAfterLast() == false) {
  103 + JSONObject app = Apps.toJSONObject(cur, true);
  104 +
  105 + if (app != null) {
  106 + localList.put(app.optString("origin"), app);
  107 + }
  108 +
  109 + cur.moveToNext();
  110 + }
  111 +
  112 + cur.close();
  113 +
  114 + /**
  115 + * Server list
  116 + */
  117 +
  118 + JSONObject response = HttpFactory.getAllApps(this, localSince);
  119 +
  120 + Log.d(TAG, "List: " + response);
  121 +
  122 + if (response == null) {
  123 + throw new Exception("Empty server response");
  124 + }
  125 +
  126 + JSONArray responseList = response.optJSONArray("applications");
  127 + if (responseList == null) {
  128 + responseList = new JSONArray();
  129 + }
  130 +
  131 + // TODO: Handle incomplete
  132 +
  133 + long until = response.optLong("until");
  134 +
  135 + HashMap<String, JSONObject> serverList = new HashMap<String, JSONObject>();
  136 +
  137 + for (int i = 0, l = responseList.length(); i < l; i++) {
  138 + JSONObject app = responseList.getJSONObject(i);
  139 +
  140 + serverList.put(app.optString("origin"), app);
  141 + }
  142 +
  143 + /**
  144 + * Sync the 2 lists
  145 + */
  146 +
  147 + HashMap<String, JSONObject> toServerList = new HashMap<String, JSONObject>();
  148 + HashMap<String, JSONObject> toLocalList = new HashMap<String, JSONObject>();
  149 +
  150 + for (HashMap.Entry<String, JSONObject> entry : serverList.entrySet()) {
  151 + String origin = entry.getKey();
  152 + JSONObject serverValue = entry.getValue();
  153 +
  154 + if (localList.containsKey(origin)) {
  155 + JSONObject localValue = localList.get(origin);
  156 +
  157 + long localDate = localValue.optLong("last_modified");
  158 + long serverDate = serverValue.optLong("last_modified");
  159 +
  160 + if (localDate > serverDate) {
  161 + Log.d(TAG, "to server: " + origin + ", " + localDate + " > " + serverDate);
  162 + toServerList.put(origin, localValue);
  163 + } else if (localDate < serverDate) {
  164 + Log.d(TAG, "to local: " + origin + ", " + localDate + " < " + serverDate);
  165 + toLocalList.put(origin, serverValue);
  166 + }
  167 + } else {
  168 + Log.d(TAG, "to local: " + origin);
  169 + toLocalList.put(origin, serverValue);
  170 + }
  171 + }
  172 +
  173 + for (HashMap.Entry<String, JSONObject> entry : localList.entrySet()) {
  174 + String origin = entry.getKey();
  175 + JSONObject localValue = entry.getValue();
  176 +
  177 + long localDate = localValue.optLong("last_modified");
  178 +
  179 + if (!serverList.containsKey(origin) && localDate > localSince) {
  180 + Log.d(TAG, "to server: " + origin + ", " + localDate + " > " + localSince);
  181 + toServerList.put(origin, localValue);
  182 + }
  183 + }
  184 +
  185 + /**
  186 + * Iterate sync result
  187 + */
  188 +
  189 + // Update server values
  190 +
  191 + JSONArray serverUpdates = new JSONArray();
  192 +
  193 + for (HashMap.Entry<String, JSONObject> entry : toServerList.entrySet()) {
  194 + JSONObject localValue = entry.getValue();
  195 +
  196 + serverUpdates.put(localValue);
  197 + uploaded++;
  198 + }
  199 +
  200 + long updatedUntil = until;
  201 +
  202 + if (serverUpdates.length() > 0) {
  203 + updatedUntil = HttpFactory.updateApps(ctx, serverUpdates, until);
  204 +
  205 + if (updatedUntil < 1) {
  206 + throw new Exception("Update failed for " + serverUpdates);
  207 + }
  208 + }
  209 +
  210 + for (HashMap.Entry<String, JSONObject> entry : toServerList.entrySet()) {
  211 + String origin = entry.getKey();
  212 +
  213 + Cursor existing = Apps.findAppByOrigin(this, origin);
  214 +
  215 + ContentValues values = new ContentValues();
  216 + values.put(Apps.MODIFIED_DATE, updatedUntil);
  217 +
  218 + Uri appUri = Uri.withAppendedPath(Apps.CONTENT_URI,
  219 + existing.getString(existing.getColumnIndex(Apps._ID)));
  220 + getContentResolver().update(appUri, values, null, null);
  221 + }
  222 +
  223 + // Update local values
  224 +
  225 + for (HashMap.Entry<String, JSONObject> entry : toLocalList.entrySet()) {
  226 + String origin = entry.getKey();
  227 + JSONObject serverValue = entry.getValue();
  228 +
  229 + Cursor existing = Apps.findAppByOrigin(this, origin);
  230 +
  231 + ContentValues values = Apps.toContentValues(serverValue);
  232 +
  233 + // TODO: Set better updatedUntil (get latest date from sync
  234 + // server)
  235 + values.put(Apps.MODIFIED_DATE, updatedUntil);
  236 +
  237 + if (existing == null) {
  238 + installed++;
  239 + getContentResolver().insert(Apps.CONTENT_URI, values);
  240 + } else {
  241 + updated++;
  242 + Uri appUri = Uri.withAppendedPath(Apps.CONTENT_URI,
  243 + existing.getString(existing.getColumnIndex(Apps._ID)));
  244 +
  245 + getContentResolver().update(appUri, values, null, null);
  246 + }
  247 +
  248 + }
  249 +
  250 + prefs.edit().putLong("sync_since", updatedUntil).commit();
  251 +
  252 + Log.d(TAG, "Sync until " + updatedUntil);
  253 +
  254 + /**
  255 + * Visual feedback
  256 + */
  257 +
  258 + hideNotification();
  259 +
  260 + } catch (Exception e) {
  261 + Log.w(TAG, "Sync did not happen", e);
  262 +
  263 + hideNotification();
  264 +
  265 + if (receiver != null) {
  266 + // Pass back error to surface listener
  267 + final Bundle bundle = new Bundle();
  268 + bundle.putString(Intent.EXTRA_TEXT, e.toString());
  269 + receiver.send(STATUS_ERROR, bundle);
  270 + }
  271 + }
  272 +
  273 + // Announce success to any surface listener
  274 + if (receiver != null) {
  275 + final Bundle bundle = new Bundle();
  276 + bundle.putInt(EXTRA_STATUS_UPLOADED, uploaded);
  277 + bundle.putInt(EXTRA_STATUS_INSTALLED, installed);
  278 + bundle.putInt(EXTRA_STATUS_UPDATED, updated);
  279 +
  280 + receiver.send(STATUS_FINISHED, bundle);
  281 + }
  282 + }
31 283
32   - public static final String EXTRA_STATUS_RECEIVER = "org.mozilla.labs.soup.extra.STATUS_RECEIVER";
  284 + /**
  285 + * Show a notification while this service is running.
  286 + */
  287 + private void showNotification() {
  288 + if (mNM == null) {
  289 + return;
  290 + }
33 291
34   - public static final int STATUS_RUNNING = 0x1;
35   - public static final int STATUS_ERROR = 0x2;
36   - public static final int STATUS_FINISHED = 0x3;
37   -
38   - public static final String EXTRA_STATUS_INSTALLED = "org.mozilla.labs.soup.extra.STATUS_INSTALLED";
39   - public static final String EXTRA_STATUS_UPDATED = "org.mozilla.labs.soup.extra.STATUS_UPDATED";
40   - public static final String EXTRA_STATUS_UPLOADED = "org.mozilla.labs.soup.extra.STATUS_UPLOADED";
  292 + // Set the icon, scrolling text and timestamp
  293 + Notification notification = new Notification(R.drawable.stat_notify_sync, "Syncing Apps",
  294 + System.currentTimeMillis());
41 295
42   - private ContentResolver resolver;
  296 + // The PendingIntent to launch our activity if the user selects this
  297 + // notification
  298 + PendingIntent contentIntent = PendingIntent.getActivity(this, 0, new Intent(this,
  299 + LauncherActivity.class), 0);
43 300
44   - private NotificationManager mNM;
45   - private int NOTIFY_ID = 1001;
  301 + // Set the info for the views that show in the notification panel.
  302 + notification.setLatestEventInfo(this,
  303 + getText(org.mozilla.labs.Soup.R.string.app_name_launcher), "Synchronizing apps",
  304 + contentIntent);
46 305
47   - public SyncService() {
48   - super(TAG);
49   - }
  306 + // Send the notification.
  307 + // We use a string id because it is a unique number. We use it later to
  308 + // cancel.
  309 + mNM.notify(TAG, NOTIFY_ID, notification);
  310 + }
50 311
51   - @Override
52   - public void onCreate() {
53   - super.onCreate();
  312 + private void hideNotification() {
  313 + if (mNM == null) {
  314 + return;
  315 + }
54 316
55   - resolver = getContentResolver();
56   - mNM = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
57   - }
58   -
59   - @Override
60   - protected void onHandleIntent(Intent intent) {
61   - Log.d(TAG, "onHandleIntent " + intent);
62   -
63   - showNotification();
64   -
65   - final ResultReceiver receiver = intent
66   - .getParcelableExtra(EXTRA_STATUS_RECEIVER);
67   - if (receiver != null)
68   - receiver.send(STATUS_RUNNING, Bundle.EMPTY);
69   -
70   - final Context ctx = this;
71   - final SharedPreferences prefs = PreferenceManager
72   - .getDefaultSharedPreferences(ctx);
73   - final long localSince = prefs.getLong("sync_since", 0);
74   -
75   - Log.d(TAG, "Sync since " + localSince);
76   -
77   - int uploaded = 0;
78   - int updated = 0;
79   - int installed = 0;
80   -
81   - try {
82   -
83   - if (!HttpFactory.authorize(this)) {
84   - throw new Exception("Current user is not authorized.");
85   - }
86   -
87   - /**
88   - * Local list
89   - */
90   -
91   - Cursor cur = resolver.query(Apps.CONTENT_URI, Apps.APP_PROJECTION, null,
92   - null, Apps.DEFAULT_SORT_ORDER);
93   -
94   - cur.moveToFirst();
95   -
96   - HashMap<String, JSONObject> localList = new HashMap<String, JSONObject>();
97   -
98   - while (cur.isAfterLast() == false) {
99   - JSONObject app = Apps.toJSONObject(cur, true);
100   -
101   - if (app != null) {
102   - localList.put(app.optString("origin"), app);
103   - }
104   -
105   - cur.moveToNext();
106   - }
107   -
108   - cur.close();
109   -
110   - /**
111   - * Server list
112   - */
113   -
114   - JSONObject response = HttpFactory.getAllApps(this, localSince);
115   -
116   - Log.d(TAG, "List: " + response);
117   -
118   - if (response == null) {
119   - throw new Exception("Empty server response");
120   - }
121   -
122   - JSONArray responseList = response.optJSONArray("applications");
123   - if (responseList == null) {
124   - responseList = new JSONArray();
125   - }
126   -
127   - // TODO: Handle incomplete
128   -
129   - long until = response.optLong("until");
130   -
131   - HashMap<String, JSONObject> serverList = new HashMap<String, JSONObject>();
132   -
133   - for (int i = 0, l = responseList.length(); i < l; i++) {
134   - JSONObject app = responseList.getJSONObject(i);
135   -
136   - serverList.put(app.optString("origin"), app);
137   - }
138   -
139   - /**
140   - * Sync the 2 lists
141   - */
142   -
143   - HashMap<String, JSONObject> toServerList = new HashMap<String, JSONObject>();
144   - HashMap<String, JSONObject> toLocalList = new HashMap<String, JSONObject>();
145   -
146   - for (HashMap.Entry<String, JSONObject> entry : serverList.entrySet()) {
147   - String origin = entry.getKey();
148   - JSONObject serverValue = entry.getValue();
149   -
150   - if (localList.containsKey(origin)) {
151   - JSONObject localValue = localList.get(origin);
152   -
153   - long localDate = localValue.optLong("last_modified");
154   - long serverDate = serverValue.optLong("last_modified");
155   -
156   - if (localDate > serverDate) {
157   - Log.d(TAG, "to server: " + origin + ", " + localDate + " > " + serverDate);
158   - toServerList.put(origin, localValue);
159   - } else if (localDate < serverDate) {
160   - Log.d(TAG, "to local: " + origin + ", " + localDate + " < " + serverDate);
161   - toLocalList.put(origin, serverValue);
162   - }
163   - } else {
164   - Log.d(TAG, "to local: " + origin);
165   - toLocalList.put(origin, serverValue);
166   - }
167   - }
168   -
169   - for (HashMap.Entry<String, JSONObject> entry : localList.entrySet()) {
170   - String origin = entry.getKey();
171   - JSONObject localValue = entry.getValue();
172   -
173   - long localDate = localValue.optLong("last_modified");
174   -
175   - if (!serverList.containsKey(origin) && localDate > localSince) {
176   - Log.d(TAG, "to server: " + origin + ", " + localDate + " > " + localSince);
177   - toServerList.put(origin, localValue);
178   - }
179   - }
180   -
181   - /**
182   - * Iterate sync result
183   - */
184   -
185   - // Update server values
186   -
187   - JSONArray serverUpdates = new JSONArray();
188   -
189   - for (HashMap.Entry<String, JSONObject> entry : toServerList.entrySet()) {
190   - JSONObject localValue = entry.getValue();
191   -
192   - serverUpdates.put(localValue);
193   - uploaded++;
194   - }
195   -
196   - long updatedUntil = until;
197   -
198   - if (serverUpdates.length() > 0) {
199   - updatedUntil = HttpFactory.updateApps(ctx, serverUpdates, until);
200   -
201   - if (updatedUntil < 1) {
202   - throw new Exception("Update failed for " + serverUpdates);
203   - }
204   - }
205   -
206   - for (HashMap.Entry<String, JSONObject> entry : toServerList.entrySet()) {
207   - String origin = entry.getKey();
208   -
209   - Cursor existing = Apps.findAppByOrigin(this, origin);
210   -
211   - ContentValues values = new ContentValues();
212   - values.put(Apps.MODIFIED_DATE, updatedUntil);
213   -
214   - Uri appUri = Uri.withAppendedPath(Apps.CONTENT_URI, existing.getString(existing.getColumnIndex(Apps._ID)));
215   - getContentResolver().update(appUri, values, null, null);
216   - }
217   -
218   - // Update local values
219   -
220   - for (HashMap.Entry<String, JSONObject> entry : toLocalList.entrySet()) {
221   - String origin = entry.getKey();
222   - JSONObject serverValue = entry.getValue();
223   -
224   - Cursor existing = Apps.findAppByOrigin(this, origin);
225   -
226   - ContentValues values = Apps.toContentValues(serverValue);
227   -
228   - // TODO: Set better updatedUntil (get latest date from sync server)
229   - values.put(Apps.MODIFIED_DATE, updatedUntil);
230   -
231   - if (existing == null) {
232   - installed++;
233   - getContentResolver().insert(Apps.CONTENT_URI, values);
234   - } else {
235   - updated++;
236   - Uri appUri = Uri.withAppendedPath(Apps.CONTENT_URI, existing.getString(existing.getColumnIndex(Apps._ID)));
237   -
238   - getContentResolver().update(appUri, values, null, null);
239   - }
240   -
241   - }
242   -
243   - prefs.edit().putLong("sync_since", updatedUntil).commit();
244   -
245   - Log.d(TAG, "Sync until " + updatedUntil);
246   -
247   - /**
248   - * Visual feedback
249   - */
250   -
251   - hideNotification();
252   -
253   - } catch (Exception e) {
254   - Log.w(TAG, "Sync did not happen", e);
255   -
256   - hideNotification();
257   -
258   - if (receiver != null) {
259   - // Pass back error to surface listener
260   - final Bundle bundle = new Bundle();
261   - bundle.putString(Intent.EXTRA_TEXT, e.toString());
262   - receiver.send(STATUS_ERROR, bundle);
263   - }
264   - }
265   -
266   - // Announce success to any surface listener
267   - if (receiver != null) {
268   - final Bundle bundle = new Bundle();
269   - bundle.putInt(EXTRA_STATUS_UPLOADED, uploaded);
270   - bundle.putInt(EXTRA_STATUS_INSTALLED, installed);
271   - bundle.putInt(EXTRA_STATUS_UPDATED, updated);
272   -
273   - receiver.send(STATUS_FINISHED, bundle);
274   - }
275   - }
276   -
277   - /**
278   - * Show a notification while this service is running.
279   - */
280   - private void showNotification() {
281   - if (mNM == null) {
282   - return;
283   - }
284   -
285   - // Set the icon, scrolling text and timestamp
286   - Notification notification = new Notification(R.drawable.stat_notify_sync,
287   - "Syncing Apps", System.currentTimeMillis());
288   -
289   - // The PendingIntent to launch our activity if the user selects this notification
290   - PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
291   - new Intent(this, LauncherActivity.class), 0);
292   -
293   - // Set the info for the views that show in the notification panel.
294   - notification
295   - .setLatestEventInfo(this, "Soup Apps", "Synchronizing updates", contentIntent);
296   -
297   - // Send the notification.
298   - // We use a string id because it is a unique number. We use it later to cancel.
299   - mNM.notify(TAG, NOTIFY_ID, notification);
300   - }
301   -
302   - private void hideNotification() {
303   - if (mNM == null) {
304   - return;
305   - }
306   -
307   - mNM.cancel(TAG, NOTIFY_ID);
308   - }
  317 + mNM.cancel(TAG, NOTIFY_ID);
  318 + }
309 319
310 320 }

0 comments on commit b9a83c8

Please sign in to comment.
Something went wrong with that request. Please try again.