Remove excluded settings, amazon market strategy

pull/253/head
Alex Baker 9 years ago
parent 9c0c2b7bba
commit 7438a8bf38

@ -26,7 +26,6 @@ import com.todoroo.astrid.gcal.CalendarAlarmScheduler;
import com.todoroo.astrid.gtasks.GtasksPreferences;
import com.todoroo.astrid.reminders.ReminderPreferences;
import com.todoroo.astrid.service.StartupService;
import com.todoroo.astrid.utility.Constants;
import com.todoroo.astrid.utility.TodorooPreferenceActivity;
import com.todoroo.astrid.voice.VoiceOutputAssistant;
@ -118,18 +117,6 @@ public class EditPreferences extends TodorooPreferenceActivity {
});
addPreferenceListeners();
removeForbiddenPreferences(screen, r);
}
public static void removeForbiddenPreferences(PreferenceScreen screen, Resources r) {
int[] forbiddenPrefs = Constants.MARKET_STRATEGY.excludedSettings();
if (forbiddenPrefs == null) {
return;
}
for (int i : forbiddenPrefs) {
searchForAndRemovePreference(screen, r.getString(i));
}
}
private static boolean searchForAndRemovePreference(PreferenceGroup group, String key) {

@ -8,8 +8,6 @@ package com.todoroo.astrid.service;
import android.content.Intent;
import android.net.Uri;
import org.tasks.R;
public abstract class MarketStrategy {
/**
@ -17,12 +15,7 @@ public abstract class MarketStrategy {
*/
abstract public Intent generateMarketLink(String packageName);
public int[] excludedSettings() {
return null;
}
public static class AndroidMarketStrategy extends MarketStrategy {
@Override
public Intent generateMarketLink(String packageName) {
return new Intent(Intent.ACTION_VIEW,
@ -30,31 +23,4 @@ public abstract class MarketStrategy {
packageName));
}
}
public static class AmazonMarketStrategy extends MarketStrategy {
@Override
public Intent generateMarketLink(String packageName) {
return new Intent(Intent.ACTION_VIEW,
Uri.parse("http://www.amazon.com/gp/mas/dl/android?p=" + //$NON-NLS-1$
packageName));
}
/**
* @return true if the device is a kindle fire and needs special treatment
*/
public static boolean isKindleFire() {
return android.os.Build.MANUFACTURER.equals("Amazon") && //$NON-NLS-1$
android.os.Build.MODEL.contains("Kindle"); //$NON-NLS-1$
}
@Override
public int[] excludedSettings() {
return new int[] {
R.string.p_voicePrefSection,
R.string.p_end_at_deadline,
R.string.p_field_missed_calls
};
}
}
}

Loading…
Cancel
Save