purge all code blocks for < android-14, except installer stuff

The installer stuff should hopefully become a standalone library, so that
might as well keep the old support in place.

#1379
This commit is contained in:
Hans-Christoph Steiner 2018-04-19 13:00:10 +02:00
parent e923427232
commit 2a9c3fee5b
18 changed files with 70 additions and 214 deletions

View File

@ -7,7 +7,6 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
@ -511,11 +510,6 @@ public final class AppUpdateStatusManager {
} }
break; break;
} }
if (Build.VERSION.SDK_INT < 11 && entry.intent == null) {
Intent intent = new Intent();
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
entry.intent = PendingIntent.getActivity(context, 0, intent, 0);
}
} }
/** /**

View File

@ -16,16 +16,10 @@ public class NfcHelper {
private static final String TAG = "NfcHelper"; private static final String TAG = "NfcHelper";
@TargetApi(14)
private static NfcAdapter getAdapter(Context context) { private static NfcAdapter getAdapter(Context context) {
if (Build.VERSION.SDK_INT < 14) {
return null;
}
return NfcAdapter.getDefaultAdapter(context.getApplicationContext()); return NfcAdapter.getDefaultAdapter(context.getApplicationContext());
} }
@TargetApi(14)
public static boolean setPushMessage(Activity activity, Uri toShare) { public static boolean setPushMessage(Activity activity, Uri toShare) {
NfcAdapter adapter = getAdapter(activity); NfcAdapter adapter = getAdapter(activity);
if (adapter != null) { if (adapter != null) {

View File

@ -46,12 +46,8 @@ public class NfcNotEnabledActivity extends AppCompatActivity {
final Intent intent = new Intent(); final Intent intent = new Intent();
if (Build.VERSION.SDK_INT >= 16) { if (Build.VERSION.SDK_INT >= 16) {
doOnJellybean(intent); doOnJellybean(intent);
} else if (Build.VERSION.SDK_INT >= 14) {
doOnIceCreamSandwich(intent);
} else { } else {
// no NFC support, so nothing to do here doOnIceCreamSandwich(intent);
finish();
return;
} }
startActivity(intent); startActivity(intent);
finish(); finish();

View File

@ -117,7 +117,7 @@ class NotificationHelper {
} }
private boolean useStackedNotifications() { private boolean useStackedNotifications() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.N; return Build.VERSION.SDK_INT >= 24;
} }
/** /**
@ -481,15 +481,8 @@ class NotificationHelper {
} }
private Point getLargeIconSize() { private Point getLargeIconSize() {
int w; int w = context.getResources().getDimensionPixelSize(android.R.dimen.notification_large_icon_width);
int h; int h = context.getResources().getDimensionPixelSize(android.R.dimen.notification_large_icon_height);
if (Build.VERSION.SDK_INT >= 11) {
w = context.getResources().getDimensionPixelSize(android.R.dimen.notification_large_icon_width);
h = context.getResources().getDimensionPixelSize(android.R.dimen.notification_large_icon_height);
} else {
w = context.getResources().getDimensionPixelSize(android.R.dimen.app_icon_size);
h = w;
}
return new Point(w, h); return new Point(w, h);
} }

View File

@ -5,11 +5,9 @@ import android.app.Activity;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.Point; import android.graphics.Point;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.Build;
import android.util.Log; import android.util.Log;
import android.view.Display; import android.view.Display;
import android.widget.ImageView; import android.widget.ImageView;
import com.google.zxing.BarcodeFormat; import com.google.zxing.BarcodeFormat;
import com.google.zxing.WriterException; import com.google.zxing.WriterException;
import com.google.zxing.encode.Contents; import com.google.zxing.encode.Contents;
@ -39,15 +37,9 @@ public class QrGenAsyncTask extends AsyncTask<String, Void, Void> {
Display display = activity.getWindowManager().getDefaultDisplay(); Display display = activity.getWindowManager().getDefaultDisplay();
Point outSize = new Point(); Point outSize = new Point();
int x, y, qrCodeDimension; int x, y, qrCodeDimension;
/* lame, got to use both the new and old APIs here */
if (Build.VERSION.SDK_INT >= 13) {
display.getSize(outSize); display.getSize(outSize);
x = outSize.x; x = outSize.x;
y = outSize.y; y = outSize.y;
} else {
x = display.getWidth();
y = display.getHeight();
}
if (x < y) { if (x < y) {
qrCodeDimension = x; qrCodeDimension = x;
} else { } else {

View File

@ -1,49 +0,0 @@
package org.fdroid.fdroid.compat;
import android.annotation.TargetApi;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.os.Build;
public abstract class ClipboardCompat {
public abstract String getText();
public static ClipboardCompat create(Context context) {
if (Build.VERSION.SDK_INT >= 11) {
return new HoneycombClipboard(context);
}
return new OldClipboard();
}
@TargetApi(11)
private static class HoneycombClipboard extends ClipboardCompat {
private final ClipboardManager manager;
HoneycombClipboard(Context context) {
this.manager = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
}
@Override
public String getText() {
CharSequence text = null;
if (manager.hasPrimaryClip()) {
ClipData data = manager.getPrimaryClip();
if (data.getItemCount() > 0) {
text = data.getItemAt(0).getText();
}
}
return text != null ? text.toString() : null;
}
}
private static class OldClipboard extends ClipboardCompat {
@Override
public String getText() {
return null;
}
}
}

View File

@ -1,21 +0,0 @@
package org.fdroid.fdroid.compat;
import android.net.Uri;
import android.os.Build;
public class UriCompat {
/**
* Uri#getQueryParameter(String) has the following warning:
*
* > Prior to Ice Cream Sandwich, this decoded the '+' character as '+' rather than ' '.
*/
public static String getQueryParameter(Uri uri, String key) {
String value = uri.getQueryParameter(key);
if (value != null && Build.VERSION.SDK_INT < 14) {
value = value.replaceAll("\\+", " ");
}
return value;
}
}

View File

@ -1,9 +1,6 @@
package org.fdroid.fdroid.net.bluetooth; package org.fdroid.fdroid.net.bluetooth;
import android.annotation.TargetApi;
import android.bluetooth.BluetoothSocket; import android.bluetooth.BluetoothSocket;
import android.os.Build;
import org.fdroid.fdroid.Utils; import org.fdroid.fdroid.Utils;
import java.io.BufferedInputStream; import java.io.BufferedInputStream;
@ -32,9 +29,8 @@ public class BluetoothConnection {
return output; return output;
} }
@TargetApi(14)
public void open() throws IOException { public void open() throws IOException {
if (Build.VERSION.SDK_INT >= 14 && !socket.isConnected()) { if (!socket.isConnected()) {
// Server sockets will already be connected when they are passed to us, // Server sockets will already be connected when they are passed to us,
// client sockets require us to call connect(). // client sockets require us to call connect().
socket.connect(); socket.connect();

View File

@ -20,6 +20,8 @@
package org.fdroid.fdroid.views; package org.fdroid.fdroid.views;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.ContentValues; import android.content.ContentValues;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
@ -55,7 +57,6 @@ import org.fdroid.fdroid.FDroidApp;
import org.fdroid.fdroid.R; import org.fdroid.fdroid.R;
import org.fdroid.fdroid.UpdateService; import org.fdroid.fdroid.UpdateService;
import org.fdroid.fdroid.Utils; import org.fdroid.fdroid.Utils;
import org.fdroid.fdroid.compat.ClipboardCompat;
import org.fdroid.fdroid.compat.CursorAdapterCompat; import org.fdroid.fdroid.compat.CursorAdapterCompat;
import org.fdroid.fdroid.data.NewRepoConfig; import org.fdroid.fdroid.data.NewRepoConfig;
import org.fdroid.fdroid.data.Repo; import org.fdroid.fdroid.data.Repo;
@ -158,13 +159,24 @@ public class ManageReposActivity extends AppCompatActivity
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
} }
public String getPrimaryClipAsText() {
CharSequence text = null;
ClipboardManager clipboardManager = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
if (clipboardManager.hasPrimaryClip()) {
ClipData data = clipboardManager.getPrimaryClip();
if (data.getItemCount() > 0) {
text = data.getItemAt(0).getText();
}
}
return text != null ? text.toString() : null;
}
private void showAddRepo() { private void showAddRepo() {
/* /*
* If there is text in the clipboard, and it looks like a URL, use that. * If there is text in the clipboard, and it looks like a URL, use that.
* Otherwise use "https://" as default repo string. * Otherwise use "https://" as default repo string.
*/ */
ClipboardCompat clipboard = ClipboardCompat.create(this); String text = getPrimaryClipAsText();
String text = clipboard.getText();
String fingerprint = null; String fingerprint = null;
String username = null; String username = null;
String password = null; String password = null;

View File

@ -2,14 +2,12 @@ package org.fdroid.fdroid.views;
import android.content.Context; import android.content.Context;
import android.database.Cursor; import android.database.Cursor;
import android.os.Build;
import android.support.v4.widget.CursorAdapter; import android.support.v4.widget.CursorAdapter;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.CompoundButton; import android.widget.CompoundButton;
import android.widget.TextView; import android.widget.TextView;
import org.fdroid.fdroid.R; import org.fdroid.fdroid.R;
import org.fdroid.fdroid.data.Repo; import org.fdroid.fdroid.data.Repo;
@ -24,11 +22,8 @@ public class RepoAdapter extends CursorAdapter {
private EnabledListener enabledListener; private EnabledListener enabledListener;
public static RepoAdapter create(Context context, Cursor cursor, int flags) { public static RepoAdapter create(Context context, Cursor cursor, int flags) {
if (Build.VERSION.SDK_INT >= 11) {
return new RepoAdapter(context, cursor, flags); return new RepoAdapter(context, cursor, flags);
} }
return new RepoAdapter(context, cursor);
}
private RepoAdapter(Context context, Cursor c, int flags) { private RepoAdapter(Context context, Cursor c, int flags) {
super(context, c, flags); super(context, c, flags);

View File

@ -223,9 +223,7 @@ public class RepoDetailsActivity extends AppCompatActivity {
@Override @Override
public boolean onPrepareOptionsMenu(Menu menu) { public boolean onPrepareOptionsMenu(Menu menu) {
if (Build.VERSION.SDK_INT >= 14) {
prepareNfcMenuItems(menu); prepareNfcMenuItems(menu);
}
return true; return true;
} }

View File

@ -3,7 +3,6 @@ package org.fdroid.fdroid.views;
import android.annotation.TargetApi; import android.annotation.TargetApi;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
@ -65,11 +64,9 @@ public class ScreenShotsActivity extends AppCompatActivity {
viewPager.setAdapter(adapter); viewPager.setAdapter(adapter);
viewPager.setCurrentItem(startPosition); viewPager.setCurrentItem(startPosition);
if (Build.VERSION.SDK_INT >= 11) {
// display some nice animation while swiping // display some nice animation while swiping
viewPager.setPageTransformer(true, new DepthPageTransformer()); viewPager.setPageTransformer(true, new DepthPageTransformer());
} }
}
@Override @Override
protected void onResume() { protected void onResume() {

View File

@ -1,7 +1,6 @@
package org.fdroid.fdroid.views.apps; package org.fdroid.fdroid.views.apps;
import android.animation.ValueAnimator; import android.animation.ValueAnimator;
import android.annotation.TargetApi;
import android.content.Context; import android.content.Context;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.Canvas; import android.graphics.Canvas;
@ -10,7 +9,6 @@ import android.graphics.Paint;
import android.graphics.Path; import android.graphics.Path;
import android.graphics.Point; import android.graphics.Point;
import android.graphics.PorterDuff; import android.graphics.PorterDuff;
import android.os.Build;
import android.support.annotation.ColorInt; import android.support.annotation.ColorInt;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
@ -20,12 +18,10 @@ import android.support.v7.widget.AppCompatImageView;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.View; import android.view.View;
import com.nostra13.universalimageloader.core.DisplayImageOptions; import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader; import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.assist.FailReason; import com.nostra13.universalimageloader.core.assist.FailReason;
import com.nostra13.universalimageloader.core.listener.ImageLoadingListener; import com.nostra13.universalimageloader.core.listener.ImageLoadingListener;
import org.fdroid.fdroid.R; import org.fdroid.fdroid.R;
import java.util.Random; import java.util.Random;
@ -34,7 +30,7 @@ import java.util.Random;
* A feature image can have a {@link android.graphics.drawable.Drawable} or a {@link Palette}. If * A feature image can have a {@link android.graphics.drawable.Drawable} or a {@link Palette}. If
* a Drawable is available, then it will draw that, otherwise it will attempt to fall back to the * a Drawable is available, then it will draw that, otherwise it will attempt to fall back to the
* Palette you gave it. If a Palette is given, it will draw a series of triangles like so: * Palette you gave it. If a Palette is given, it will draw a series of triangles like so:
* * <p>
* +_----+----_+_----+----_+ * +_----+----_+_----+----_+
* | \_ | _/ | \_ | _/ | * | \_ | _/ | \_ | _/ |
* | \_|_/ | \_|_/ | * | \_|_/ | \_|_/ |
@ -42,12 +38,12 @@ import java.util.Random;
* | \_ | _/ | \_ | _/ | * | \_ | _/ | \_ | _/ |
* | \_|_/ | \_|_/ | * | \_|_/ | \_|_/ |
* +-----+-----+-----+-----+ * +-----+-----+-----+-----+
* * <p>
* where each triangle is filled with one of two variations of the {@link Palette#getDominantColor(int)} * where each triangle is filled with one of two variations of the {@link Palette#getDominantColor(int)}
* that is chosen randomly. The randomness is first seeded with the colour that has been selected. * that is chosen randomly. The randomness is first seeded with the colour that has been selected.
* This is so that if this repaints itself in the future, it will have the same unique pattern rather * This is so that if this repaints itself in the future, it will have the same unique pattern rather
* than picking a new random pattern each time. * than picking a new random pattern each time.
* * <p>
* It is suggested that you obtain the Palette from the icon of an app. * It is suggested that you obtain the Palette from the icon of an app.
*/ */
@SuppressWarnings("LineLength") @SuppressWarnings("LineLength")
@ -143,12 +139,7 @@ public class FeatureImage extends AppCompatImageView {
private int currentAlpha = 255; private int currentAlpha = 255;
private ValueAnimator alphaAnimator = null; private ValueAnimator alphaAnimator = null;
@TargetApi(11)
private void animateColourChange() { private void animateColourChange() {
if (Build.VERSION.SDK_INT < 11) {
return;
}
if (alphaAnimator == null) { if (alphaAnimator == null) {
alphaAnimator = ValueAnimator.ofInt(0, 255); alphaAnimator = ValueAnimator.ofInt(0, 255);
} else { } else {
@ -294,12 +285,15 @@ public class FeatureImage extends AppCompatImageView {
private abstract static class ImageLoadingAdapter implements ImageLoadingListener { private abstract static class ImageLoadingAdapter implements ImageLoadingListener {
@Override @Override
public void onLoadingStarted(String imageUri, View view) { } public void onLoadingStarted(String imageUri, View view) {
}
@Override @Override
public void onLoadingFailed(String imageUri, View view, FailReason failReason) { } public void onLoadingFailed(String imageUri, View view, FailReason failReason) {
}
@Override @Override
public void onLoadingCancelled(String imageUri, View view) { } public void onLoadingCancelled(String imageUri, View view) {
}
} }
} }

View File

@ -28,7 +28,6 @@ import org.fdroid.fdroid.Preferences;
import org.fdroid.fdroid.R; import org.fdroid.fdroid.R;
import org.fdroid.fdroid.UpdateService; import org.fdroid.fdroid.UpdateService;
import org.fdroid.fdroid.Utils; import org.fdroid.fdroid.Utils;
import org.fdroid.fdroid.compat.UriCompat;
import org.fdroid.fdroid.data.NewRepoConfig; import org.fdroid.fdroid.data.NewRepoConfig;
import org.fdroid.fdroid.views.ManageReposActivity; import org.fdroid.fdroid.views.ManageReposActivity;
import org.fdroid.fdroid.views.apps.AppListActivity; import org.fdroid.fdroid.views.apps.AppListActivity;
@ -232,29 +231,29 @@ public class MainActivity extends AppCompatActivity implements BottomNavigationB
packageName = data.getLastPathSegment(); packageName = data.getLastPathSegment();
} else if (path.startsWith("/repository/browse")) { } else if (path.startsWith("/repository/browse")) {
// http://f-droid.org/repository/browse?fdfilter=search+query // http://f-droid.org/repository/browse?fdfilter=search+query
query = UriCompat.getQueryParameter(data, "fdfilter"); query = data.getQueryParameter("fdfilter");
// http://f-droid.org/repository/browse?fdid=packageName // http://f-droid.org/repository/browse?fdid=packageName
packageName = UriCompat.getQueryParameter(data, "fdid"); packageName = data.getQueryParameter("fdid");
} else if ("/app".equals(data.getPath()) || "/packages".equals(data.getPath())) { } else if ("/app".equals(data.getPath()) || "/packages".equals(data.getPath())) {
packageName = null; packageName = null;
} }
break; break;
case "details": case "details":
// market://details?id=app.id // market://details?id=app.id
packageName = UriCompat.getQueryParameter(data, "id"); packageName = data.getQueryParameter("id");
break; break;
case "search": case "search":
// market://search?q=query // market://search?q=query
query = UriCompat.getQueryParameter(data, "q"); query = data.getQueryParameter("q");
break; break;
case "play.google.com": case "play.google.com":
if (path.startsWith("/store/apps/details")) { if (path.startsWith("/store/apps/details")) {
// http://play.google.com/store/apps/details?id=app.id // http://play.google.com/store/apps/details?id=app.id
packageName = UriCompat.getQueryParameter(data, "id"); packageName = data.getQueryParameter("id");
} else if (path.startsWith("/store/search")) { } else if (path.startsWith("/store/search")) {
// http://play.google.com/store/search?q=foo // http://play.google.com/store/search?q=foo
query = UriCompat.getQueryParameter(data, "q"); query = data.getQueryParameter("q");
} }
break; break;
case "apps": case "apps":
@ -262,8 +261,8 @@ public class MainActivity extends AppCompatActivity implements BottomNavigationB
case "www.amazon.com": case "www.amazon.com":
// amzn://apps/android?p=app.id // amzn://apps/android?p=app.id
// http://amazon.com/gp/mas/dl/android?s=app.id // http://amazon.com/gp/mas/dl/android?s=app.id
packageName = UriCompat.getQueryParameter(data, "p"); packageName = data.getQueryParameter("p");
query = UriCompat.getQueryParameter(data, "s"); query = data.getQueryParameter("s");
break; break;
} }
} else if ("fdroid.app".equals(scheme)) { } else if ("fdroid.app".equals(scheme)) {

View File

@ -11,7 +11,6 @@ import android.content.res.Resources;
import android.graphics.PorterDuff; import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.net.Uri; import android.net.Uri;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.preference.CheckBoxPreference; import android.preference.CheckBoxPreference;
import android.preference.ListPreference; import android.preference.ListPreference;
@ -23,16 +22,14 @@ import android.support.v4.preference.PreferenceFragment;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.TypedValue; import android.util.TypedValue;
import info.guardianproject.panic.Panic;
import info.guardianproject.panic.PanicResponder;
import org.fdroid.fdroid.Preferences; import org.fdroid.fdroid.Preferences;
import org.fdroid.fdroid.R; import org.fdroid.fdroid.R;
import org.fdroid.fdroid.views.hiding.HidingManager; import org.fdroid.fdroid.views.hiding.HidingManager;
import java.util.ArrayList; import java.util.ArrayList;
import info.guardianproject.panic.Panic;
import info.guardianproject.panic.PanicResponder;
public class PanicPreferencesFragment extends PreferenceFragment implements SharedPreferences public class PanicPreferencesFragment extends PreferenceFragment implements SharedPreferences
.OnSharedPreferenceChangeListener { .OnSharedPreferenceChangeListener {
@ -148,7 +145,7 @@ public class PanicPreferencesFragment extends PreferenceFragment implements Shar
// no panic app set // no panic app set
prefApp.setValue(Panic.PACKAGE_NAME_NONE); prefApp.setValue(Panic.PACKAGE_NAME_NONE);
prefApp.setSummary(getString(R.string.panic_app_setting_summary)); prefApp.setSummary(getString(R.string.panic_app_setting_summary));
if (Build.VERSION.SDK_INT >= 11) {
prefApp.setIcon(null); // otherwise re-setting view resource doesn't work prefApp.setIcon(null); // otherwise re-setting view resource doesn't work
Drawable icon = ContextCompat.getDrawable(getContext(), R.drawable.ic_cancel); Drawable icon = ContextCompat.getDrawable(getContext(), R.drawable.ic_cancel);
TypedValue typedValue = new TypedValue(); TypedValue typedValue = new TypedValue();
@ -157,7 +154,7 @@ public class PanicPreferencesFragment extends PreferenceFragment implements Shar
@ColorInt int color = typedValue.data; @ColorInt int color = typedValue.data;
icon.setColorFilter(color, PorterDuff.Mode.SRC_IN); icon.setColorFilter(color, PorterDuff.Mode.SRC_IN);
prefApp.setIcon(icon); prefApp.setIcon(icon);
}
// disable destructive panic actions // disable destructive panic actions
prefHide.setEnabled(false); prefHide.setEnabled(false);
} else { } else {
@ -165,9 +162,7 @@ public class PanicPreferencesFragment extends PreferenceFragment implements Shar
try { try {
prefApp.setValue(packageName); prefApp.setValue(packageName);
prefApp.setSummary(pm.getApplicationLabel(pm.getApplicationInfo(packageName, 0))); prefApp.setSummary(pm.getApplicationLabel(pm.getApplicationInfo(packageName, 0)));
if (Build.VERSION.SDK_INT >= 11) {
prefApp.setIcon(pm.getApplicationIcon(packageName)); prefApp.setIcon(pm.getApplicationIcon(packageName));
}
prefHide.setEnabled(true); prefHide.setEnabled(true);
} catch (PackageManager.NameNotFoundException e) { } catch (PackageManager.NameNotFoundException e) {
// revert back to no app, just to be safe // revert back to no app, just to be safe

View File

@ -7,7 +7,6 @@ import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.graphics.LightingColorFilter; import android.graphics.LightingColorFilter;
import android.net.Uri; import android.net.Uri;
import android.os.Build;
import android.support.annotation.ColorRes; import android.support.annotation.ColorRes;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.v4.content.LocalBroadcastManager; import android.support.v4.content.LocalBroadcastManager;
@ -148,7 +147,6 @@ public class WifiQrView extends ScrollView implements SwapWorkflowActivity.Inner
qrUrlBuilder.append(sharingUri.getPath()); qrUrlBuilder.append(sharingUri.getPath());
boolean first = true; boolean first = true;
if (Build.VERSION.SDK_INT > 10) {
Set<String> names = sharingUri.getQueryParameterNames(); Set<String> names = sharingUri.getQueryParameterNames();
for (String name : names) { for (String name : names) {
if (!"ssid".equals(name)) { if (!"ssid".equals(name)) {
@ -163,7 +161,6 @@ public class WifiQrView extends ScrollView implements SwapWorkflowActivity.Inner
qrUrlBuilder.append(sharingUri.getQueryParameter(name).toUpperCase(Locale.ENGLISH)); qrUrlBuilder.append(sharingUri.getQueryParameter(name).toUpperCase(Locale.ENGLISH));
} }
} }
}
String qrUriString = qrUrlBuilder.toString(); String qrUriString = qrUrlBuilder.toString();
Utils.debugLog(TAG, "Encoded swap URI in QR Code: " + qrUriString); Utils.debugLog(TAG, "Encoded swap URI in QR Code: " + qrUriString);

View File

@ -4,7 +4,7 @@ import android.content.Context;
public abstract class CameraCharacteristicsChecker { public abstract class CameraCharacteristicsChecker {
public static CameraCharacteristicsChecker getInstance(final Context context) { public static CameraCharacteristicsChecker getInstance(final Context context) {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) { if (android.os.Build.VERSION.SDK_INT >= 21) {
return new CameraCharacteristicsMinApiLevel21(context); return new CameraCharacteristicsMinApiLevel21(context);
} else { } else {
return new CameraCharacteristicsMaxApiLevel20(); return new CameraCharacteristicsMaxApiLevel20();

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="SwapTheme.Wizard" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorButtonNormal">@color/swap_bright_blue</item>
<item name="android:actionBarStyle">@style/Widget.AppCompat.ActionBar.Solid</item>
<item name="android:actionButtonStyle">@style/SwapTheme.Wizard.ActionButton</item>
</style>
<style name="AlertDialogBaseThemeDark" parent="Theme.AppCompat.Dialog.Alert">
<item name="android:windowMinWidthMajor">@android:dimen/dialog_min_width_major</item>
<item name="android:windowMinWidthMinor">@android:dimen/dialog_min_width_minor</item>
<item name="android:actionOverflowButtonStyle">@style/ActionButtonOverflow</item>
</style>
<style name="AlertDialogBaseThemeLight" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="android:windowMinWidthMajor">@android:dimen/dialog_min_width_major</item>
<item name="android:windowMinWidthMinor">@android:dimen/dialog_min_width_minor</item>
<item name="android:actionOverflowButtonStyle">@style/ActionButtonOverflow</item>
</style>
<style name="AppDetailsLink" parent="AppDetailsLinkBase">
<item name="android:background">?android:attr/selectableItemBackground</item>
</style>
</resources>