123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628 |
- package epson.print.screen;
- import android.content.ContentValues;
- import android.content.Context;
- import android.content.SharedPreferences;
- import android.database.Cursor;
- import android.net.Uri;
- import com.box.androidsdk.content.requests.BoxRequestsMetadata;
- import com.epson.mobilephone.common.PrintingLib.define.Constants;
- import com.epson.mobilephone.common.escpr.MediaInfo;
- import java.util.Enumeration;
- import java.util.HashMap;
- import java.util.Locale;
- import java.util.Map;
- import epson.print.IprintApplication;
- import epson.print.Util.EPLog;
- import epson.provider.SharedPreferencesProvider;
- public class PrintSetting {
- private static final String[] CAMERA_COPY_KEYS = {Constants.PREFS_INFO_SIZETYPESET_CAMERACOPY, Constants.PAPER_SOURCE_CAMERACOPY, Constants.COLOR_CAMERACOPY, Constants.LAYOUT_CAMERACOPY, Constants.PAPER_TYPE_CAMERACOPY, Constants.PAPER_SIZE_CAMERACOPY, Constants.QUALITY_CAMERACOPY, Constants.FEED_DIRECTION_CAMERACOPY};
- public static final int EMPTY_PRE_VALUE = -1;
- private static final String TAG = "PrintSetting";
- Map<String, Object> allValueFromContentProvider = new HashMap();
- public int brightnessValue = 0;
- public int colorValue;
- Context context;
- public int contrastValue = 0;
- public int copiesValue = 1;
- public int duplexValue;
- public int endValue = 1;
- public int feedDirectionValue;
- private Kind kind;
- public int layoutMultiPageValue;
- public int layoutValue;
- public int paperSizeValue;
- public int paperSourceValue;
- public int paperTypeValue;
- public int photoApfValueForLocalPrinter = 0;
- public boolean printAll = true;
- public int printdate = 0;
- public int qualityValue;
- public int saturationValue = 0;
- SharedPreferences settings = null;
- public int sharpnessForPhoto = 0;
- public int startValue = 1;
- public enum Kind {
- document,
- photo,
- cameracopy,
- NotSet
- }
- public Kind getKind() {
- return kind;
- }
- public PrintSetting(Context context2, Kind kind2) {
- if (SharedPreferencesProvider.checkPackageUseSharedPreferencesProvider(context2)) {
- context = null;
- settings = null;
- } else {
- context = context2;
- settings = context2.getSharedPreferences("PrintSetting", 0);
- }
- if (kind2 != null) {
- kind = kind2;
- } else {
- kind = Kind.NotSet;
- }
- }
- public static PrintSetting getInstance(Context context2, String str) {
- Kind kind2 = Kind.photo;
- try {
- kind2 = Kind.valueOf(str);
- } catch (Exception e) {
- EPLog.m306e("Exception " + e);
- }
- return new PrintSetting(context2, kind2);
- }
- public void loadSettings() {
- preparateSettings();
- paperSizeValue = getPaperSize();
- paperTypeValue = getPaperType();
- layoutValue = getLayout();
- layoutMultiPageValue = getLayoutMultiPage();
- qualityValue = getQuality();
- paperSourceValue = getPaperSorce();
- colorValue = getColor();
- duplexValue = getDuplex();
- feedDirectionValue = getFeedDirection();
- switch (kind) {
- case document:
- SharedPreferences sharedPreferences = settings;
- if (sharedPreferences != null) {
- printAll = sharedPreferences.getBoolean(Constants.PRINT_ALL, true);
- startValue = settings.getInt(Constants.START_PAGE, 1);
- endValue = settings.getInt(Constants.END_PAGE, 1);
- break;
- } else {
- printAll = getSettingBoolean(Constants.PRINT_ALL, true);
- startValue = getSetting(Constants.START_PAGE, (String) null, 1);
- endValue = getSetting(Constants.END_PAGE, (String) null, 1);
- break;
- }
- case photo:
- SharedPreferences sharedPreferences2 = settings;
- if (sharedPreferences2 != null) {
- printdate = sharedPreferences2.getInt(Constants.PRINTDATE, 0);
- photoApfValueForLocalPrinter = settings.getInt(Constants.APF_PHOTO, 1);
- sharpnessForPhoto = settings.getInt(Constants.SHARPNESS_PHOTO, 1);
- break;
- } else {
- printdate = getSetting(Constants.PRINTDATE, (String) null, 0);
- photoApfValueForLocalPrinter = getSetting(Constants.APF_PHOTO, (String) null, 1);
- sharpnessForPhoto = getSetting(Constants.SHARPNESS_PHOTO, (String) null, 1);
- break;
- }
- }
- SharedPreferences sharedPreferences3 = settings;
- if (sharedPreferences3 == null) {
- copiesValue = getSetting(Constants.COPIES, (String) null, 1);
- } else {
- copiesValue = sharedPreferences3.getInt(Constants.COPIES, 1);
- }
- brightnessValue = 0;
- contrastValue = 0;
- saturationValue = 0;
- }
- private void preparateSettings() {
- if (settings == null) {
- Cursor query = IprintApplication.getInstance().getContentResolver().query(Uri.parse("content://epson.print.provider.SharedPreferences/"), (String[]) null, (String) null, (String[]) null, (String) null);
- query.moveToFirst();
- allValueFromContentProvider.clear();
- EPLog.i();
- String str = null;
- Object obj = null;
- do {
- for (int i = 0; i < query.getColumnCount(); i++) {
- String columnName = query.getColumnName(i);
- if (columnName.equals("key")) {
- str = query.getString(i);
- } else if (columnName.equals(BoxRequestsMetadata.UpdateItemMetadata.BoxMetadataUpdateTask.VALUE)) {
- EPLog.i("さーびす", "PUT key: " + str + " getType: " + query.getType(i));
- query.getType(i);
- int type = query.getType(i);
- if (type == 1) {
- obj = Integer.valueOf(query.getInt(i));
- } else if (type == 3) {
- obj = query.getString(i);
- }
- } else {
- str = null;
- }
- }
- if (str != null) {
- if (!(obj instanceof String) || (!obj.equals("true") && !obj.equals("false"))) {
- allValueFromContentProvider.put(str, obj);
- } else {
- allValueFromContentProvider.put(str, Boolean.valueOf((String) obj));
- }
- str = null;
- }
- } while (query.moveToNext());
- query.close();
- }
- }
- public void saveSettings() {
- ContentValues contentValues;
- SharedPreferences.Editor editor;
- EPLog.d("PrintSetting", "saveSettings() " + kind.name());
- SharedPreferences sharedPreferences = settings;
- if (sharedPreferences == null) {
- contentValues = new ContentValues();
- editor = null;
- } else {
- editor = sharedPreferences.edit();
- contentValues = null;
- }
- switch (kind) {
- case document:
- if (editor != null) {
- editor.putInt(Constants.PAPER_SIZE, paperSizeValue);
- editor.putInt(Constants.PAPER_TYPE, paperTypeValue);
- editor.putInt(Constants.LAYOUT, layoutValue);
- editor.putInt(Constants.LAYOUT_MULTIPAGE, layoutMultiPageValue);
- editor.putInt(Constants.QUALITY, qualityValue);
- editor.putInt(Constants.PAPER_SOURCE, paperSourceValue);
- editor.putInt(Constants.COLOR, colorValue);
- editor.putInt(Constants.DUPLEX, duplexValue);
- editor.putInt(Constants.FEED_DIRECTION, feedDirectionValue);
- editor.putBoolean(Constants.PRINT_ALL, printAll);
- editor.putInt(Constants.START_PAGE, startValue);
- editor.putInt(Constants.END_PAGE, endValue);
- break;
- } else {
- contentValues.put(Constants.PAPER_SIZE, Integer.valueOf(paperSizeValue));
- contentValues.put(Constants.PAPER_TYPE, Integer.valueOf(paperTypeValue));
- contentValues.put(Constants.LAYOUT, Integer.valueOf(layoutValue));
- contentValues.put(Constants.LAYOUT_MULTIPAGE, Integer.valueOf(layoutMultiPageValue));
- contentValues.put(Constants.QUALITY, Integer.valueOf(qualityValue));
- contentValues.put(Constants.PAPER_SOURCE, Integer.valueOf(paperSourceValue));
- contentValues.put(Constants.COLOR, Integer.valueOf(colorValue));
- contentValues.put(Constants.DUPLEX, Integer.valueOf(duplexValue));
- contentValues.put(Constants.FEED_DIRECTION, Integer.valueOf(feedDirectionValue));
- contentValues.put(Constants.PRINT_ALL, Boolean.valueOf(printAll));
- contentValues.put(Constants.START_PAGE, Integer.valueOf(startValue));
- contentValues.put(Constants.END_PAGE, Integer.valueOf(endValue));
- break;
- }
- case photo:
- if (editor != null) {
- editor.putInt(Constants.PAPER_SIZE_PHOTO, paperSizeValue);
- editor.putInt(Constants.PAPER_TYPE_PHOTO, paperTypeValue);
- editor.putInt(Constants.LAYOUT_PHOTO, layoutValue);
- editor.putInt(Constants.LAYOUT_MULTIPAGE_PHOTO, layoutMultiPageValue);
- editor.putInt(Constants.QUALITY_PHOTO, qualityValue);
- editor.putInt(Constants.PAPER_SOURCE_PHOTO, paperSourceValue);
- editor.putInt(Constants.COLOR_PHOTO, colorValue);
- editor.putInt(Constants.DUPLEX_PHOTO, duplexValue);
- editor.putInt(Constants.FEED_DIRECTION_PHOTO, feedDirectionValue);
- editor.putInt(Constants.PRINTDATE, printdate);
- editor.putInt(Constants.APF_PHOTO, photoApfValueForLocalPrinter);
- editor.putInt(Constants.SHARPNESS_PHOTO, sharpnessForPhoto);
- break;
- } else {
- contentValues.put(Constants.PAPER_SIZE_PHOTO, Integer.valueOf(paperSizeValue));
- contentValues.put(Constants.PAPER_TYPE_PHOTO, Integer.valueOf(paperTypeValue));
- contentValues.put(Constants.LAYOUT_PHOTO, Integer.valueOf(layoutValue));
- contentValues.put(Constants.LAYOUT_MULTIPAGE_PHOTO, Integer.valueOf(layoutMultiPageValue));
- contentValues.put(Constants.QUALITY_PHOTO, Integer.valueOf(qualityValue));
- contentValues.put(Constants.PAPER_SOURCE_PHOTO, Integer.valueOf(paperSourceValue));
- contentValues.put(Constants.COLOR_PHOTO, Integer.valueOf(colorValue));
- contentValues.put(Constants.DUPLEX_PHOTO, Integer.valueOf(duplexValue));
- contentValues.put(Constants.FEED_DIRECTION_PHOTO, Integer.valueOf(feedDirectionValue));
- contentValues.put(Constants.PRINTDATE, Integer.valueOf(printdate));
- contentValues.put(Constants.APF_PHOTO, Integer.valueOf(photoApfValueForLocalPrinter));
- contentValues.put(Constants.SHARPNESS_PHOTO, Integer.valueOf(sharpnessForPhoto));
- break;
- }
- case cameracopy:
- if (editor != null) {
- editor.putInt(Constants.PAPER_SIZE_CAMERACOPY, paperSizeValue);
- editor.putInt(Constants.PAPER_TYPE_CAMERACOPY, paperTypeValue);
- editor.putInt(Constants.LAYOUT_CAMERACOPY, layoutValue);
- editor.putInt(Constants.QUALITY_CAMERACOPY, qualityValue);
- editor.putInt(Constants.PAPER_SOURCE_CAMERACOPY, paperSourceValue);
- editor.putInt(Constants.COLOR_CAMERACOPY, colorValue);
- editor.putInt(Constants.FEED_DIRECTION_CAMERACOPY, feedDirectionValue);
- break;
- } else {
- contentValues.put(Constants.PAPER_SIZE_CAMERACOPY, Integer.valueOf(paperSizeValue));
- contentValues.put(Constants.PAPER_TYPE_CAMERACOPY, Integer.valueOf(paperTypeValue));
- contentValues.put(Constants.LAYOUT_CAMERACOPY, Integer.valueOf(layoutValue));
- contentValues.put(Constants.QUALITY_CAMERACOPY, Integer.valueOf(qualityValue));
- contentValues.put(Constants.PAPER_SOURCE_CAMERACOPY, Integer.valueOf(paperSourceValue));
- contentValues.put(Constants.COLOR_CAMERACOPY, Integer.valueOf(colorValue));
- contentValues.put(Constants.FEED_DIRECTION_CAMERACOPY, Integer.valueOf(feedDirectionValue));
- break;
- }
- }
- if (editor == null) {
- contentValues.put(Constants.COPIES, Integer.valueOf(copiesValue));
- contentValues.put(Constants.BRIGHTNESS, Integer.valueOf(brightnessValue));
- contentValues.put(Constants.CONTRAST, Integer.valueOf(contrastValue));
- contentValues.put(Constants.SATURATION, Integer.valueOf(saturationValue));
- } else {
- editor.putInt(Constants.COPIES, copiesValue);
- editor.putInt(Constants.BRIGHTNESS, brightnessValue);
- editor.putInt(Constants.CONTRAST, contrastValue);
- editor.putInt(Constants.SATURATION, saturationValue);
- }
- if (settings == null) {
- IprintApplication.getInstance().getContentResolver().update(Uri.parse("content://epson.print.provider.SharedPreferences/"), contentValues, (String) null, (String[]) null);
- return;
- }
- editor.commit();
- }
- public int getDefaultPaperSize() {
- int code = Constants.PaperName.EPS_MSID_A4.getCode();
- String country = Locale.getDefault().getCountry();
- switch (kind) {
- case document:
- case cameracopy:
- return (country.equals(Locale.US.getCountry()) || country.equals(Locale.CANADA.getCountry())) ? Constants.PaperName.EPS_MSID_LETTER.getCode() : Constants.PaperName.EPS_MSID_A4.getCode();
- case photo:
- int code2 = Constants.PaperName.EPS_MSID_4X6.getCode();
- if (country.equals(Locale.JAPAN.getCountry())) {
- return Constants.PaperName.EPS_MSID_L.getCode();
- }
- return code2;
- default:
- return code;
- }
- }
- private int getPaperSize() {
- int defaultPaperSize = getDefaultPaperSize();
- switch (kind) {
- case document:
- return getSetting(epson.common.Constants.PAPER_SIZE, (String) null, defaultPaperSize);
- case photo:
- return getSetting(epson.common.Constants.PAPER_SIZE_PHOTO, (String) null, defaultPaperSize);
- case cameracopy:
- return getSetting(epson.common.Constants.PAPER_SIZE_CAMERACOPY, (String) null, defaultPaperSize);
- default:
- return defaultPaperSize;
- }
- }
- public int getDefaultPaperType() {
- switch (kind) {
- case document:
- case cameracopy:
- return Constants.MediaName.EPS_MTID_PLAIN.getCode();
- case photo:
- return Constants.MediaName.EPS_MTID_PGPHOTO.getCode();
- default:
- return 0;
- }
- }
- private int getPaperType() {
- int defaultPaperType = getDefaultPaperType();
- switch (kind) {
- case document:
- return getSetting(epson.common.Constants.PAPER_TYPE, (String) null, defaultPaperType);
- case photo:
- return getSetting(epson.common.Constants.PAPER_TYPE_PHOTO, (String) null, defaultPaperType);
- case cameracopy:
- return getSetting(epson.common.Constants.PAPER_TYPE_CAMERACOPY, (String) null, defaultPaperType);
- default:
- return defaultPaperType;
- }
- }
- private int getLayout() {
- int i;
- switch (kind) {
- case photo:
- i = getSetting(epson.common.Constants.LAYOUT_PHOTO, (String) null, 1);
- break;
- case cameracopy:
- i = getSetting(epson.common.Constants.LAYOUT_CAMERACOPY, (String) null, 2);
- break;
- default:
- i = 2;
- break;
- }
- if (i == 8) {
- return 2;
- }
- return i;
- }
- private int getLayoutMultiPage() {
- switch (kind) {
- case document:
- return getSetting(epson.common.Constants.LAYOUT_MULTIPAGE, (String) null, 0);
- case photo:
- return getSetting(epson.common.Constants.LAYOUT_MULTIPAGE_PHOTO, (String) null, 0);
- default:
- return 0;
- }
- }
- private int getQuality() {
- switch (kind) {
- case document:
- return getSetting(epson.common.Constants.QUALITY, (String) null, 2);
- case photo:
- return getSetting(epson.common.Constants.QUALITY_PHOTO, (String) null, 2);
- case cameracopy:
- return getSetting(epson.common.Constants.QUALITY_CAMERACOPY, (String) null, 2);
- default:
- return 2;
- }
- }
- private int getPaperSorce() {
- int i;
- switch (kind) {
- case document:
- i = getSetting(epson.common.Constants.PAPER_SOURCE, (String) null, 128);
- break;
- case photo:
- i = getSetting(epson.common.Constants.PAPER_SOURCE_PHOTO, (String) null, 128);
- break;
- case cameracopy:
- i = getSetting(epson.common.Constants.PAPER_SOURCE_CAMERACOPY, (String) null, 128);
- break;
- default:
- i = 128;
- break;
- }
- if (i == 0) {
- return 128;
- }
- return i;
- }
- private int getDuplex() {
- switch (kind) {
- case document:
- return getSetting(epson.common.Constants.DUPLEX, (String) null, 0);
- case photo:
- return getSetting(epson.common.Constants.DUPLEX_PHOTO, (String) null, 0);
- default:
- return 0;
- }
- }
- private int getFeedDirection() {
- switch (kind) {
- case document:
- return getSetting(epson.common.Constants.FEED_DIRECTION, (String) null, 0);
- case photo:
- return getSetting(epson.common.Constants.FEED_DIRECTION_PHOTO, (String) null, 0);
- case cameracopy:
- return getSetting(epson.common.Constants.FEED_DIRECTION_CAMERACOPY, (String) null, 0);
- default:
- return 0;
- }
- }
- private int getColor() {
- switch (kind) {
- case document:
- return getSetting(epson.common.Constants.COLOR, (String) null, 0);
- case photo:
- return getSetting(epson.common.Constants.COLOR_PHOTO, (String) null, 0);
- case cameracopy:
- return getSetting(epson.common.Constants.COLOR_CAMERACOPY, (String) null, 0);
- default:
- return 0;
- }
- }
- public String getPrinterName() {
- return getSettingString(epson.common.Constants.PRINTER_NAME, (String) null);
- }
- public String getPrinterID() {
- return getSettingString(epson.common.Constants.PRINTER_ID, (String) null);
- }
- public String getIP() {
- return getSettingString(epson.common.Constants.PRINTER_IP, (String) null);
- }
- public String getSrialNo() {
- return getSettingString(epson.common.Constants.PRINTER_SERIAL_NO, (String) null);
- }
- public String getEmailAddress() {
- return getSettingString(epson.common.Constants.PRINTER_EMAIL_ADDRESS, (String) null);
- }
- public int getLocation() {
- return getSetting(epson.common.Constants.PRINTER_LOCATION, (String) null, 0);
- }
- public int getLang() {
- return getSetting(epson.common.Constants.LANG, (String) null, 1);
- }
- private int getSetting(String str, String str2, int i) {
- SharedPreferences sharedPreferences = settings;
- if (sharedPreferences == null) {
- if (allValueFromContentProvider.containsKey(str)) {
- allValueFromContentProvider.get(str);
- return ((Integer) allValueFromContentProvider.get(str)).intValue();
- } else if (str2 != null && allValueFromContentProvider.containsKey(str2)) {
- return ((Integer) allValueFromContentProvider.get(str2)).intValue();
- } else {
- return i;
- }
- } else if (sharedPreferences.getAll().containsKey(str) || str2 == null) {
- return settings.getInt(str, i);
- } else {
- return settings.getInt(str2, i);
- }
- }
- private String getSettingString(String str, String str2) {
- SharedPreferences sharedPreferences = settings;
- if (sharedPreferences != null) {
- return sharedPreferences.getAll().containsKey(str) ? settings.getString(str, str2) : str2;
- }
- if (!allValueFromContentProvider.containsKey(str) || allValueFromContentProvider.get(str) == null) {
- return str2;
- }
- return (String) allValueFromContentProvider.get(str);
- }
- private boolean getSettingBoolean(String str, boolean z) {
- if (settings != null || !this.allValueFromContentProvider.containsKey(str)) {
- return z;
- }
- allValueFromContentProvider.get(str);
- return ((Boolean) allValueFromContentProvider.get(str)).booleanValue();
- }
- public int getEcClientLibSourceType() {
- return C23321.$SwitchMap$epson$print$screen$PrintSetting$Kind[this.kind.ordinal()] != 1 ? 2 : 1;
- }
- private SharedPreferences getPaperSizeTypePreferences() {
- String str;
- switch (kind) {
- case document:
- str = epson.common.Constants.PREFS_INFO_SIZETYPESET;
- break;
- case photo:
- str = epson.common.Constants.PREFS_INFO_SIZETYPESET_PHOTO;
- break;
- case cameracopy:
- str = epson.common.Constants.PREFS_INFO_SIZETYPESET_CAMERACOPY;
- break;
- default:
- str = null;
- break;
- }
- return context.getSharedPreferences(str, 0);
- }
- public MediaInfo.PaperSizeType loadPaperSizeTypePear() {
- MediaInfo.PaperSizeType paperSizeType = new MediaInfo.PaperSizeType();
- SharedPreferences paperSizeTypePreferences = getPaperSizeTypePreferences();
- Enumeration keys = paperSizeType.getKeys();
- while (keys.hasMoreElements()) {
- int intValue = ((Integer) keys.nextElement()).intValue();
- int i = paperSizeTypePreferences.getInt(Integer.toString(intValue), -1);
- if (i != -1) {
- paperSizeType.putID(intValue, i);
- }
- }
- return paperSizeType;
- }
- public void savePaperSizeTypePear(MediaInfo.PaperSizeType paperSizeType) {
- SharedPreferences.Editor edit = getPaperSizeTypePreferences().edit();
- Enumeration keys = paperSizeType.getKeys();
- while (keys.hasMoreElements()) {
- int intValue = ((Integer) keys.nextElement()).intValue();
- edit.putInt(Integer.toString(intValue), paperSizeType.getID(intValue));
- }
- edit.commit();
- }
- public void resetPageRange(int i, int i2) {
- EPLog.d("PrintSetting", "resetPrintSettings()");
- SharedPreferences.Editor edit = settings.edit();
- printAll = true;
- startValue = i;
- endValue = i2;
- edit.putBoolean(epson.common.Constants.PRINT_ALL, printAll);
- edit.putInt(epson.common.Constants.START_PAGE, startValue);
- edit.putInt(epson.common.Constants.END_PAGE, endValue);
- edit.commit();
- }
- public void resetPrintSettings() {
- EPLog.d("PrintSetting", "resetPrintSettings()");
- SharedPreferences.Editor edit = settings.edit();
- edit.putInt(epson.common.Constants.COPIES, 1);
- edit.putInt(epson.common.Constants.BRIGHTNESS, 0);
- edit.putInt(epson.common.Constants.CONTRAST, 0);
- edit.putInt(epson.common.Constants.SATURATION, 0);
- edit.commit();
- }
- public int getUpdateSettingsRemoteSourceType() {
- switch (kind) {
- case photo:
- return 2;
- case cameracopy:
- return 2;
- default:
- return 1;
- }
- }
- public void clearSettings() {
- EPLog.d("PrintSetting", "clearSettings()");
- SharedPreferences.Editor edit = settings.edit();
- edit.remove(epson.common.Constants.PAPER_SIZE);
- edit.remove(epson.common.Constants.PAPER_TYPE);
- edit.remove(epson.common.Constants.LAYOUT);
- edit.remove(epson.common.Constants.QUALITY);
- edit.remove(epson.common.Constants.PAPER_SOURCE);
- edit.remove(epson.common.Constants.COLOR);
- edit.remove(epson.common.Constants.DUPLEX);
- edit.remove(epson.common.Constants.FEED_DIRECTION);
- edit.remove(epson.common.Constants.PAPER_SIZE_PHOTO);
- edit.remove(epson.common.Constants.PAPER_TYPE_PHOTO);
- edit.remove(epson.common.Constants.LAYOUT_PHOTO);
- edit.remove(epson.common.Constants.QUALITY_PHOTO);
- edit.remove(epson.common.Constants.PAPER_SOURCE_PHOTO);
- edit.remove(epson.common.Constants.COLOR_PHOTO);
- edit.remove(epson.common.Constants.DUPLEX_PHOTO);
- edit.remove(epson.common.Constants.FEED_DIRECTION_PHOTO);
- edit.remove(epson.common.Constants.PRINT_ALL);
- edit.remove(epson.common.Constants.START_PAGE);
- edit.remove(epson.common.Constants.END_PAGE);
- edit.remove(epson.common.Constants.PRINTDATE);
- edit.remove(epson.common.Constants.APF_PHOTO);
- edit.remove(epson.common.Constants.COPIES);
- edit.remove(epson.common.Constants.BRIGHTNESS);
- edit.remove(epson.common.Constants.CONTRAST);
- edit.remove(epson.common.Constants.SATURATION);
- for (String remove : CAMERA_COPY_KEYS) {
- edit.remove(remove);
- }
- edit.commit();
- context.getSharedPreferences(epson.common.Constants.PREFS_INFO_SIZETYPESET, 0).edit().clear().commit();
- context.getSharedPreferences(epson.common.Constants.PREFS_INFO_SIZETYPESET_PHOTO, 0).edit().clear().commit();
- context.getSharedPreferences(epson.common.Constants.PREFS_INFO_SIZETYPESET_CAMERACOPY, 0).edit().clear().commit();
- }
- }
|