Java 6 compat

This commit is contained in:
mar-v-in 2015-04-13 23:57:18 +02:00
parent bd1be63f6b
commit 7c48d43efc
13 changed files with 25 additions and 26 deletions

2
extern/GmsApi vendored

@ -1 +1 @@
Subproject commit 8928053170b6a819befa297f264e5ba7e2f9342b
Subproject commit deb757edfb0684f41ccc493b7c35a98878571a56

2
extern/UnifiedNlp vendored

@ -1 +1 @@
Subproject commit 114355071bfc42a4306556381c0d0040d9ae44ff
Subproject commit 9bd476a0498cf6f5ef0fb82108955751445c176a

View File

@ -35,19 +35,15 @@ repositories {
dependencies {
compile 'com.android.support:support-v4:22.0.0'
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'de.hdodenhof:circleimageview:1.2.1'
compile 'com.squareup.wire:wire-runtime:1.6.1'
compile project(':play-services-api')
compile project(':unifiednlp-base')
// vtm from ./libs
compile group: 'org.oscim', name: 'vtm-android', version: '0.6.0-SNAPSHOT', ext: 'aar'
compile group: 'org.oscim', name: 'vtm-themes', version: '0.6.0-SNAPSHOT'
compile group: 'org.oscim', name: 'vtm-extras', version: '0.6.0-SNAPSHOT'
compile group: 'org.oscim', name: 'vtm', version: '0.6.0-SNAPSHOT'
compile 'org.oscim:vtm-android:0.6.0-SNAPSHOT@aar'
compile 'org.oscim:vtm-themes:0.6.0-SNAPSHOT'
compile 'org.oscim:vtm-extras:0.6.0-SNAPSHOT'
compile 'org.oscim:vtm:0.6.0-SNAPSHOT'
// Dependencies for vtm
compile 'com.fasterxml.jackson.core:jackson-core:2.3.0'
compile 'com.vividsolutions:jts:1.13'
@ -65,6 +61,9 @@ android {
java.srcDirs += 'src/main/protos-java'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_6
}
}
if (file('user.gradle').exists()) {

View File

@ -40,11 +40,11 @@ public abstract class AbstractGmsServiceBroker extends IGmsServiceBroker.Stub {
private final Set<Integer> supportedServiceIds;
public AbstractGmsServiceBroker(Integer supportedServiceId, Integer... supportedServiceIds) {
this(new HashSet<>(combine(supportedServiceId, supportedServiceIds)));
this(combine(supportedServiceId, supportedServiceIds));
}
private static Set<Integer> combine(Integer i, Integer... is) {
Set<Integer> integers = new HashSet<>(Arrays.asList(is));
Set<Integer> integers = new HashSet<Integer>(Arrays.asList(is));
integers.add(i);
return integers;
}

View File

@ -42,7 +42,7 @@ public class CheckinManager {
LastCheckinInfo info = LastCheckinInfo.read(context);
if (!force && info.lastCheckin > System.currentTimeMillis() - MIN_CHECKIN_INTERVAL)
return null;
List<CheckinClient.Account> accounts = new ArrayList<>();
List<CheckinClient.Account> accounts = new ArrayList<CheckinClient.Account>();
AccountManager accountManager = AccountManager.get(context);
String accountType = context.getString(R.string.google_account_type);
for (Account account : accountManager.getAccountsByType(accountType)) {

View File

@ -66,21 +66,21 @@ public class DeviceConfiguration {
glEsVersion = configurationInfo.reqGlEsVersion;
PackageManager packageManager = context.getPackageManager();
sharedLibraries = Arrays.asList(packageManager.getSystemSharedLibraryNames());
availableFeatures = new ArrayList<>();
availableFeatures = new ArrayList<String>();
for (FeatureInfo featureInfo : packageManager.getSystemAvailableFeatures()) {
if (featureInfo.name != null) availableFeatures.add(featureInfo.name);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
nativePlatforms = Arrays.asList(Build.SUPPORTED_ABIS);
} else {
nativePlatforms = new ArrayList<>();
nativePlatforms = new ArrayList<String>();
nativePlatforms.add(Build.CPU_ABI);
if (Build.CPU_ABI2 != null) nativePlatforms.add(Build.CPU_ABI2);
}
widthPixels = displayMetrics.widthPixels;
heightPixels = displayMetrics.heightPixels;
locales = Arrays.asList(context.getAssets().getLocales());
glExtensions = new ArrayList<>();
glExtensions = new ArrayList<String>();
addEglExtensions(glExtensions);
}

View File

@ -75,7 +75,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
}
public Map<String, String> search(String search) {
Map<String, String> map = new HashMap<>();
Map<String, String> map = new HashMap<String, String>();
Cursor cursor = getReadableDatabase().query("overrides", new String[]{"name", "value"},
"name LIKE ?", new String[]{search}, null, null, null, null);
if (cursor != null) {

View File

@ -46,8 +46,8 @@ public class GServicesProvider extends ContentProvider {
private static final String TAG = "GmsServicesProvider";
private DatabaseHelper databaseHelper;
private Map<String, String> cache = new HashMap<>();
private Set<String> cachedPrefixes = new HashSet<>();
private Map<String, String> cache = new HashMap<String, String>();
private Set<String> cachedPrefixes = new HashSet<String>();
@Override
public boolean onCreate() {

View File

@ -40,7 +40,7 @@ public class GoogleLocationManager implements LocationChangeListener {
private RealLocationProvider gpsProvider;
private RealLocationProvider networkProvider;
private MockLocationProvider mockProvider;
private List<LocationRequestHelper> currentRequests = new ArrayList<>();
private List<LocationRequestHelper> currentRequests = new ArrayList<LocationRequestHelper>();
public GoogleLocationManager(Context context) {
this.context = context;

View File

@ -36,7 +36,7 @@ public class RealLocationProvider {
private final AtomicBoolean connected = new AtomicBoolean(false);
private long connectedMinTime;
private float connectedMinDistance;
private List<LocationRequestHelper> requests = new ArrayList<>();
private List<LocationRequestHelper> requests = new ArrayList<LocationRequestHelper>();
private final LocationChangeListener changeListener;
private LocationListener listener = new LocationListener() {
@Override

View File

@ -53,7 +53,7 @@ public class BackendMap implements ItemizedLayer.OnItemGestureListener<MarkerIte
private final OSciMap4TileSource tileSource;
private final TileCache cache;
private final ItemizedLayer<MarkerItem> items;
private java.util.Map<String, Markup> markupMap = new HashMap<>();
private java.util.Map<String, Markup> markupMap = new HashMap<String, Markup>();
private boolean redrawPosted = false;
public BackendMap(Context context) {
@ -68,7 +68,7 @@ public class BackendMap implements ItemizedLayer.OnItemGestureListener<MarkerIte
Layers layers = mapView.map().layers();
layers.add(buildings = new BuildingLayer(mapView.map(), baseLayer));
layers.add(new LabelLayer(mapView.map(), baseLayer));
layers.add(items = new ItemizedLayer<>(mapView.map(), new MarkerSymbol(new AndroidBitmap(BitmapFactory
layers.add(items = new ItemizedLayer<MarkerItem>(mapView.map(), new MarkerSymbol(new AndroidBitmap(BitmapFactory
.decodeResource(ResourcesContainer.get(), R.drawable.nop)), 0.5F, 1)));
items.setOnItemGestureListener(this);
mapView.map().setTheme(VtmThemes.DEFAULT);

View File

@ -30,7 +30,7 @@ import java.util.Set;
public class BitmapDescriptorImpl {
private BitmapDescriptor descriptor;
private boolean loadStarted = false;
private Set<Runnable> waitingForLoad = new HashSet<>();
private Set<Runnable> waitingForLoad = new HashSet<Runnable>();
public BitmapDescriptorImpl(IObjectWrapper remoteObject) {
this(new BitmapDescriptor(remoteObject));
@ -41,7 +41,7 @@ public class BitmapDescriptorImpl {
}
public BitmapDescriptorImpl() {
this(new ObjectWrapper<>(new DefaultBitmapDescriptor(0)));
this(new ObjectWrapper<DefaultBitmapDescriptor>(new DefaultBitmapDescriptor(0)));
}
public AbstractBitmapDescriptor getDescriptor() {

View File

@ -104,7 +104,7 @@ public class PeopleManager {
DatabaseHelper databaseHelper = new DatabaseHelper(context);
databaseHelper.putOwner(contentValues);
databaseHelper.close();
} catch (JSONException | IOException e) {
} catch (Exception e) {
Log.w(TAG, e);
}
}