Market disable logic for amazon market.

pull/14/head
Tim Su 13 years ago
parent 30db35fcc1
commit 9c1262c8fd

@ -34,7 +34,6 @@
should be checked in in Version Control Systems. -->
<property file="default.properties" />
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="antlib/ant-contrib-1.0b3.jar"/>
@ -111,7 +110,7 @@
</target>
<!-- post build: rename apk -->
<target name="release" depends="clean, get-version, warnings, android_rules.release">
<target name="release" depends="clean, get-version, warnings, disable-market, android_rules.release">
<mkdir dir="../release" />
<property name="out.final.package"
location="../release/${ant.project.name}-${manifest.version.code}-${manifest.version.name}-release.apk" />
@ -140,6 +139,15 @@
</exec>
</target>
<target name="disable-market" if="custom.market.disabled">
<echo message="Disabling android market links" />
<replace token="market://" value="disabled://"
dir="${source.dir}" />
<replaceregexp file="${source.dir}/com/todoroo/astrid/utility/Constants.java"
match="(MARKET_DISABLED.*=).*"
replace="\1 true;" />
</target>
<!-- build custom release package with updated version name -->
<target name="release-custom">
<fail message="need to set custom.version.name">

@ -92,6 +92,7 @@ import com.todoroo.astrid.timers.TimerControlSet;
import com.todoroo.astrid.ui.CalendarDialog;
import com.todoroo.astrid.ui.DeadlineTimePickerDialog;
import com.todoroo.astrid.ui.DeadlineTimePickerDialog.OnDeadlineTimeSetListener;
import com.todoroo.astrid.utility.Constants;
import com.todoroo.astrid.voice.VoiceInputAssistant;
/**
@ -300,7 +301,7 @@ public final class TaskEditActivity extends TabActivity {
controls.add(new TimerControlSet(TaskEditActivity.this, addonsAddons));
controls.add(new AlarmControlSet(TaskEditActivity.this, addonsAddons));
if(!addOnService.hasPowerPack()) {
if(!Constants.MARKET_DISABLED && !addOnService.hasPowerPack()) {
// show add-on help if necessary
View addonsEmpty = findViewById(R.id.addons_empty);
addonsEmpty.setVisibility(View.VISIBLE);

@ -250,9 +250,11 @@ public class TaskListActivity extends ListActivity implements OnScrollListener,
MenuItem item;
item = menu.add(Menu.NONE, MENU_ADDONS_ID, Menu.NONE,
R.string.TLA_menu_addons);
item.setIcon(android.R.drawable.ic_menu_set_as);
if(!Constants.MARKET_DISABLED) {
item = menu.add(Menu.NONE, MENU_ADDONS_ID, Menu.NONE,
R.string.TLA_menu_addons);
item.setIcon(android.R.drawable.ic_menu_set_as);
}
item = menu.add(Menu.NONE, MENU_SETTINGS_ID, Menu.NONE,
R.string.TLA_menu_settings);

@ -20,6 +20,11 @@ public final class Constants {
*/
public static final boolean OEM = false;
/**
* Whether this is an Android Market-disabled build
*/
public static final boolean MARKET_DISABLED = false;
/**
* Interval to update the widget (in order to detect hidden tasks
* becoming visible)

@ -217,7 +217,7 @@ public class VoiceInputAssistant {
else
packageName = "com.google.android.voicesearch";
// User wants to install voice search, take him to the market
// User wants to install voice search, take them to the market
Intent marketIntent = new Intent(Intent.ACTION_VIEW,
Uri.parse("market://search?q=pname:" + packageName)); //$NON-NLS-1$
try {

@ -31,7 +31,7 @@
<target name="release-all" depends="clean,get-version,release">
<!-- custom builds -->
<for list="-getjar,.1000,-verizon,-sprint,-orange,-vodafone,-other" param="name">
<for list="-getjar,-verizon,-sprint,-orange,-vodafone,-other" param="name">
<sequential>
<subant target="release-custom">
<fileset file="astrid/build.xml" />
@ -39,6 +39,13 @@
</subant>
</sequential>
</for>
<!-- amazon -->
<subant>
<fileset file="astrid/build.xml" />
<property name="custom.version.name" value=".1000" />
<property name="custom.market.disabled" value="true" />
<target name="release-custom" />
</subant>
</target>
</project>

Loading…
Cancel
Save