Merge lp:~karni/ubuntuone-android-music/fix-demo-purchase into lp:ubuntuone-android-music

Proposed by Michał Karnicki on 2012-02-24
Status: Merged
Approved by: Chad Miller on 2012-03-02
Approved revision: 563
Merged at revision: 563
Proposed branch: lp:~karni/ubuntuone-android-music/fix-demo-purchase
Merge into: lp:ubuntuone-android-music
Diff against target: 44 lines (+22/-2)
1 file modified
src/net/sourceforge/subsonic/androidapp/activity/StoreActivity.java (+22/-2)
To merge this branch: bzr merge lp:~karni/ubuntuone-android-music/fix-demo-purchase
Reviewer Review Type Date Requested Status
Chad Miller (community) 2012-02-24 Approve on 2012-03-02
Review via email: mp+94561@code.launchpad.net

Description of the change

Only display purchase options in Ubuntu One customer mode. Otherwise, display learn-more style pages.

To post a comment you must log in.
Chad Miller (cmiller) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/net/sourceforge/subsonic/androidapp/activity/StoreActivity.java'
2--- src/net/sourceforge/subsonic/androidapp/activity/StoreActivity.java 2011-11-07 21:48:01 +0000
3+++ src/net/sourceforge/subsonic/androidapp/activity/StoreActivity.java 2012-02-24 15:02:00 +0000
4@@ -82,9 +82,15 @@
5 private static final String UBUNTUONE_FROM_OAUTH_URL =
6 UBUNTUONE_URL + "/api/1.0/from_oauth/";
7
8+ private static final String LEARN_MORE_STREAMING_URL =
9+ UBUNTUONE_URL + "/services/music/?hide-hdft=1";
10+
11 private static final String PURCHASE_STREAMING_URL =
12 UBUNTUONE_URL + "/services/music-streaming/?hide-hdft=1";
13
14+ private static final String LEARN_MORE_STORAGE_URL =
15+ UBUNTUONE_URL + "/services/free/?hide-hdft=1";
16+
17 private static final String PURCHASE_STORAGE_URL =
18 UBUNTUONE_URL + "/services/add-storage/?hide-hdft=1";
19
20@@ -122,8 +128,22 @@
21 return;
22 }
23
24- mLoginTask = new LoginTask();
25- mLoginTask.execute();
26+ int serverId = Util.getActiveServer(this);
27+ if (serverId == Util.SERVER_ID_UBUNTUONE_CUSTOMER) {
28+ mLoginTask = new LoginTask();
29+ mLoginTask.execute();
30+ } else {
31+ final Intent intent = getIntent();
32+ if (intent != null) {
33+ if (STORAGE.equals(intent.getStringExtra(KEY_PURCHASE))) {
34+ webView.loadUrl(LEARN_MORE_STORAGE_URL);
35+ } else {
36+ webView.loadUrl(LEARN_MORE_STREAMING_URL);
37+ }
38+ } else {
39+ webView.loadUrl(LEARN_MORE_STREAMING_URL);
40+ }
41+ }
42
43 mTracker = GoogleAnalyticsTracker.getInstance();
44 mTracker.start(Analytics.ACCOUNT, this);

Subscribers

People subscribed via source and target branches

to status/vote changes: