diff --git a/.tx/config b/.tx/config deleted file mode 100644 index c1b8525..0000000 --- a/.tx/config +++ /dev/null @@ -1,9 +0,0 @@ -[main] -host = https://www.transifex.com -lang_map = he: iw, zh_TW: zh-rTW, es_MX: es-rMX, pt_BR: pt-rBR - -[unifiednlp.strings] -file_filter = unifiednlp-base/src/main/res/values-/strings.xml -source_file = unifiednlp-base/src/main/res/values/strings.xml -source_lang = en -type = ANDROID diff --git a/unifiednlp-app/build.gradle b/unifiednlp-app/build.gradle deleted file mode 100644 index f82a821..0000000 --- a/unifiednlp-app/build.gradle +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2013-2016 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -apply plugin: 'com.android.application' - -/* This is a hack, trying to provide release updates to F-Droid until it can properly handle Gradle -applicationId "org.microg.nlp" -applicationId "com.google.android.gms" -applicationId "com.google.android.location" -versionName "1.6.8" -versionCode "20187" - */ - -String getMyVersionName() { - def stdout = new ByteArrayOutputStream() - if (rootProject.file("gradlew").exists()) - exec { commandLine 'git', 'describe', '--tags', '--always', '--dirty'; standardOutput = stdout } - else // automatic build system, don't tag dirty - exec { commandLine 'git', 'describe', '--tags', '--always'; standardOutput = stdout } - return stdout.toString().trim().substring(1) -} - -int getMyVersionCode() { - def stdout = new ByteArrayOutputStream() - exec { - commandLine 'git', 'rev-list', '--count', "HEAD" - standardOutput = stdout - } - return Integer.parseInt(stdout.toString().trim()) -} - -android { - compileSdkVersion androidCompileSdk() - buildToolsVersion "$androidBuildVersionTools" - - defaultConfig { - versionName getMyVersionName() - versionCode(20000 + getMyVersionCode()) - minSdkVersion androidMinSdk() - targetSdkVersion androidTargetSdk() - } - - flavorDimensions 'tier' - - productFlavors { - NetworkLocation { - applicationId = 'com.google.android.gms' - minSdkVersion 19 - dimension 'tier' - } - LegacyNetworkLocation { - applicationId = 'com.google.android.location' - dimension 'tier' - } - UnifiedNlp { - applicationId = 'org.microg.nlp' - dimension 'tier' - } - } - - lintOptions { - disable 'MissingTranslation', 'InvalidPackage', 'BatteryLife', 'ImpliedQuantity', 'MissingQuantity' - } - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } -} - -dependencies { - implementation project(':unifiednlp-base') -} - -if (file('user.gradle').exists()) { - apply from: 'user.gradle' -} diff --git a/unifiednlp-app/src/main/AndroidManifest.xml b/unifiednlp-app/src/main/AndroidManifest.xml deleted file mode 100644 index 6da019f..0000000 --- a/unifiednlp-app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/unifiednlp-app/src/main/java/org/microg/nlp/ui/SettingsLauncherActivity.java b/unifiednlp-app/src/main/java/org/microg/nlp/ui/SettingsLauncherActivity.java deleted file mode 100644 index 2742a60..0000000 --- a/unifiednlp-app/src/main/java/org/microg/nlp/ui/SettingsLauncherActivity.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.nlp.ui; - -import android.app.Activity; -import android.content.ComponentName; -import android.content.Context; -import android.content.Intent; -import android.content.pm.PackageManager; -import android.os.Build; -import android.os.Bundle; - -import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED; -import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_ENABLED; -import static android.content.pm.PackageManager.DONT_KILL_APP; - -public class SettingsLauncherActivity extends Activity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - startActivity(new Intent(this, SettingsActivity.class)); - finish(); - } - - public static void setLauncherIconEnabled(Context context, boolean enabled) { - PackageManager pm = context.getPackageManager(); - pm.setComponentEnabledSetting(new ComponentName(context, SettingsLauncherActivity.class), - enabled ? COMPONENT_ENABLED_STATE_ENABLED : COMPONENT_ENABLED_STATE_DISABLED, - DONT_KILL_APP); - } - - public static void updateLauncherIcon(Context context) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { - if (SettingInjectorService.settingsInjectionPossible(context)) { - setLauncherIconEnabled(context, false); - } else { - setLauncherIconEnabled(context, true); - } - } - } -} diff --git a/unifiednlp-app/src/main/res/values/bools.xml b/unifiednlp-app/src/main/res/values/bools.xml deleted file mode 100644 index e630184..0000000 --- a/unifiednlp-app/src/main/res/values/bools.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - true - \ No newline at end of file diff --git a/unifiednlp-base/build.gradle b/unifiednlp-base/build.gradle deleted file mode 100644 index 88b6afb..0000000 --- a/unifiednlp-base/build.gradle +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2013-2016 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -apply plugin: 'com.android.library' - -String getMyVersionName() { - def stdout = new ByteArrayOutputStream() - if (rootProject.file("gradlew").exists()) - exec { commandLine 'git', 'describe', '--tags', '--always', '--dirty'; standardOutput = stdout } - else // automatic build system, don't tag dirty - exec { commandLine 'git', 'describe', '--tags', '--always'; standardOutput = stdout } - return stdout.toString().trim().substring(1) -} - -android { - compileSdkVersion androidCompileSdk() - buildToolsVersion "$androidBuildVersionTools" - - defaultConfig { - versionName getMyVersionName() - minSdkVersion androidMinSdk() - targetSdkVersion androidTargetSdk() - } - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - lintOptions { - // TODO: Remove MissingTranslation once we have stable strings and proper translations. - disable 'MissingTranslation' - } -} - -dependencies { - implementation project(":microg-ui-tools") - implementation project(':unifiednlp-api') - implementation "com.android.support:support-v4:$supportLibraryVersion" - implementation "com.android.support:appcompat-v7:$supportLibraryVersion" - implementation "com.takisoft.fix:preference-v7:$supportLibraryVersion.0" - compileOnly project(':unifiednlp-compat') -} diff --git a/unifiednlp-base/src/main/AndroidManifest.xml b/unifiednlp-base/src/main/AndroidManifest.xml deleted file mode 100644 index 1b2531d..0000000 --- a/unifiednlp-base/src/main/AndroidManifest.xml +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/unifiednlp-base/src/main/java/org/microg/nlp/AbstractBackendHelper.java b/unifiednlp-base/src/main/java/org/microg/nlp/AbstractBackendHelper.java deleted file mode 100644 index 39081cc..0000000 --- a/unifiednlp-base/src/main/java/org/microg/nlp/AbstractBackendHelper.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.nlp; - -import android.content.ComponentName; -import android.content.Context; -import android.content.Intent; -import android.content.ServiceConnection; -import android.os.IBinder; -import android.os.RemoteException; -import android.util.Log; - -public abstract class AbstractBackendHelper implements ServiceConnection { - private final Context context; - protected final Intent serviceIntent; - private boolean bound; - private final String TAG; - private final String signatureDigest; - - protected AbstractBackendHelper(String tag, Context context, Intent serviceIntent) { - this(tag, context, serviceIntent, null); - } - - protected AbstractBackendHelper(String tag, Context context, Intent serviceIntent, String signatureDigest) { - TAG = tag; - this.context = context; - this.serviceIntent = serviceIntent; - this.signatureDigest = signatureDigest; - } - - protected abstract void close() throws RemoteException; - - protected abstract boolean hasBackend(); - - @Override - public void onServiceConnected(ComponentName name, IBinder service) { - bound = true; - Log.d(TAG, "Bound to: " + name); - } - - @Override - public void onServiceDisconnected(ComponentName name) { - bound = false; - Log.d(TAG, "Unbound from: " + name); - } - - public void unbind() { - if (bound) { - Log.d(TAG, "Unbinding from: " + serviceIntent); - if (hasBackend()) { - try { - close(); - } catch (Exception e) { - Log.w(TAG, e); - } - } - try { - context.unbindService(this); - } catch (Exception e) { - Log.w(TAG, e); - } - bound = false; - } - } - - public void bind() { - if (!bound) { - Log.d(TAG, "Binding to: " + serviceIntent); - if (signatureDigest != null) { - if (serviceIntent.getPackage() == null) { - Log.w(TAG, "Intent is not properly resolved, can't verify signature. Aborting."); - return; - } - if (!signatureDigest.equals(Preferences.firstSignatureDigest(context, serviceIntent.getPackage()))) { - Log.w(TAG, "Target signature does not match selected package. Aborting."); - return; - } - } - try { - context.bindService(serviceIntent, this, Context.BIND_AUTO_CREATE); - } catch (Exception e) { - Log.w(TAG, e); - } - } - } - -} diff --git a/unifiednlp-base/src/main/java/org/microg/nlp/AbstractProviderService.java b/unifiednlp-base/src/main/java/org/microg/nlp/AbstractProviderService.java deleted file mode 100644 index 2245a75..0000000 --- a/unifiednlp-base/src/main/java/org/microg/nlp/AbstractProviderService.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.nlp; - -import android.app.IntentService; -import android.content.Intent; -import android.os.IBinder; - -public abstract class AbstractProviderService extends IntentService { - protected String TAG; - - /** - * Creates an ProviderService. Invoked by your subclass's constructor. - * - * @param tag Used for debugging. - */ - public AbstractProviderService(String tag) { - super(tag); - this.TAG = tag; - } - - @Override - public IBinder onBind(Intent intent) { - return getProvider().getBinder(); - } - - @Override - public boolean onUnbind(Intent intent) { - destroyProvider(); - return super.onUnbind(intent); - } - - /** - * Create a new {@link Provider} or return the existing one. - *

- * This might be called more than once, the implementation has to ensure that only one - * {@link Provider} is returned. - * - * @return a new or existing {@link Provider} instance - */ - protected abstract T getProvider(); - - /** - * Destroy the active {@link Provider}. - *

- * After this has been called, the {@link Provider} instance, that was active before should no - * longer be returned with {@link #getProvider()}. - */ - protected abstract void destroyProvider(); - - @Override - protected void onHandleIntent(Intent intent) { - // Default implementation is to do nothing - } -} diff --git a/unifiednlp-base/src/main/java/org/microg/nlp/PackageReceiver.java b/unifiednlp-base/src/main/java/org/microg/nlp/PackageReceiver.java deleted file mode 100644 index e0fefaa..0000000 --- a/unifiednlp-base/src/main/java/org/microg/nlp/PackageReceiver.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.nlp; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.util.Log; - -import org.microg.nlp.geocode.AbstractGeocodeService; -import org.microg.nlp.location.AbstractLocationService; - -public class PackageReceiver extends BroadcastReceiver { - private static final String TAG = "NlpPackageReceiver"; - - @Override - public void onReceive(Context context, Intent intent) { - Log.d(TAG, "Intent received: " + intent); - String packageName = intent.getData().getSchemeSpecificPart(); - Preferences preferences = new Preferences(context); - if (preferences.getLocationBackends().contains(packageName)) { - Log.d(TAG, "Reloading location service for " + packageName); - AbstractLocationService.reloadLocationService(context); - } - if (preferences.getGeocoderBackends().contains(packageName)) { - Log.d(TAG, "Reloading geocoding service for " + packageName); - AbstractGeocodeService.reloadGeocodeService(context); - } - } -} diff --git a/unifiednlp-base/src/main/java/org/microg/nlp/Preferences.java b/unifiednlp-base/src/main/java/org/microg/nlp/Preferences.java deleted file mode 100644 index 504c1de..0000000 --- a/unifiednlp-base/src/main/java/org/microg/nlp/Preferences.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.nlp; - -import android.content.Context; -import android.content.SharedPreferences; -import android.content.pm.PackageInfo; -import android.content.pm.PackageManager; -import android.content.pm.Signature; -import android.preference.PreferenceManager; -import android.provider.Settings; - -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; - -public class Preferences { - private static final String DEFAULT_LOCATION_BACKENDS = "default_location_backends"; - private static final String DEFAULT_GEOCODER_BACKENDS = "default_geocoder_backends"; - private final Context context; - - public Preferences(Context context) { - this.context = context; - } - - private SharedPreferences getSharedPreferences() { - return PreferenceManager.getDefaultSharedPreferences(context); - } - - public String getDefaultLocationBackends() { - String defBackends = Settings.Secure.getString(context.getContentResolver(), DEFAULT_LOCATION_BACKENDS); - return defBackends == null ? "" : defBackends; - } - - public String getLocationBackends() { - return getSharedPreferences().getString(context.getString(R.string.pref_location_backends), - getDefaultLocationBackends()); - } - - public String getDefaultGeocoderBackends() { - String defBackends = Settings.Secure.getString(context.getContentResolver(), DEFAULT_GEOCODER_BACKENDS); - return defBackends == null ? "" : defBackends; - } - - public String getGeocoderBackends() { - return getSharedPreferences().getString(context.getString(R.string.pref_geocoder_backends), - getDefaultGeocoderBackends()); - } - - public static String[] splitBackendString(String backendString) { - return backendString.split("\\|"); - } - - public static String firstSignatureDigest(Context context, String packageName) { - PackageManager packageManager = context.getPackageManager(); - final PackageInfo info; - try { - info = packageManager.getPackageInfo(packageName, PackageManager.GET_SIGNATURES); - } catch (PackageManager.NameNotFoundException e) { - return null; - } - if (info != null && info.signatures != null && info.signatures.length > 0) { - for (Signature sig : info.signatures) { - String digest = sha1sum(sig.toByteArray()); - if (digest != null) { - return digest; - } - } - } - return null; - } - - private static String sha1sum(byte[] bytes) { - MessageDigest md; - try { - md = MessageDigest.getInstance("SHA1"); - } catch (final NoSuchAlgorithmException e) { - return null; - } - if (md != null) { - bytes = md.digest(bytes); - if (bytes != null) { - StringBuilder sb = new StringBuilder(2 * bytes.length); - for (byte b : bytes) { - sb.append(String.format("%02x", b)); - } - return sb.toString(); - } - } - return null; - } -} diff --git a/unifiednlp-base/src/main/java/org/microg/nlp/Provider.java b/unifiednlp-base/src/main/java/org/microg/nlp/Provider.java deleted file mode 100644 index 50860e2..0000000 --- a/unifiednlp-base/src/main/java/org/microg/nlp/Provider.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.nlp; - -import android.os.IBinder; - -public interface Provider { - IBinder getBinder(); - - void reload(); - - void destroy(); -} diff --git a/unifiednlp-base/src/main/java/org/microg/nlp/geocode/AbstractGeocodeService.java b/unifiednlp-base/src/main/java/org/microg/nlp/geocode/AbstractGeocodeService.java deleted file mode 100644 index 55e5c62..0000000 --- a/unifiednlp-base/src/main/java/org/microg/nlp/geocode/AbstractGeocodeService.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.nlp.geocode; - -import android.content.Context; -import android.content.Intent; - -import org.microg.nlp.AbstractProviderService; - -import static org.microg.nlp.api.Constants.ACTION_RELOAD_SETTINGS; - -public abstract class AbstractGeocodeService extends AbstractProviderService { - public static void reloadGeocodeService(Context context) { - Intent intent = new Intent(ACTION_RELOAD_SETTINGS); - intent.setClass(context, GeocodeServiceV1.class); - context.startService(intent); - } - - /** - * Creates an GeocodeService. Invoked by your subclass's constructor. - * - * @param tag Used for debugging. - */ - public AbstractGeocodeService(String tag) { - super(tag); - } - - @Override - protected void onHandleIntent(Intent intent) { - if (ACTION_RELOAD_SETTINGS.equals(intent.getAction())) { - GeocodeProvider provider = getProvider(); - if (provider != null) { - provider.reload(); - } - } - } -} diff --git a/unifiednlp-base/src/main/java/org/microg/nlp/geocode/BackendFuser.java b/unifiednlp-base/src/main/java/org/microg/nlp/geocode/BackendFuser.java deleted file mode 100644 index 5cdb019..0000000 --- a/unifiednlp-base/src/main/java/org/microg/nlp/geocode/BackendFuser.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.nlp.geocode; - -import android.content.Context; -import android.content.Intent; -import android.location.Address; - -import org.microg.nlp.Preferences; - -import java.util.ArrayList; -import java.util.List; - -import static org.microg.nlp.api.Constants.ACTION_GEOCODER_BACKEND; - -class BackendFuser { - private final List backendHelpers = new ArrayList(); - private final Context context; - - public BackendFuser(Context context) { - this.context = context; - reset(); - } - - public void bind() { - for (BackendHelper backendHelper : backendHelpers) { - backendHelper.bind(); - } - } - - public void unbind() { - for (BackendHelper backendHelper : backendHelpers) { - backendHelper.unbind(); - } - } - - public List

getFromLocation(double latitude, double longitude, int maxResults, - String locale) { - if (backendHelpers.isEmpty()) - return null; - ArrayList
result = new ArrayList
(); - for (BackendHelper backendHelper : backendHelpers) { - List
backendResult = backendHelper - .getFromLocation(latitude, longitude, maxResults, locale); - if (backendResult != null) { - result.addAll(backendResult); - } - } - return result; - } - - public List
getFromLocationName(String locationName, int maxResults, - double lowerLeftLatitude, double lowerLeftLongitude, - double upperRightLatitude, double upperRightLongitude, - String locale) { - if (backendHelpers.isEmpty()) - return null; - ArrayList
result = new ArrayList
(); - for (BackendHelper backendHelper : backendHelpers) { - List
backendResult = backendHelper - .getFromLocationName(locationName, maxResults, lowerLeftLatitude, - lowerLeftLongitude, upperRightLatitude, upperRightLongitude, locale); - if (backendResult != null) { - result.addAll(backendResult); - } - } - return result; - } - - public void reset() { - unbind(); - backendHelpers.clear(); - for (String backend : Preferences - .splitBackendString(new Preferences(context).getGeocoderBackends())) { - String[] parts = backend.split("/"); - if (parts.length >= 2) { - Intent intent = new Intent(ACTION_GEOCODER_BACKEND); - intent.setPackage(parts[0]); - intent.setClassName(parts[0], parts[1]); - backendHelpers.add(new BackendHelper(context, intent, parts.length >= 3 ? parts[2] : null)); - } - } - } -} diff --git a/unifiednlp-base/src/main/java/org/microg/nlp/geocode/BackendHelper.java b/unifiednlp-base/src/main/java/org/microg/nlp/geocode/BackendHelper.java deleted file mode 100644 index 7366405..0000000 --- a/unifiednlp-base/src/main/java/org/microg/nlp/geocode/BackendHelper.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.nlp.geocode; - -import android.content.ComponentName; -import android.content.Context; -import android.content.Intent; -import android.location.Address; -import android.os.IBinder; -import android.os.RemoteException; -import android.util.Log; - -import org.microg.nlp.AbstractBackendHelper; -import org.microg.nlp.api.GeocoderBackend; - -import java.util.List; - -class BackendHelper extends AbstractBackendHelper { - private static final String TAG = "NlpGeoBackendHelper"; - private GeocoderBackend backend; - - public BackendHelper(Context context, Intent serviceIntent, String signatureDigest) { - super(TAG, context, serviceIntent, signatureDigest); - } - - public List
getFromLocation(double latitude, double longitude, int maxResults, - String locale) { - try { - return backend.getFromLocation(latitude, longitude, maxResults, locale); - } catch (Exception e) { - Log.w(TAG, e); - unbind(); - return null; - } - } - - public List
getFromLocationName(String locationName, int maxResults, - double lowerLeftLatitude, double lowerLeftLongitude, - double upperRightLatitude, double upperRightLongitude, - String locale) { - try { - return backend.getFromLocationName(locationName, maxResults, lowerLeftLatitude, - lowerLeftLongitude, upperRightLatitude, upperRightLongitude, locale); - } catch (Exception e) { - Log.w(TAG, e); - unbind(); - return null; - } - } - - @Override - public void onServiceConnected(ComponentName name, IBinder service) { - super.onServiceConnected(name, service); - backend = GeocoderBackend.Stub.asInterface(service); - if (backend != null) { - try { - backend.open(); - } catch (Exception e) { - Log.w(TAG, e); - unbind(); - } - } - } - - @Override - public void onServiceDisconnected(ComponentName name) { - super.onServiceDisconnected(name); - backend = null; - } - - @Override - public void close() throws RemoteException { - backend.close(); - } - - @Override - public boolean hasBackend() { - return backend != null; - } -} diff --git a/unifiednlp-base/src/main/java/org/microg/nlp/geocode/GeocodeProvider.java b/unifiednlp-base/src/main/java/org/microg/nlp/geocode/GeocodeProvider.java deleted file mode 100644 index 3dac25d..0000000 --- a/unifiednlp-base/src/main/java/org/microg/nlp/geocode/GeocodeProvider.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.nlp.geocode; - -import org.microg.nlp.Provider; - -interface GeocodeProvider extends Provider { -} diff --git a/unifiednlp-base/src/main/java/org/microg/nlp/geocode/GeocodeProviderV1.java b/unifiednlp-base/src/main/java/org/microg/nlp/geocode/GeocodeProviderV1.java deleted file mode 100644 index 86f3078..0000000 --- a/unifiednlp-base/src/main/java/org/microg/nlp/geocode/GeocodeProviderV1.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.nlp.geocode; - -import android.content.Context; -import android.location.Address; -import android.location.GeocoderParams; - -import com.android.location.provider.GeocodeProvider; - -import java.util.List; - -class GeocodeProviderV1 extends GeocodeProvider implements org.microg.nlp.geocode.GeocodeProvider { - private final BackendFuser backendFuser; - - public GeocodeProviderV1(Context context) { - backendFuser = new BackendFuser(context); - backendFuser.bind(); - } - - @Override - public String onGetFromLocation(double latitude, double longitude, int maxResults, - GeocoderParams params, List
addresses) { - List
fuserResult = backendFuser - .getFromLocation(latitude, longitude, maxResults, params.getLocale().toString()); - return handleResult(addresses, fuserResult); - } - - @Override - public String onGetFromLocationName(String locationName, double lowerLeftLatitude, - double lowerLeftLongitude, double upperRightLatitude, - double upperRightLongitude, int maxResults, - GeocoderParams params, List
addresses) { - List
fuserResult = backendFuser.getFromLocationName(locationName, maxResults, - lowerLeftLatitude, lowerLeftLongitude, upperRightLatitude, upperRightLongitude, - params.getLocale().toString()); - return handleResult(addresses, fuserResult); - } - - private String handleResult(List
realResult, List
fuserResult) { - if (fuserResult == null) { - return "no backend"; - } else if (fuserResult.isEmpty()) { - return "no result"; - } else { - realResult.addAll(fuserResult); - return null; - } - } - - @Override - public void reload() { - backendFuser.unbind(); - backendFuser.reset(); - backendFuser.bind(); - } - - @Override - public void destroy() { - backendFuser.unbind(); - } -} diff --git a/unifiednlp-base/src/main/java/org/microg/nlp/geocode/GeocodeServiceV1.java b/unifiednlp-base/src/main/java/org/microg/nlp/geocode/GeocodeServiceV1.java deleted file mode 100644 index edaa2c7..0000000 --- a/unifiednlp-base/src/main/java/org/microg/nlp/geocode/GeocodeServiceV1.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.nlp.geocode; - -public class GeocodeServiceV1 extends AbstractGeocodeService { - private static final String TAG = "NlpGeocodeService"; - private static GeocodeProviderV1 THE_ONE; - - public GeocodeServiceV1() { - super(TAG); - } - - @Override - protected synchronized GeocodeProvider getProvider() { - if (THE_ONE == null) { - THE_ONE = new GeocodeProviderV1(this); - } - return THE_ONE; - } - - @Override - protected void destroyProvider() { - THE_ONE.destroy(); - THE_ONE = null; - } -} diff --git a/unifiednlp-base/src/main/java/org/microg/nlp/location/AbstractLocationService.java b/unifiednlp-base/src/main/java/org/microg/nlp/location/AbstractLocationService.java deleted file mode 100644 index 4f9ba63..0000000 --- a/unifiednlp-base/src/main/java/org/microg/nlp/location/AbstractLocationService.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.nlp.location; - -import android.content.ComponentName; -import android.content.Context; -import android.content.Intent; -import android.content.pm.PackageManager; -import android.location.Location; -import android.os.IBinder; -import android.util.Log; - -import org.microg.nlp.AbstractProviderService; - -import java.lang.reflect.Method; - -import static android.os.Build.VERSION.SDK_INT; -import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR1; -import static org.microg.nlp.api.Constants.ACTION_FORCE_LOCATION; -import static org.microg.nlp.api.Constants.ACTION_RELOAD_SETTINGS; -import static org.microg.nlp.api.Constants.INTENT_EXTRA_LOCATION; -import static org.microg.nlp.api.Constants.PERMISSION_FORCE_LOCATION; - -public abstract class AbstractLocationService extends AbstractProviderService { - public static ComponentName reloadLocationService(Context context) { - Intent intent = new Intent(ACTION_RELOAD_SETTINGS); - setIntentTarget(context, intent); - return context.startService(intent); - } - - private static void setIntentTarget(Context context, Intent intent) { - if (SDK_INT >= JELLY_BEAN_MR1) { - intent.setClass(context, LocationServiceV2.class); - } else { - intent.setClass(context, LocationServiceV1.class); - } - } - - public static boolean WAS_BOUND = false; - - /** - * Creates an LocationService. Invoked by your subclass's constructor. - * - * @param tag Used for debugging. - */ - public AbstractLocationService(String tag) { - super(tag); - } - - @Override - public IBinder onBind(Intent intent) { - WAS_BOUND = true; - updateLauncherIcon(); - return super.onBind(intent); - } - - @Override - protected void onHandleIntent(Intent intent) { - LocationProvider provider = getProvider(); - - if (ACTION_RELOAD_SETTINGS.equals(intent.getAction())) { - if (provider != null) { - provider.reload(); - } else { - Log.d(TAG, "Cannot reload settings, provider not ready"); - } - } - - updateLauncherIcon(); - } - - @Override - public boolean onUnbind(Intent intent) { - LocationProvider provider = getProvider(); - if (provider != null) { - provider.onDisable(); - } - updateLauncherIcon(); - return super.onUnbind(intent); - } - - @SuppressWarnings("unchecked") - private void updateLauncherIcon() { - try { - Class cls = Class.forName("org.microg.nlp.ui.SettingsLauncherActivity"); - Method updateLauncherIcon = cls.getDeclaredMethod("updateLauncherIcon", Context.class); - updateLauncherIcon.invoke(null, this); - } catch (Exception ignored) { - // This package does not come with a settings launcher icon - } - } -} diff --git a/unifiednlp-base/src/main/java/org/microg/nlp/location/BackendFuser.java b/unifiednlp-base/src/main/java/org/microg/nlp/location/BackendFuser.java deleted file mode 100644 index 92342ee..0000000 --- a/unifiednlp-base/src/main/java/org/microg/nlp/location/BackendFuser.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.nlp.location; - -import android.content.Context; -import android.content.Intent; -import android.location.Location; -import android.location.LocationManager; -import android.util.Log; - -import org.microg.nlp.Preferences; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; - -import static org.microg.nlp.api.Constants.ACTION_LOCATION_BACKEND; -import static org.microg.nlp.api.Constants.LOCATION_EXTRA_OTHER_BACKENDS; - -class BackendFuser { - private static final String TAG = "NlpLocationBackendFuser"; - - private final List backendHelpers = new ArrayList(); - private final LocationProvider locationProvider; - private final Context context; - private boolean fusing = false; - private long lastLocationReportTime = 0; - - public BackendFuser(Context context, LocationProvider locationProvider) { - this.locationProvider = locationProvider; - this.context = context; - reset(); - } - - public void reset() { - unbind(); - backendHelpers.clear(); - lastLocationReportTime = 0; - for (String backend : Preferences - .splitBackendString(new Preferences(context).getLocationBackends())) { - String[] parts = backend.split("/"); - if (parts.length >= 2) { - Intent intent = new Intent(ACTION_LOCATION_BACKEND); - intent.setPackage(parts[0]); - intent.setClassName(parts[0], parts[1]); - backendHelpers.add(new BackendHelper(context, this, intent, parts.length >= 3 ? parts[2] : null)); - } - } - } - - public void unbind() { - for (BackendHelper handler : backendHelpers) { - handler.unbind(); - } - } - - public void bind() { - fusing = false; - for (BackendHelper handler : backendHelpers) { - handler.bind(); - } - } - - public void update() { - boolean hasUpdates = false; - fusing = true; - for (BackendHelper handler : backendHelpers) { - if (handler.update() != null) - hasUpdates = true; - } - fusing = false; - if (hasUpdates) - updateLocation(); - } - - void updateLocation() { - List locations = new ArrayList(); - for (BackendHelper handler : backendHelpers) { - locations.add(handler.getLastLocation()); - } - Location location = mergeLocations(locations); - if (location != null) { - location.setProvider(LocationManager.NETWORK_PROVIDER); - if (lastLocationReportTime < location.getTime()) { - lastLocationReportTime = location.getTime(); - locationProvider.reportLocation(location); - Log.v(TAG, "location=" + location); - } else { - Log.v(TAG, "Ignoring location update as it's older than other provider."); - } - } - } - - private Location mergeLocations(List locations) { - Collections.sort(locations, LocationComparator.INSTANCE); - if (locations.isEmpty() || locations.get(0) == null) - return null; - if (locations.size() == 1) - return locations.get(0); - Location location = new Location(locations.get(0)); - ArrayList backendResults = new ArrayList(); - for (Location backendResult : locations) { - if (locations.get(0) == backendResult) - continue; - if (backendResult != null) - backendResults.add(backendResult); - } - if (!backendResults.isEmpty()) { - location.getExtras().putParcelableArrayList(LOCATION_EXTRA_OTHER_BACKENDS, backendResults); - } - return location; - } - - public void reportLocation() { - if (fusing) - return; - updateLocation(); - } - - public void destroy() { - unbind(); - backendHelpers.clear(); - } - - public static class LocationComparator implements Comparator { - - public static final LocationComparator INSTANCE = new LocationComparator(); - public static final long SWITCH_ON_FRESHNESS_CLIFF_MS = 30000; // 30 seconds - - /** - * @return whether {@param lhs} is better than {@param rhs} - */ - @Override - public int compare(Location lhs, Location rhs) { - if (lhs == rhs) - return 0; - if (lhs == null) { - return 1; - } - if (rhs == null) { - return -1; - } - if (!lhs.hasAccuracy()) { - return 1; - } - if (!rhs.hasAccuracy()) { - return -1; - } - if (rhs.getTime() > lhs.getTime() + SWITCH_ON_FRESHNESS_CLIFF_MS) { - return 1; - } - if (lhs.getTime() > rhs.getTime() + SWITCH_ON_FRESHNESS_CLIFF_MS) { - return -1; - } - return (int) (lhs.getAccuracy() - rhs.getAccuracy()); - } - } -} diff --git a/unifiednlp-base/src/main/java/org/microg/nlp/location/BackendHelper.java b/unifiednlp-base/src/main/java/org/microg/nlp/location/BackendHelper.java deleted file mode 100644 index 86986e6..0000000 --- a/unifiednlp-base/src/main/java/org/microg/nlp/location/BackendHelper.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.nlp.location; - -import android.annotation.TargetApi; -import android.content.ComponentName; -import android.content.Context; -import android.content.Intent; -import android.location.Location; -import android.os.Build; -import android.os.Bundle; -import android.os.IBinder; -import android.os.RemoteException; -import android.os.SystemClock; -import android.util.Log; - -import com.android.location.provider.LocationProviderBase; - -import org.microg.nlp.AbstractBackendHelper; -import org.microg.nlp.api.LocationBackend; -import org.microg.nlp.api.LocationCallback; - -import static org.microg.nlp.api.Constants.LOCATION_EXTRA_BACKEND_COMPONENT; -import static org.microg.nlp.api.Constants.LOCATION_EXTRA_BACKEND_PROVIDER; - -class BackendHelper extends AbstractBackendHelper { - private static final String TAG = "NlpLocBackendHelper"; - private final BackendFuser backendFuser; - private final Callback callback = new Callback(); - private LocationBackend backend; - private boolean updateWaiting; - private Location lastLocation; - - public BackendHelper(Context context, BackendFuser backendFuser, Intent serviceIntent, String signatureDigest) { - super(TAG, context, serviceIntent, signatureDigest); - this.backendFuser = backendFuser; - } - - public Location getLastLocation() { - return lastLocation; - } - - /** - * Requests a location update from the backend. - * - * @return The location reported by the backend. This may be null if a backend cannot determine its - * location, or if it is going to return a location asynchronously. - */ - public Location update() { - Location result = null; - if (backend == null) { - Log.d(TAG, "Not (yet) bound."); - updateWaiting = true; - } else { - updateWaiting = false; - try { - result = backend.update(); - if (result != null && (lastLocation == null || result.getTime() > lastLocation.getTime())) { - setLastLocation(result); - backendFuser.reportLocation(); - } - } catch (Exception e) { - Log.w(TAG, e); - unbind(); - } - } - return result; - } - - private void setLastLocation(Location location) { - if (location == null || !location.hasAccuracy()) { - return; - } - if (location.getExtras() == null) { - location.setExtras(new Bundle()); - } - location.getExtras().putString(LOCATION_EXTRA_BACKEND_PROVIDER, location.getProvider()); - location.getExtras().putString(LOCATION_EXTRA_BACKEND_COMPONENT, - serviceIntent.getComponent().flattenToShortString()); - location.setProvider("network"); - if (!location.hasAccuracy()) { - location.setAccuracy(50000); - } - if (location.getTime() <= 0) { - location.setTime(System.currentTimeMillis()); - } - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { - updateElapsedRealtimeNanos(location); - } - Location noGpsLocation = new Location(location); - noGpsLocation.setExtras(null); - location.getExtras().putParcelable(LocationProviderBase.EXTRA_NO_GPS_LOCATION, noGpsLocation); - lastLocation = location; - } - - @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) - private void updateElapsedRealtimeNanos(Location location) { - if (location.getElapsedRealtimeNanos() <= 0) { - location.setElapsedRealtimeNanos(SystemClock.elapsedRealtimeNanos()); - } - } - - @Override - public void close() throws RemoteException { - backend.close(); - } - - @Override - public boolean hasBackend() { - return backend != null; - } - - @Override - public void onServiceConnected(ComponentName name, IBinder service) { - super.onServiceConnected(name, service); - backend = LocationBackend.Stub.asInterface(service); - if (backend != null) { - try { - backend.open(callback); - if (updateWaiting) { - update(); - } - } catch (Exception e) { - Log.w(TAG, e); - unbind(); - } - } - } - - @Override - public void onServiceDisconnected(ComponentName name) { - super.onServiceDisconnected(name); - backend = null; - } - - private class Callback extends LocationCallback.Stub { - @Override - public void report(Location location) throws RemoteException { - if ((location == null) || - (lastLocation != null && location.getTime() > 0 && location.getTime() <= lastLocation.getTime())) - return; - setLastLocation(location); - backendFuser.reportLocation(); - } - } -} diff --git a/unifiednlp-base/src/main/java/org/microg/nlp/location/LocationProvider.java b/unifiednlp-base/src/main/java/org/microg/nlp/location/LocationProvider.java deleted file mode 100644 index b575331..0000000 --- a/unifiednlp-base/src/main/java/org/microg/nlp/location/LocationProvider.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.nlp.location; - -import android.location.Location; - -import org.microg.nlp.Provider; - -interface LocationProvider extends Provider { - int FASTEST_REFRESH_INTERVAL = 2500; // in milliseconds - - void onEnable(); - - void onDisable(); - - void reportLocation(Location location); -} diff --git a/unifiednlp-base/src/main/java/org/microg/nlp/location/LocationProviderV1.java b/unifiednlp-base/src/main/java/org/microg/nlp/location/LocationProviderV1.java deleted file mode 100644 index 71cf987..0000000 --- a/unifiednlp-base/src/main/java/org/microg/nlp/location/LocationProviderV1.java +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.nlp.location; - -import android.content.Context; -import android.location.Criteria; -import android.location.Location; -import android.net.NetworkInfo; -import android.os.Bundle; -import android.os.WorkSource; -import android.util.Log; - -import static android.location.LocationProvider.AVAILABLE; - -public class LocationProviderV1 extends com.android.location.provider.LocationProvider - implements LocationProvider { - private static final String TAG = "NlpLocationProvider"; - - private final ThreadHelper helper; - private long autoTime = Long.MAX_VALUE; - private boolean autoUpdate = false; - - public LocationProviderV1(Context context) { - this.helper = new ThreadHelper(context, this); - } - - @Override - public void onDisable() { - Log.d(TAG, "onDisable"); - helper.disable(); - } - - @Override - public void reload() { - helper.reload(); - } - - @Override - public void onEnable() { - Log.d(TAG, "onEnable"); - } - - @Override - public boolean onRequiresNetwork() { - return false; - } - - @Override - public boolean onRequiresSatellite() { - return false; - } - - @Override - public boolean onRequiresCell() { - return false; - } - - @Override - public boolean onHasMonetaryCost() { - return false; - } - - @Override - public boolean onSupportsAltitude() { - return true; - } - - @Override - public boolean onSupportsSpeed() { - return true; - } - - @Override - public boolean onSupportsBearing() { - return true; - } - - @Override - public int onGetPowerRequirement() { - return Criteria.POWER_LOW; - } - - @Override - public boolean onMeetsCriteria(Criteria criteria) { - if (criteria.getAccuracy() == Criteria.ACCURACY_FINE) { - return false; - } - return true; - } - - @Override - public int onGetAccuracy() { - return Criteria.ACCURACY_COARSE; - } - - @Override - public int onGetStatus(Bundle extras) { - return AVAILABLE; - } - - @Override - public long onGetStatusUpdateTime() { - return 0; - } - - @Override - public String onGetInternalState() { - return null; - } - - @Override - public void onEnableLocationTracking(boolean enable) { - Log.v(TAG, "onEnableLocationTracking: " + enable); - autoUpdate = enable; - if (autoUpdate && autoTime != Long.MAX_VALUE) helper.enable(); - } - - @Override - public void onSetMinTime(long minTime, WorkSource ws) { - Log.v(TAG, "onSetMinTime: " + minTime + " by " + ws); - autoTime = Math.max(minTime, FASTEST_REFRESH_INTERVAL); - helper.setTime(autoTime); - if (autoUpdate) helper.enable(); - } - - @Override - public void onUpdateNetworkState(int state, NetworkInfo info) { - - } - - @Override - public void onUpdateLocation(Location location) { - - } - - @Override - public boolean onSendExtraCommand(String command, Bundle extras) { - return false; - } - - @Override - public void onAddListener(int uid, WorkSource ws) { - - } - - @Override - public void onRemoveListener(int uid, WorkSource ws) { - - } - - @Override - public void destroy() { - helper.destroy(); - } -} diff --git a/unifiednlp-base/src/main/java/org/microg/nlp/location/LocationProviderV2.java b/unifiednlp-base/src/main/java/org/microg/nlp/location/LocationProviderV2.java deleted file mode 100644 index 0575a8c..0000000 --- a/unifiednlp-base/src/main/java/org/microg/nlp/location/LocationProviderV2.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.nlp.location; - -import android.content.Context; -import android.location.Criteria; -import android.location.Location; -import android.os.Bundle; -import android.os.WorkSource; -import android.util.Log; - -import com.android.location.provider.LocationProviderBase; -import com.android.location.provider.ProviderPropertiesUnbundled; -import com.android.location.provider.ProviderRequestUnbundled; - -import static android.location.LocationProvider.AVAILABLE; - -class LocationProviderV2 extends LocationProviderBase implements LocationProvider { - private static final String TAG = "NlpLocationProvider"; - private static final ProviderPropertiesUnbundled props = ProviderPropertiesUnbundled.create( - false, // requiresNetwork - false, // requiresSatellite - false, // requiresCell - false, // hasMonetaryCost - true, // supportsAltitude - true, // supportsSpeed - true, // supportsBearing - Criteria.POWER_LOW, // powerRequirement - Criteria.ACCURACY_COARSE); // accuracy - private final ThreadHelper helper; - - public LocationProviderV2(Context context) { - super(TAG, props); - this.helper = new ThreadHelper(context, this); - } - - @Override - public void onDisable() { - Log.d(TAG, "onDisable"); - helper.disable(); - } - - @Override - public void reload() { - helper.reload(); - } - - @Override - public void destroy() { - helper.destroy(); - } - - @Override - public void onEnable() { - Log.d(TAG, "onEnable"); - } - - @Override - public int onGetStatus(Bundle extras) { - return AVAILABLE; - } - - @Override - public long onGetStatusUpdateTime() { - return 0; - } - - @Override - public void onSetRequest(ProviderRequestUnbundled requests, WorkSource source) { - Log.v(TAG, "onSetRequest: " + requests + " by " + source); - - long autoTime = Math.max(requests.getInterval(), FASTEST_REFRESH_INTERVAL); - boolean autoUpdate = requests.getReportLocation(); - - Log.v(TAG, "using autoUpdate=" + autoUpdate + " autoTime=" + autoTime); - - if (autoUpdate) { - helper.setTime(autoTime); - helper.enable(); - } else { - helper.disable(); - } - } - -} diff --git a/unifiednlp-base/src/main/java/org/microg/nlp/location/LocationServiceV1.java b/unifiednlp-base/src/main/java/org/microg/nlp/location/LocationServiceV1.java deleted file mode 100644 index 41d28fc..0000000 --- a/unifiednlp-base/src/main/java/org/microg/nlp/location/LocationServiceV1.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.nlp.location; - -public class LocationServiceV1 extends AbstractLocationService { - private static LocationProviderV1 THE_ONE; - - public LocationServiceV1() { - super("NlpLocationServiceV1"); - } - - @Override - protected synchronized LocationProvider getProvider() { - if (THE_ONE == null) { - THE_ONE = new LocationProviderV1(this); - } - return THE_ONE; - } - - @Override - protected void destroyProvider() { - THE_ONE.destroy(); - THE_ONE = null; - } -} diff --git a/unifiednlp-base/src/main/java/org/microg/nlp/location/LocationServiceV2.java b/unifiednlp-base/src/main/java/org/microg/nlp/location/LocationServiceV2.java deleted file mode 100644 index fcca9af..0000000 --- a/unifiednlp-base/src/main/java/org/microg/nlp/location/LocationServiceV2.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.nlp.location; - -public class LocationServiceV2 extends AbstractLocationService { - private static LocationProviderV2 THE_ONE; - - public LocationServiceV2() { - super("NlpLocationServiceV2"); - } - - @Override - protected synchronized LocationProvider getProvider() { - if (THE_ONE == null) { - THE_ONE = new LocationProviderV2(this); - } - return THE_ONE; - } - - @Override - protected void destroyProvider() { - THE_ONE.destroy(); - THE_ONE = null; - } -} diff --git a/unifiednlp-base/src/main/java/org/microg/nlp/location/ThreadHelper.java b/unifiednlp-base/src/main/java/org/microg/nlp/location/ThreadHelper.java deleted file mode 100644 index 28e66db..0000000 --- a/unifiednlp-base/src/main/java/org/microg/nlp/location/ThreadHelper.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.nlp.location; - -import android.content.Context; -import android.location.Location; - -import java.util.concurrent.ScheduledThreadPoolExecutor; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; - -class ThreadHelper implements Runnable { - private final BackendFuser backendFuser; - private ScheduledThreadPoolExecutor executor; - private long time = 60000; // Initialize with 60s - private final AtomicBoolean enabled = new AtomicBoolean(false); - - public ThreadHelper(Context context, LocationProvider locationProvider) { - backendFuser = new BackendFuser(context, locationProvider); - } - - public void reload() { - disable(); - backendFuser.reset(); - enable(); - } - - public void disable() { - if (executor != null) { - executor.shutdownNow(); - executor = null; - } - backendFuser.unbind(); - enabled.set(false); - } - - public void setTime(long time) { - this.time = time; - } - - void reset() { - if (executor != null) { - executor.shutdownNow(); - executor = null; - } - executor = new ScheduledThreadPoolExecutor(1); - executor.scheduleAtFixedRate(this, 0, time, TimeUnit.MILLISECONDS); - } - - public void enable() { - if (enabled.compareAndSet(false, true)) { - backendFuser.bind(); - } - reset(); - } - - @Override - public void run() { - backendFuser.update(); - } - - public void destroy() { - if (executor != null) { - executor.shutdownNow(); - } - backendFuser.destroy(); - } -} diff --git a/unifiednlp-base/src/main/java/org/microg/nlp/ui/AbstractBackendPreference.java b/unifiednlp-base/src/main/java/org/microg/nlp/ui/AbstractBackendPreference.java deleted file mode 100644 index 047b9ce..0000000 --- a/unifiednlp-base/src/main/java/org/microg/nlp/ui/AbstractBackendPreference.java +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.nlp.ui; - -import android.content.ComponentName; -import android.content.Context; -import android.content.Intent; -import android.content.ServiceConnection; -import android.content.pm.PackageManager; -import android.content.pm.ResolveInfo; -import android.content.pm.ServiceInfo; -import android.os.IBinder; -import android.util.AttributeSet; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.ArrayAdapter; -import android.widget.CheckBox; -import android.widget.ListView; -import android.widget.TextView; -import android.widget.Toast; - -import org.microg.nlp.Preferences; -import org.microg.nlp.R; -import org.microg.tools.ui.DialogPreference; - -import java.util.ArrayList; -import java.util.List; - -import static android.content.Context.BIND_AUTO_CREATE; -import static android.content.Intent.ACTION_VIEW; -import static org.microg.nlp.api.Constants.METADATA_BACKEND_ABOUT_ACTIVITY; -import static org.microg.nlp.api.Constants.METADATA_BACKEND_INIT_ACTIVITY; -import static org.microg.nlp.api.Constants.METADATA_BACKEND_SETTINGS_ACTIVITY; -import static org.microg.nlp.api.Constants.METADATA_BACKEND_SUMMARY; - -abstract class AbstractBackendPreference extends DialogPreference { - private ListView listView; - private final Adapter adapter; - private List knownBackends; - - AbstractBackendPreference(Context context, AttributeSet attrs) { - super(context, attrs); - - setPositiveButtonText(android.R.string.ok); - setNegativeButtonText(android.R.string.cancel); - - setDialogIcon(null); - - adapter = new Adapter(); - } - - @Override - protected View onCreateDialogView() { - listView = new ListView(getContext()); - updateBackends(); - return listView; - } - - private void updateBackends() { - knownBackends = queryKnownBackends(); - markBackendsAsEnabled(); - resetAdapter(); - } - - List queryKnownBackends() { - return intentToKnownBackends(buildBackendIntent()); - } - - private void resetAdapter() { - adapter.clear(); - for (BackendInfo backend : knownBackends) { - adapter.add(backend); - } - listView.setAdapter(adapter); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - for (BackendInfo backend : knownBackends) { - if (backend.enabled) { - if (sb.length() != 0) { - sb.append("|"); - } - sb.append(backend.toSettingsString()); - } - } - return sb.toString(); - } - - void markBackendsAsEnabled() { - for (String backend : Preferences.splitBackendString(getPersistedString(defaultValue()))) { - String[] parts = backend.split("/"); - if (parts.length >= 2) { - for (BackendInfo backendInfo : knownBackends) { - ServiceInfo serviceInfo = backendInfo.serviceInfo; - if (serviceInfo.packageName.equals(parts[0]) && serviceInfo.name.equals(parts[1])) { - if (parts.length == 2 || parts[2].equals(backendInfo.signatureDigest)) { - backendInfo.enabled = true; - } - } - } - } - } - } - - List intentToKnownBackends(Intent intent) { - List knownBackends = new ArrayList(); - List resolveInfos = getContext().getPackageManager() - .queryIntentServices(intent, PackageManager.GET_META_DATA); - for (ResolveInfo info : resolveInfos) { - ServiceInfo serviceInfo = info.serviceInfo; - String simpleName = String.valueOf(serviceInfo.loadLabel(getContext().getPackageManager())); - String signatureDigest = Preferences.firstSignatureDigest(getContext(), serviceInfo.packageName); - knownBackends.add(new BackendInfo(serviceInfo, simpleName, signatureDigest)); - } - return knownBackends; - } - - private Intent createExternalIntent(BackendInfo backendInfo, String metaName) { - Intent intent = new Intent(ACTION_VIEW); - intent.setPackage(backendInfo.serviceInfo.packageName); - intent.setClassName(backendInfo.serviceInfo.packageName, backendInfo.getMeta(metaName)); - return intent; - } - - private class Adapter extends ArrayAdapter { - - public Adapter() { - super(AbstractBackendPreference.this.getContext(), R.layout.backend_list_entry); - } - - @Override - public View getView(int position, View convertView, ViewGroup parent) { - View v; - if (convertView != null) { - v = convertView; - } else { - v = ((LayoutInflater) getContext().getSystemService( - Context.LAYOUT_INFLATER_SERVICE)).inflate( - R.layout.backend_list_entry, parent, false); - } - final BackendInfo backend = getItem(position); - TextView title = (TextView) v.findViewById(android.R.id.text1); - title.setText(backend.simpleName); - TextView subtitle = (TextView) v.findViewById(android.R.id.text2); - if (backend.getMeta(METADATA_BACKEND_SUMMARY) != null) { - subtitle.setText(backend.serviceInfo.metaData.getString(METADATA_BACKEND_SUMMARY)); - subtitle.setVisibility(View.VISIBLE); - } else { - subtitle.setVisibility(View.GONE); - } - final CheckBox checkbox = (CheckBox) v.findViewById(R.id.enabled); - if (checkbox.isChecked() != backend.enabled) { - checkbox.toggle(); - } - checkbox.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - backend.enabled = checkbox.isChecked(); - if (backend.enabled) enableBackend(backend); - } - }); - configureExternalButton(backend, v.findViewById(android.R.id.button1), - METADATA_BACKEND_SETTINGS_ACTIVITY); - configureExternalButton(backend, v.findViewById(android.R.id.button2), - METADATA_BACKEND_ABOUT_ACTIVITY); - return v; - } - - private void configureExternalButton(final BackendInfo backend, View button, - final String metaName) { - if (backend.getMeta(metaName) != null) { - button.setVisibility(View.VISIBLE); - button.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - getContext().startActivity(createExternalIntent(backend, metaName)); - } - }); - } else { - button.setVisibility(View.GONE); - } - } - } - - protected void enableBackend(BackendInfo backendInfo) { - try { - if (backendInfo.getMeta(METADATA_BACKEND_INIT_ACTIVITY) != null) { - getContext().startActivity(createExternalIntent(backendInfo, METADATA_BACKEND_INIT_ACTIVITY)); - } else { - Intent intent = buildBackendIntent(); - intent.setPackage(backendInfo.serviceInfo.packageName); - intent.setClassName(backendInfo.serviceInfo.packageName, backendInfo.serviceInfo.name); - getContext().bindService(intent, new ServiceConnection() { - @Override - public void onServiceConnected(ComponentName name, IBinder service) { - Intent i = getBackendInitIntent(service); - if (i != null) { - getContext().startActivity(i); - } - getContext().unbindService(this); - } - - @Override - public void onServiceDisconnected(ComponentName name) { - - } - }, BIND_AUTO_CREATE); - } - } catch (Exception e) { - backendInfo.enabled = false; - Toast.makeText(getContext(), "Error initializing backend", Toast.LENGTH_SHORT).show(); - resetAdapter(); - } - } - - @Override - protected void onDialogClosed(boolean positiveResult) { - if (positiveResult) { - persistString(toString()); - onValueChanged(); - } - } - - protected abstract void onValueChanged(); - - protected abstract Intent buildBackendIntent(); - - protected abstract String defaultValue(); - - protected abstract Intent getBackendInitIntent(IBinder service); - - private class BackendInfo { - private final ServiceInfo serviceInfo; - private final String simpleName; - private final String signatureDigest; - private boolean enabled = false; - - public BackendInfo(ServiceInfo serviceInfo, String simpleName, String signatureDigest) { - this.serviceInfo = serviceInfo; - this.simpleName = simpleName; - this.signatureDigest = signatureDigest; - } - - public String getMeta(String metaName) { - return serviceInfo.metaData != null ? serviceInfo.metaData.getString(metaName) : null; - } - - @Override - public String toString() { - return simpleName; - } - - public String toSettingsString() { - return serviceInfo.packageName + "/" + serviceInfo.name + "/" + signatureDigest; - } - } -} diff --git a/unifiednlp-base/src/main/java/org/microg/nlp/ui/GeocoderBackendPreference.java b/unifiednlp-base/src/main/java/org/microg/nlp/ui/GeocoderBackendPreference.java deleted file mode 100644 index 4fa63c1..0000000 --- a/unifiednlp-base/src/main/java/org/microg/nlp/ui/GeocoderBackendPreference.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.nlp.ui; - -import android.content.Context; -import android.content.Intent; -import android.os.IBinder; -import android.os.RemoteException; -import android.util.AttributeSet; - -import org.microg.nlp.Preferences; -import org.microg.nlp.R; -import org.microg.nlp.api.GeocoderBackend; -import org.microg.nlp.geocode.AbstractGeocodeService; - -import static org.microg.nlp.api.Constants.ACTION_GEOCODER_BACKEND; - -public class GeocoderBackendPreference extends AbstractBackendPreference { - public GeocoderBackendPreference(Context context, AttributeSet attrs) { - super(context, attrs); - setDialogTitle(R.string.configure_geocoder_backends); - setTitle(R.string.configure_geocoder_backends); - } - - @Override - protected void onValueChanged() { - AbstractGeocodeService.reloadGeocodeService(getContext()); - } - - @Override - protected Intent buildBackendIntent() { - return new Intent(ACTION_GEOCODER_BACKEND); - } - - @Override - protected String defaultValue() { - return new Preferences(getContext()).getDefaultGeocoderBackends(); - } - - @Override - protected Intent getBackendInitIntent(IBinder service) { - GeocoderBackend backend = GeocoderBackend.Stub.asInterface(service); - try { - return backend.getInitIntent(); - } catch (RemoteException e) { - return null; - } - } -} diff --git a/unifiednlp-base/src/main/java/org/microg/nlp/ui/LocationBackendPreference.java b/unifiednlp-base/src/main/java/org/microg/nlp/ui/LocationBackendPreference.java deleted file mode 100644 index 0546563..0000000 --- a/unifiednlp-base/src/main/java/org/microg/nlp/ui/LocationBackendPreference.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.nlp.ui; - -import android.content.Context; -import android.content.Intent; -import android.os.IBinder; -import android.os.RemoteException; -import android.util.AttributeSet; - -import org.microg.nlp.Preferences; -import org.microg.nlp.R; -import org.microg.nlp.api.GeocoderBackend; -import org.microg.nlp.api.LocationBackend; -import org.microg.nlp.location.AbstractLocationService; - -import static org.microg.nlp.api.Constants.ACTION_LOCATION_BACKEND; - -public class LocationBackendPreference extends AbstractBackendPreference { - public LocationBackendPreference(Context context, AttributeSet attrs) { - super(context, attrs); - setDialogTitle(R.string.configure_location_backends); - setTitle(R.string.configure_location_backends); - } - - @Override - protected void onValueChanged() { - AbstractLocationService.reloadLocationService(getContext()); - } - - @Override - protected Intent buildBackendIntent() { - return new Intent(ACTION_LOCATION_BACKEND); - } - - @Override - protected String defaultValue() { - return new Preferences(getContext()).getDefaultLocationBackends(); - } - - @Override - protected Intent getBackendInitIntent(IBinder service) { - LocationBackend backend = LocationBackend.Stub.asInterface(service); - try { - return backend.getInitIntent(); - } catch (RemoteException e) { - return null; - } - } -} diff --git a/unifiednlp-base/src/main/java/org/microg/nlp/ui/SettingInjectorService.java b/unifiednlp-base/src/main/java/org/microg/nlp/ui/SettingInjectorService.java deleted file mode 100644 index 3a50ba1..0000000 --- a/unifiednlp-base/src/main/java/org/microg/nlp/ui/SettingInjectorService.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.nlp.ui; - -import android.annotation.TargetApi; -import android.content.ComponentName; -import android.content.Context; -import android.content.Intent; -import android.content.pm.PackageManager; -import android.content.pm.ResolveInfo; -import android.os.Build; -import android.os.UserHandle; -import android.util.Log; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.List; - -import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED; -import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_ENABLED; -import static android.content.pm.PackageManager.DONT_KILL_APP; -import static android.content.pm.PackageManager.GET_META_DATA; - -@TargetApi(Build.VERSION_CODES.KITKAT) -public class SettingInjectorService extends android.location.SettingInjectorService { - private static final String TAG = "NlpSettingInjector"; - - public SettingInjectorService() { - super(TAG); - } - - @Override - @SuppressWarnings("deprecation") - protected String onGetSummary() { - return ""; - } - - @Override - protected boolean onGetEnabled() { - return true; - } - - /** - * Dirty method to check whether settings injection is possible on the currently used system - */ - @SuppressWarnings("unchecked") - public static boolean settingsInjectionPossible(Context context) { - try { - Context settingsContext = context.createPackageContext("com.android.settings", CONTEXT_INCLUDE_CODE); - ClassLoader cl = settingsContext.getClassLoader(); - Class cls = cl.loadClass("com.android.settings.location.SettingsInjector"); - int pSiVersion; - Method pSi; - try { - pSi = cls.getDeclaredMethod("parseServiceInfo", ResolveInfo.class, PackageManager.class); - pSiVersion = 1; - } catch (NoSuchMethodException e) { - pSi = cls.getDeclaredMethod("parseServiceInfo", ResolveInfo.class, UserHandle.class, PackageManager.class); - pSiVersion = 2; - } - pSi.setAccessible(true); - PackageManager pm = context.getPackageManager(); - Intent intent = new Intent(context, SettingInjectorService.class); - List ris = pm.queryIntentServices(intent, GET_META_DATA); - ResolveInfo ri = ris.get(0); - Object result = null; - if (pSiVersion == 1) { - result = pSi.invoke(null, ri, pm); - } else if (pSiVersion == 2) { - result = pSi.invoke(null, ri, android.os.Process.myUserHandle(), pm); - } - if (result != null) { - Log.d(TAG, "Setting injection possible!"); - return true; - } - } catch (InvocationTargetException e) { - Log.d(TAG, "settings injection not possible: " + e.getMessage()); - } catch (Exception e) { - Log.w(TAG, "Can't determine if settings injection is possible", e); - } - return false; - } -} diff --git a/unifiednlp-base/src/main/java/org/microg/nlp/ui/SettingsActivity.java b/unifiednlp-base/src/main/java/org/microg/nlp/ui/SettingsActivity.java deleted file mode 100644 index 88df2cb..0000000 --- a/unifiednlp-base/src/main/java/org/microg/nlp/ui/SettingsActivity.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.nlp.ui; - -import android.content.Context; -import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v4.app.FragmentTransaction; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.preference.Preference; -import android.support.v7.widget.Toolbar; - -import org.microg.nlp.BuildConfig; -import org.microg.nlp.R; -import org.microg.tools.selfcheck.NlpOsCompatChecks; -import org.microg.tools.selfcheck.NlpStatusChecks; -import org.microg.tools.selfcheck.PermissionCheckGroup; -import org.microg.tools.selfcheck.SelfCheckGroup; -import org.microg.tools.ui.AbstractAboutFragment; -import org.microg.tools.ui.AbstractSelfCheckFragment; -import org.microg.tools.ui.AbstractSettingsFragment; - -import java.util.List; - -import static android.Manifest.permission.ACCESS_COARSE_LOCATION; -import static android.os.Build.VERSION.SDK_INT; -import static android.os.Build.VERSION_CODES.LOLLIPOP_MR1; - -public class SettingsActivity extends AppCompatActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.settings_activity); - setSupportActionBar((Toolbar) findViewById(R.id.toolbar)); - getSupportFragmentManager().beginTransaction() - .replace(R.id.content_wrapper, new MyPreferenceFragment()).commit(); - } - - private static boolean isUnifiedNlpAppRelease(Context context) { - int resId = context.getResources().getIdentifier("is_unifiednlp_app", "bool", context.getPackageName()); - return resId != 0 && context.getResources().getBoolean(resId); - } - - public static class MyPreferenceFragment extends AbstractSettingsFragment { - @Override - public void onCreatePreferencesFix(@Nullable Bundle savedInstanceState, String rootKey) { - if (isUnifiedNlpAppRelease(getContext())) { - addPreferencesFromResource(R.xml.nlp_setup_preferences); - - findPreference(getString(R.string.self_check_title)) - .setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { - @Override - public boolean onPreferenceClick(Preference preference) { - getFragmentManager().beginTransaction() - .addToBackStack("root") - .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN) - .replace(R.id.content_wrapper, new MySelfCheckFragment()) - .commit(); - return true; - } - }); - } - addPreferencesFromResource(R.xml.nlp_preferences); - if (isUnifiedNlpAppRelease(getContext())) { - addPreferencesFromResource(R.xml.nlp_about_preferences); - - findPreference(getString(R.string.pref_about_title)) - .setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { - @Override - public boolean onPreferenceClick(Preference preference) { - getFragmentManager().beginTransaction() - .addToBackStack("root") - .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN) - .replace(R.id.content_wrapper, new MyAboutFragment()) - .commit(); - return true; - } - }); - } - } - } - - public static class MySelfCheckFragment extends AbstractSelfCheckFragment { - - @Override - protected void prepareSelfCheckList(List checks) { - if (SDK_INT > LOLLIPOP_MR1) { - checks.add(new PermissionCheckGroup(ACCESS_COARSE_LOCATION)); - } - checks.add(new NlpOsCompatChecks()); - checks.add(new NlpStatusChecks()); - } - } - - public static class MyAboutFragment extends AbstractAboutFragment { - - @Override - protected String getSummary() { - String packageName = getContext().getPackageName(); - if (packageName.equals("com.google.android.gms")) { - return getString(R.string.nlp_version_default); - } else if (packageName.equals("com.google.android.location")) { - return getString(R.string.nlp_version_legacy); - } else if (packageName.equals("org.microg.nlp")) { - return getString(R.string.nlp_version_custom); - } - return null; - } - - @Override - protected String getSelfVersion() { - return BuildConfig.VERSION_NAME; - } - - @Override - protected void collectLibraries(List libraries) { - libraries.add(new Library("org.microg.nlp.api", "microG UnifiedNlp Api", "Apache License 2.0 by microG Team")); - } - } -} diff --git a/unifiednlp-base/src/main/java/org/microg/tools/selfcheck/NlpOsCompatChecks.java b/unifiednlp-base/src/main/java/org/microg/tools/selfcheck/NlpOsCompatChecks.java deleted file mode 100644 index acb0edd..0000000 --- a/unifiednlp-base/src/main/java/org/microg/tools/selfcheck/NlpOsCompatChecks.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.tools.selfcheck; - -import android.content.Context; - -import org.microg.nlp.R; - -import java.util.Arrays; - -import static android.os.Build.VERSION.SDK_INT; -import static android.os.Build.VERSION_CODES.JELLY_BEAN; -import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR1; -import static android.os.Build.VERSION_CODES.KITKAT; -import static android.os.Build.VERSION_CODES.M; - -public class NlpOsCompatChecks implements SelfCheckGroup { - - public static final String CONFIG_NL_PROVIDER = "config_networkLocationProvider"; - public static final String CONFIG_NL_PROVIDER_PACKAGE_NAME = "config_networkLocationProviderPackageName"; - public static final String CONFIG_ENABLE_NL_OVERLAY = "config_enableNetworkLocationOverlay"; - public static final String CONFIG_NL_PROVIDER_PACKAGE_NAMES = "config_locationProviderPackageNames"; - - @Override - public String getGroupName(Context context) { - return context.getString(R.string.self_check_cat_nlpcompat); - } - - @Override - public void doChecks(Context context, ResultCollector collector) { - checkSystemIsSupported(context, collector); - checkSystemIsConfigured(context, collector); - } - - private boolean checkSystemIsSupported(Context context, ResultCollector collector) { - boolean isSupported = (SDK_INT >= KITKAT && SDK_INT <= M); - collector.addResult(context.getString(R.string.self_check_name_system_supported), - isSupported ? Result.Positive : Result.Unknown, context.getString(R.string.self_check_resolution_system_supported)); - return isSupported; - } - - private boolean checkSystemIsConfigured(Context context, ResultCollector collector) { - // 2.3+ com.android.internal.R.string.config_networkLocationProvider - // 4.1+ com.android.internal.R.string.config_networkLocationProviderPackageName - // 4.2+ com.android.internal.R.array.config_locationProviderPackageNames - // 4.3+ com.android.internal.R.array.config_locationProviderPackageNames / - // com.android.internal.R.string.config_networkLocationProviderPackageName / - // com.android.internal.R.bool.config_enableNetworkLocationOverlay - boolean systemMatchesPackage = false; - if (SDK_INT < JELLY_BEAN) { - systemMatchesPackage |= context.getPackageName().equals(getResourceString(context, CONFIG_NL_PROVIDER)); - } else { - boolean overlay = getResourceBool(context, CONFIG_ENABLE_NL_OVERLAY); - if (SDK_INT < JELLY_BEAN_MR1 || (SDK_INT > JELLY_BEAN_MR1 && !overlay)) { - systemMatchesPackage |= context.getPackageName().equals(getResourceString(context, CONFIG_NL_PROVIDER_PACKAGE_NAME)); - } - if (SDK_INT == JELLY_BEAN_MR1 || (SDK_INT > JELLY_BEAN_MR1 && overlay)) { - systemMatchesPackage |= Arrays.asList(getResourceArray(context, CONFIG_NL_PROVIDER_PACKAGE_NAMES)).contains(context.getPackageName()); - } - } - collector.addResult(context.getString(R.string.self_check_name_nlp_package_name), - systemMatchesPackage ? Result.Positive : Result.Negative, context.getString(R.string.self_check_resolution_nlp_package_name)); - return systemMatchesPackage; - } - - private String[] getResourceArray(Context context, String identifier) { - try { - int resId = context.getResources().getIdentifier(identifier, "array", "android"); - if (resId == 0) - resId = context.getResources().getIdentifier(identifier, "array", "com.android.internal"); - return context.getResources().getStringArray(resId); - } catch (Exception e) { - return new String[0]; - } - } - - private boolean getResourceBool(Context context, String identifier) { - try { - int resId = context.getResources().getIdentifier(identifier, "bool", "android"); - if (resId == 0) - resId = context.getResources().getIdentifier(identifier, "bool", "com.android.internal"); - return context.getResources().getBoolean(resId); - } catch (Exception e) { - return false; - } - } - - private String getResourceString(Context context, String identifier) { - try { - int resId = context.getResources().getIdentifier(identifier, "string", "android"); - if (resId == 0) - resId = context.getResources().getIdentifier(identifier, "string", "com.android.internal"); - return context.getString(resId); - } catch (Exception e) { - return null; - } - } -} diff --git a/unifiednlp-base/src/main/java/org/microg/tools/selfcheck/NlpStatusChecks.java b/unifiednlp-base/src/main/java/org/microg/tools/selfcheck/NlpStatusChecks.java deleted file mode 100644 index dbe5c2c..0000000 --- a/unifiednlp-base/src/main/java/org/microg/tools/selfcheck/NlpStatusChecks.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.tools.selfcheck; - -import android.content.Context; -import android.location.Geocoder; -import android.location.Location; -import android.location.LocationListener; -import android.location.LocationManager; -import android.os.Bundle; -import android.text.TextUtils; - -import org.microg.nlp.Preferences; -import org.microg.nlp.R; -import org.microg.nlp.location.AbstractLocationService; - -import java.io.IOException; -import java.util.Locale; -import java.util.concurrent.atomic.AtomicBoolean; - -import static android.content.Context.LOCATION_SERVICE; -import static android.location.LocationManager.NETWORK_PROVIDER; -import static org.microg.nlp.api.Constants.LOCATION_EXTRA_BACKEND_COMPONENT; -import static org.microg.tools.selfcheck.SelfCheckGroup.Result.Negative; -import static org.microg.tools.selfcheck.SelfCheckGroup.Result.Positive; -import static org.microg.tools.selfcheck.SelfCheckGroup.Result.Unknown; - -public class NlpStatusChecks implements SelfCheckGroup { - private Location mLastLocation; - - @Override - public String getGroupName(Context context) { - return context.getString(R.string.self_check_cat_nlp_status); - } - - @Override - public void doChecks(Context context, ResultCollector collector) { - providerWasBound(context, collector); - isLocationProviderSetUp(context, collector); - if (isNetworkLocationEnabled(context, collector)) { - isProvidingLastLocation(context, collector); - isProvidingLocation(context, collector); - isGeocoderProvideAddress(context, collector); - } - } - - private boolean providerWasBound(Context context, ResultCollector collector) { - collector.addResult(context.getString(R.string.self_check_name_nlp_bound), - AbstractLocationService.WAS_BOUND ? Positive : Negative, context.getString(R.string.self_check_resolution_nlp_bound)); - return AbstractLocationService.WAS_BOUND; - } - - private boolean isLocationProviderSetUp(Context context, ResultCollector collector) { - boolean setupLocationProvider = !TextUtils.isEmpty(new Preferences(context).getLocationBackends()); - collector.addResult(context.getString(R.string.self_check_name_nlp_setup), - setupLocationProvider ? Positive : Negative, context.getString(R.string.self_check_resolution_nlp_setup)); - return setupLocationProvider; - } - - private boolean isNetworkLocationEnabled(Context context, ResultCollector collector) { - LocationManager locationManager = (LocationManager) context.getSystemService(LOCATION_SERVICE); - boolean networkEnabled = locationManager.getProviders(true).contains(NETWORK_PROVIDER); - collector.addResult(context.getString(R.string.self_check_name_network_enabled), - networkEnabled ? Positive : Negative, context.getString(R.string.self_check_resolution_network_enabled)); - return networkEnabled; - } - - private boolean isProvidingLastLocation(Context context, ResultCollector collector) { - LocationManager locationManager = (LocationManager) context.getSystemService(LOCATION_SERVICE); - try { - Location location = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER); - boolean hasKnown = location != null && location.getExtras() != null && - location.getExtras().containsKey(LOCATION_EXTRA_BACKEND_COMPONENT); - collector.addResult(context.getString(R.string.self_check_name_last_location), - hasKnown ? Positive : Unknown, context.getString(R.string.self_check_resolution_last_location)); - - if (hasKnown) { - mLastLocation = location; - } - - return hasKnown; - } catch (SecurityException e) { - collector.addResult(context.getString(R.string.self_check_name_last_location), Unknown, context.getString(R.string.self_check_loc_perm_missing)); - return false; - } - } - - private void isProvidingLocation(final Context context, final ResultCollector collector) { - final AtomicBoolean result = new AtomicBoolean(false); - LocationManager locationManager = (LocationManager) context.getSystemService(LOCATION_SERVICE); - new Thread(new Runnable() { - @Override - public void run() { - synchronized (result) { - try { - result.wait(10000); - } catch (InterruptedException e) { - } - collector.addResult(context.getString(R.string.self_check_name_nlp_is_providing), - result.get() ? Positive : Unknown, - context.getString(R.string.self_check_resolution_nlp_is_providing)); - } - } - }).start(); - try { - locationManager.requestSingleUpdate(NETWORK_PROVIDER, new LocationListener() { - @Override - public void onLocationChanged(Location location) { - synchronized (result) { - result.set(location != null && location.getExtras() != null && - location.getExtras().containsKey(LOCATION_EXTRA_BACKEND_COMPONENT)); - result.notifyAll(); - mLastLocation = location; - } - } - - @Override - public void onStatusChanged(String provider, int status, Bundle extras) { - } - - @Override - public void onProviderEnabled(String provider) { - } - - @Override - public void onProviderDisabled(String provider) { - } - }, null); - } catch (SecurityException e) { - collector.addResult(context.getString(R.string.self_check_name_last_location), Unknown, context.getString(R.string.self_check_loc_perm_missing)); - } - } - - private void isGeocoderProvideAddress(final Context context, final ResultCollector collector) { - if (mLastLocation == null) { - collector.addResult( - context.getString(R.string.self_check_geocoder_no_location), - Negative, - context.getString(R.string.self_check_geocoder_verify_backend)); - return; - } - - final AtomicBoolean result = new AtomicBoolean(false); - final AtomicBoolean timeout = new AtomicBoolean(true); - - final Geocoder geocoder = new Geocoder(context, Locale.getDefault()); - - new Thread(new Runnable() { - @Override - public void run() { - synchronized (result) { - try { - result.wait(10000); - } catch (InterruptedException ignored) { - } - - if (timeout.get()) { - collector.addResult( - context.getString(R.string.self_check_name_nlp_geocoder_is_providing_addresses), - Unknown, - context.getString(R.string.self_check_resolution_nlp_geocoder_no_address_timeout)); - } else { - collector.addResult( - context.getString(R.string.self_check_name_nlp_geocoder_is_providing_addresses), - result.get() ? Positive : Negative, - context.getString(R.string.self_check_resolution_nlp_geocoder_no_address)); - } - } - } - }).start(); - - // Threaded Geocoder Request - new Thread(new Runnable() { - @Override - public void run() { - synchronized (result) { - try { - geocoder.getFromLocation( - mLastLocation.getLatitude(), - mLastLocation.getLongitude(), - 1); - result.set(true); - } catch (IOException e) { - result.set(false); - } - timeout.set(false); - result.notifyAll(); - } - } - }).start(); - } -} diff --git a/unifiednlp-base/src/main/res/drawable-hdpi/info.png b/unifiednlp-base/src/main/res/drawable-hdpi/info.png deleted file mode 100644 index 0807330..0000000 Binary files a/unifiednlp-base/src/main/res/drawable-hdpi/info.png and /dev/null differ diff --git a/unifiednlp-base/src/main/res/drawable-hdpi/settings.png b/unifiednlp-base/src/main/res/drawable-hdpi/settings.png deleted file mode 100644 index aea14e5..0000000 Binary files a/unifiednlp-base/src/main/res/drawable-hdpi/settings.png and /dev/null differ diff --git a/unifiednlp-base/src/main/res/drawable-mdpi/info.png b/unifiednlp-base/src/main/res/drawable-mdpi/info.png deleted file mode 100644 index 65f15fb..0000000 Binary files a/unifiednlp-base/src/main/res/drawable-mdpi/info.png and /dev/null differ diff --git a/unifiednlp-base/src/main/res/drawable-mdpi/settings.png b/unifiednlp-base/src/main/res/drawable-mdpi/settings.png deleted file mode 100644 index c07736c..0000000 Binary files a/unifiednlp-base/src/main/res/drawable-mdpi/settings.png and /dev/null differ diff --git a/unifiednlp-base/src/main/res/drawable-xhdpi/info.png b/unifiednlp-base/src/main/res/drawable-xhdpi/info.png deleted file mode 100644 index fcdaa33..0000000 Binary files a/unifiednlp-base/src/main/res/drawable-xhdpi/info.png and /dev/null differ diff --git a/unifiednlp-base/src/main/res/drawable-xhdpi/settings.png b/unifiednlp-base/src/main/res/drawable-xhdpi/settings.png deleted file mode 100644 index 008d7ec..0000000 Binary files a/unifiednlp-base/src/main/res/drawable-xhdpi/settings.png and /dev/null differ diff --git a/unifiednlp-base/src/main/res/drawable-xxhdpi/info.png b/unifiednlp-base/src/main/res/drawable-xxhdpi/info.png deleted file mode 100644 index 53313c8..0000000 Binary files a/unifiednlp-base/src/main/res/drawable-xxhdpi/info.png and /dev/null differ diff --git a/unifiednlp-base/src/main/res/drawable-xxhdpi/settings.png b/unifiednlp-base/src/main/res/drawable-xxhdpi/settings.png deleted file mode 100644 index ab60536..0000000 Binary files a/unifiednlp-base/src/main/res/drawable-xxhdpi/settings.png and /dev/null differ diff --git a/unifiednlp-base/src/main/res/drawable-xxxhdpi/info.png b/unifiednlp-base/src/main/res/drawable-xxxhdpi/info.png deleted file mode 100644 index 3c4f84f..0000000 Binary files a/unifiednlp-base/src/main/res/drawable-xxxhdpi/info.png and /dev/null differ diff --git a/unifiednlp-base/src/main/res/drawable-xxxhdpi/settings.png b/unifiednlp-base/src/main/res/drawable-xxxhdpi/settings.png deleted file mode 100644 index 7f4788a..0000000 Binary files a/unifiednlp-base/src/main/res/drawable-xxxhdpi/settings.png and /dev/null differ diff --git a/unifiednlp-base/src/main/res/drawable/location_marker.xml b/unifiednlp-base/src/main/res/drawable/location_marker.xml deleted file mode 100644 index 3910266..0000000 --- a/unifiednlp-base/src/main/res/drawable/location_marker.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - \ No newline at end of file diff --git a/unifiednlp-base/src/main/res/layout/backend_list_entry.xml b/unifiednlp-base/src/main/res/layout/backend_list_entry.xml deleted file mode 100644 index 154e864..0000000 --- a/unifiednlp-base/src/main/res/layout/backend_list_entry.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/unifiednlp-base/src/main/res/mipmap-hdpi/ic_nlp_app.png b/unifiednlp-base/src/main/res/mipmap-hdpi/ic_nlp_app.png deleted file mode 100644 index 86a29e7..0000000 Binary files a/unifiednlp-base/src/main/res/mipmap-hdpi/ic_nlp_app.png and /dev/null differ diff --git a/unifiednlp-base/src/main/res/mipmap-hdpi/ic_nlp_settings.png b/unifiednlp-base/src/main/res/mipmap-hdpi/ic_nlp_settings.png deleted file mode 100644 index c08d3f6..0000000 Binary files a/unifiednlp-base/src/main/res/mipmap-hdpi/ic_nlp_settings.png and /dev/null differ diff --git a/unifiednlp-base/src/main/res/mipmap-mdpi/ic_nlp_app.png b/unifiednlp-base/src/main/res/mipmap-mdpi/ic_nlp_app.png deleted file mode 100644 index a7ae3c4..0000000 Binary files a/unifiednlp-base/src/main/res/mipmap-mdpi/ic_nlp_app.png and /dev/null differ diff --git a/unifiednlp-base/src/main/res/mipmap-mdpi/ic_nlp_settings.png b/unifiednlp-base/src/main/res/mipmap-mdpi/ic_nlp_settings.png deleted file mode 100644 index 6d3adc6..0000000 Binary files a/unifiednlp-base/src/main/res/mipmap-mdpi/ic_nlp_settings.png and /dev/null differ diff --git a/unifiednlp-base/src/main/res/mipmap-xhdpi/ic_nlp_app.png b/unifiednlp-base/src/main/res/mipmap-xhdpi/ic_nlp_app.png deleted file mode 100644 index cd30228..0000000 Binary files a/unifiednlp-base/src/main/res/mipmap-xhdpi/ic_nlp_app.png and /dev/null differ diff --git a/unifiednlp-base/src/main/res/mipmap-xhdpi/ic_nlp_settings.png b/unifiednlp-base/src/main/res/mipmap-xhdpi/ic_nlp_settings.png deleted file mode 100644 index 35034cd..0000000 Binary files a/unifiednlp-base/src/main/res/mipmap-xhdpi/ic_nlp_settings.png and /dev/null differ diff --git a/unifiednlp-base/src/main/res/mipmap-xxhdpi/ic_nlp_app.png b/unifiednlp-base/src/main/res/mipmap-xxhdpi/ic_nlp_app.png deleted file mode 100644 index 7296a1c..0000000 Binary files a/unifiednlp-base/src/main/res/mipmap-xxhdpi/ic_nlp_app.png and /dev/null differ diff --git a/unifiednlp-base/src/main/res/mipmap-xxhdpi/ic_nlp_settings.png b/unifiednlp-base/src/main/res/mipmap-xxhdpi/ic_nlp_settings.png deleted file mode 100644 index 7fcda52..0000000 Binary files a/unifiednlp-base/src/main/res/mipmap-xxhdpi/ic_nlp_settings.png and /dev/null differ diff --git a/unifiednlp-base/src/main/res/mipmap-xxxhdpi/ic_nlp_app.png b/unifiednlp-base/src/main/res/mipmap-xxxhdpi/ic_nlp_app.png deleted file mode 100644 index 57c386e..0000000 Binary files a/unifiednlp-base/src/main/res/mipmap-xxxhdpi/ic_nlp_app.png and /dev/null differ diff --git a/unifiednlp-base/src/main/res/mipmap-xxxhdpi/ic_nlp_settings.png b/unifiednlp-base/src/main/res/mipmap-xxxhdpi/ic_nlp_settings.png deleted file mode 100644 index b2ab77d..0000000 Binary files a/unifiednlp-base/src/main/res/mipmap-xxxhdpi/ic_nlp_settings.png and /dev/null differ diff --git a/unifiednlp-base/src/main/res/values-de/strings.xml b/unifiednlp-base/src/main/res/values-de/strings.xml deleted file mode 100644 index 7a0b3a2..0000000 --- a/unifiednlp-base/src/main/res/values-de/strings.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - UnifiedNlp - UnifiedNlp Einstellungen - Dienst hinzufügen - Ortungsdienste konfigurieren - Adressauflösungsdienste konfigurieren - Funknetz-basierte Ortung - Adressauflösung - Dienste konfigurieren - Aktiviere, deaktiviere und konfiguriere Dienste zur Funknetz-basierten Ortung. - Aktiviere, deaktiviere und konfiguriere Dienste zur Adressauflösung. - Funknetz-basierte Ortung erzwingen - Erzwinge ein bestimmtes Ergebnis bei der Funknetz-basierten Ortung - - Unterstützung für Funknetz-basierte Ortung - Android-Version unterstützt: - Deine Android-Version wird nicht offiziell unterstützt. Das heißt jedoch nicht, dass etwas nicht funktioniert. - System unterstützt Ortungsdienste: - Dein System unterstützt diese Version von UnifiedNlp nicht. Installiere eine andere Version oder nutze ein Xposed-Modul zur Kompatibilität. - - UnifiedNlp Status - UnifiedNlp ist im system registriert: - Das Betriebssystem hat sich nicht mit UnifiedNlp verbunden. Wenn du UnifiedNlp gerade erst installiert hast, probiere dein Gerät neuzustarten. - Ortungsdienst(e) eingerichtet: - Installiere und konfiguriere ein UnifiedNlp Ortungsdienst um Funknetz-basierte Ortung zu nutzen. - UnifiedNlp Ortung erfolgreich: - UnifiedNlp konnte bisher keine Ortung durchführen. Einige Anwendungen könnten dadurch Probleme haben. - UnifiedNlp erneuert die Ortung: - UnifiedNlp hat in den letzten 10 Sekunden keine Ortung durchführen können. - Funknetz-basierte Ortung aktiv: - Entweder ist die Funknetz-basierte Ortung (in den System-Einstellungen) deaktiviert oder dein System unterstützt dies nicht. - Die Berechtigung zum Zugriff auf den Ort wurde nicht gestattet. - - Infos - Über microG UnifiedNlp - Versionsinformationen und genutzte Bibliotheken - - für Systeme ohne Google Apps - für alte Systeme ohne Google Apps - für angepasste Systeme - - UnifiedNlp konnte keine Ortung durchführen um die Adressauflösung zu testen. - Bitte prüfe deinen Ortungsdienst - - Adressauflösung an aktuellem Ort möglich: - Der Adressauflösungsdienst hat zur aktuellen Position keine Adressdaten bereitgestellt. Bitte installiere und konfiguriere einen Adressauflösungsdienst. - Der Adressauflösungsdienst hat binnen 10 Sekunden kein Ergebnis geliefert. - diff --git a/unifiednlp-base/src/main/res/values-eo/strings.xml b/unifiednlp-base/src/main/res/values-eo/strings.xml deleted file mode 100644 index 43dcc07..0000000 --- a/unifiednlp-base/src/main/res/values-eo/strings.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - UnifiedNlp - Agordoj de UnifiedNlp - Aldoni subservon - Agordi pozici-trovajn subservojn - Agordi adres-trovajn subservojn - Ret-bazita pozici-trovado - Adres-elserĉado - Agordi subservojn - -Aktivigu, malaktivigu kaj agordu subservojn por ret-bazita pozici-trovado. - -Aktivigu, malaktivigu kaj agordu subservojn por elserĉado de adresoj. - devigi proksimuman pozicion - Devigas al ret-bazita liverilo de pozicio raporti certan pozicion - - Subteno por ret-bazita liverilo de pozicio - Androida versio subtenata: - Versio de via Androida sistemo ne estas oficiale subtenata. Tio ĉi eĉ ne gravas. - Sistemo subtenas liverilon de pozicio: - Via sistemo ne subtenas tiun ĉi UnifieldNlp pakaĵon. Aŭ instalu kongruan pakaĵon, aŭ kongruigan modulon Xposed. - - Stato de UnifiedNlp - UnifiedNlp estas registrita en sistemo: - La sistemo ne kuniĝis kun servo UnifieldNlp. Se vi ĵus instalis servon UnifieldNlp, provu restartigi la aparaton. - Pozici-trova(j) subservo(j) agordita(j): - Instalu kaj agordu UnifieldNlp pozici-trovan subservon por uzi ret-bazitan pozici-trovadon. - UnifiedNlp trovis pozicion: - UnifiedNlp ne trovis lastatempe pozicion. Tio ĉi kaŭzos problemojn kun iuj programoj. - UnifiedNlp liveras aktualigojn de pozicio: - Neniu UnifieldNlp pozicio estas liverita de sistemo dum lastaj 10 sekundoj. - Ret-bazita pozicio aktiva: - Vi aŭ malaktivigis ret-bazitan pozici-travadon (per sistemaj agordoj), aŭ la sistemo ne estas subtenata. - Pozici-permeso ne estas jam akirita - - Pri - Pri microG UnifiedNlp - Informoj pri versio kaj uzataj bibliotekoj - - por normaj sistemoj sen GAPPS - por malnovaj sistemoj sen GAPPS - por tajloritaj sistemoj - - UnifiedNlp ne konas pozicion por testi adres-trovan subservon - Bonvolu kontroli vian pozici-trovan subservon - - Adres-trova servo liveras adreson el la pozicio: - Ne povas trovi adreson. Bonvolu instali kaj agordi adres-trovan subservon. - Adres-trova subservo ne liveris adreson dum 10 sekundoj. - diff --git a/unifiednlp-base/src/main/res/values-es/strings.xml b/unifiednlp-base/src/main/res/values-es/strings.xml deleted file mode 100644 index 56ac178..0000000 --- a/unifiednlp-base/src/main/res/values-es/strings.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - diff --git a/unifiednlp-base/src/main/res/values-fr/strings.xml b/unifiednlp-base/src/main/res/values-fr/strings.xml deleted file mode 100644 index e0d35b9..0000000 --- a/unifiednlp-base/src/main/res/values-fr/strings.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - UnifiedNlp - Paramètres UnifiedNlp - Ajouter un fournisseur - Configurer les fournisseurs de géolocalisation - Configurer les fournisseurs de géocodage - Géolocalisation réseau - Géocodage - Configurer les fournisseurs - - Activer, désactiver et configurer les fournisseurs de géolocalisation réseau. - - - Activer, désactiver et configurer les fournisseurs de géocodage. - - Forcer une localisation approximative - Forcer la géolocalisation réseau à présenter une certaine position - - Support de la géolocalisation réseau - Version d’Android supportée : - Votre version d’Android n’est pas officiellement supportée. Cela n’a pas forcément d’importance. - Support système de la géolocalisation réseau : - Votre système ne supporte pas ce paquet UnifiedNlp. Installez un paquet adéquat ou un module Xposed de compatibilité. - - Status d’UnifiedNlp - UnifiedNlp est enregistré auprès du système : - Le système n’a pas établi de liaison avec le service UnifiedNlp. Si vous venez juste d’installer UnifiedNlp, vous devriez redémarrer votre terminal. - Fournisseur(s) de localisation configuré(s) : - Installez et configurez un fournisseur de localisation UnifiedNlp afin d’utiliser la géolocalisation réseau. - UnifiedNlp connaît la position : - UnifiedNlp n’a pas de dernière position connue. Cela entraînera un échec de fonctionnement de certaines applications. - UnifiedNlp fournit des mises à jour de la position : - UnifiedNlp n’a pas fourni de position au système dans un intervalle de 10 secondes. - Géolocalisation réseau activée : - Vous avez désactivé la géolocalisation réseau (dans les paramètres systèmes) ou bien votre système n’est pas supporté. - L’autorisation d’accès à la position n’a pas (encore) été accordée. - - À propos - À propos de microG UnifiedNlp - Informations de version et librairies utilisées - - pour systèmes standards sans GAPPS - pour anciens systèmes sans GAPPS - pour systèmes personnalisés - - UnifiedNlp n’a pas de position pour tester le géocodeur. - Veuillez vérifier votre fournisseur de géolocalisation. - - Le géocodeur fournit une résolution d’adresse à partir de la position : - Le géocodeur n’a pas fournit de résolution d’adresse. Veuillez installer et configurer un fournisseur de géocodage. - Le géocodeur n’a pas fournit de résolution d’adresse dans un intervalle de 10 secondes. - diff --git a/unifiednlp-base/src/main/res/values-pl/strings.xml b/unifiednlp-base/src/main/res/values-pl/strings.xml deleted file mode 100644 index 7f3e0eb..0000000 --- a/unifiednlp-base/src/main/res/values-pl/strings.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - UnifiedNlp - Ustawienia UnifiedNlp - Dodaj usługę - Konfiguruj usługi lokalizacyjne - Konfiguruj usługi wyszukiwania adresów - Geolokalizacja oparta o sieć - Wyszukiwanie adresów - Konfiguruj usługi - -Włącz, wyłącz i skonfiguruj usługi geolokalizacji opartej o sieć. - -Włącz, wyłącz i skonfiguruj usługi wyszukiwania adresów. - wymuś przybliżoną lokalizację - Wymuś raportowanie przez dostawcę lokalizacji opartej o sieć - - Wsparcie dla dostawcy lokalizacji opartej o sieć - Wspierana wersja Androida: - Twoja wersja systemu Android nie jest oficjalnie wspierana. W gruncie rzeczy nie ma to znaczenia. - System wspiera dostawcę lokalizacji: - Twój system nie wspiera tej paczki UnifieldNlp. Albo zainstaluj odpowiednią paczkę, albo moduł kompatybilności Xposed. - - Stan UnifiedNlp - UnifiedNlp jest zarejestrowany w systemie: - Usługa UnifieldNlp nie została powiązana z systemem. Jeżeli dopiero co zainstalowałeś UnifildNlp, powinieneś spróbować zrestartować urządzenie. - Usługa lokalizacji skonfigurowana: - Zainstaluj i skonfiguruj usługę dostawcy lokalizacji UnifieldNlp, aby móc korzystać z lokalizacji opartej na sieć. - UnifiedNlp określił lokalizację: - UnifiedNlp nie określił ostatnio lokalizacji. To sprawi problemy w niektórych aplikacjach. - UnifiedNlp dostarcza aktualizacje lokalizacji: - Nie została dostarczona żadna lokalizacja UnifieldNlp przez system w ciągu ostatnich 10 sekund. - Lokalizacja oparta o sieć włączona: - Albo wyłączyłeś lokalizację opartą o sieć (w ustawieniach systemu), albo Twój system nie jest wspierany. - Uprawnienie lokalizacji nie zostało jeszcze przydzielone - - O programie - O microG UnifiedNlp - Informacje o wersji i użytych bibliotekach - - dla nowszych systemów bez GAPPS - dla starszych systemów bez GAPPS - dla dostosowanych systemów - - UnifiedNlp nie dysponuje pozycją, aby sprawdzić usługę wyszukiwania adresów - Proszę skontrolować usługę geolokalizacji - - Usługa wyszukiwania adresów znalazła adres: - Nie można odczytać adresu. Prosimy zainstalować i skonfigurować usługę wyszukiwania adresów. - Usługa wyszukiwania adresów nie dostarczyła adresu w ciągu 10 sekund. - diff --git a/unifiednlp-base/src/main/res/values-ro/strings.xml b/unifiednlp-base/src/main/res/values-ro/strings.xml deleted file mode 100644 index 672930d..0000000 --- a/unifiednlp-base/src/main/res/values-ro/strings.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - Nlp Unificat - Setări Nlp Unificat - Adăugaţi un motor - Configuraţi motoarele de localizare - Configuraţi motoarele de căutare a adreselor - Localizare geografică bazată pe rețea - Căutare adrese - Configuraţi motoarele - - Activaţi, dezactivaţi şi configuraţi motoarele pentru localizare geografică bazată pe rețea. - - - Activaţi, dezactivaţi şi configuraţi motoarele pentru căutarea adreselor. - - impunere locație aproximativă - Se impune furnizorului de locaţie bazată pe reţea să raporteze o anumită locație - - diff --git a/unifiednlp-base/src/main/res/values-ru/strings.xml b/unifiednlp-base/src/main/res/values-ru/strings.xml deleted file mode 100644 index e7afe6b..0000000 --- a/unifiednlp-base/src/main/res/values-ru/strings.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - UnifiedNlp - Настройки UnifiedNlp - Добавить backend-программу - Backend-программы определения местоположения - Backend-программы поиска адреса - Местоположение по сети - Поиск адреса - Настроить backend-программы - - Включить, отключить и настроить программы для определения местоположениея по сети. - - - Включить, отключить и настроить программы для поиска адреса. - - определение приблизительного местоположения - Принудительно использовать сеть для определения местоположения - - Поддержка провайдеров местонахождения по сети - Версия Android поддерживается: - Ваша версия Android официально не поддерживается. Это не обязательно должно что-то значить. - Система поддерживает провайдеров местонахождения: - Ваша система не поддерживает этот UnifiedNlp. Установите совместимый или модуль Xposed. - - Статус UnifiedNlp - UnifiedNlp зарегистрирован в системе: - Не запускаються сервисы UnifiedNlp. Если вы только что установили UnifiedNlp, то перезагрузите устройство. - Backend-программы для местоположения настроены: - Установите и настройте UnifiedNlp backend-программу для использования местоположения по сети. - UnifiedNlp знает ваше местоположение: - UnifiedNlp не знает вашего местоположения. Это может вызвать ошибки в некоторых приложениях. - UnifiedNlp обеспечивает обновление местоположения: - Местоположение не было предоставлено системой в течение 10 секунд. - Местоположение по сети включено: - Отключено нахождение местоположение по сети (в настройках системы) или система не поддерживается. - Разрешение на доступ к местоположению еще не предоставлено. - - О программе - О microG UnifiedNlp - Информация о версии и используемые библиотеки - - для прошивок по умолчанию без GAPPS - для устаревших прошивок без GAPPS - для кастомных прошивок - - UnifiedNlp не имеет местоположения для тестирования геокодера - Пожалуйста, проверьте backend-программы определения местоположения - - Геокодер предоставляет анализ адреса из местоположения: - Геокодер не предоставляет анализ адреса. Пожалуйста, установите и настройте программу-backend для поиска адреса. - >Геокодер не предоставляет анализ адреса в течении 10 секунд. - - diff --git a/unifiednlp-base/src/main/res/values-sr/strings.xml b/unifiednlp-base/src/main/res/values-sr/strings.xml deleted file mode 100644 index ab8f97f..0000000 --- a/unifiednlp-base/src/main/res/values-sr/strings.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - Обједињени МПЛ - Поставке Обједињеног МПЛ - Додај мотор - Поставке мотора за локацију - Поставке мотора за потрагу адреса - Мрежна геолокација - Потрага адресе - Подеси моторе - - Укључење, искључење и подешавање мотора за мрежну геолокацију. - - - Укључење, искључење и подешавање мотора за мрежну потрагу адресе. - - присиљавање приближне локације - Присиљавање мотора за мрежну локацију да пријави одређену локацију - - Подршка за Мрежне Провајдере Локације - Издање Андроида подржано: - Ваше издање Андроида није службено подржано. Ово нужно не мора да значи ништа. - Систем подржава провајдере локације: - Ваш систем не подржава овај пакет Обједињеног МПЛ. Или инсталирајте одговарајући пакет или Xposed модул за компатибилност. - - Стање Обједињеног МПЛ-а - Обједињени МПЛ је регистрован у систему: - Систем се није повезао са услугом Обједињеног МПЛ-а. Ако сте инсталирали Обједињени МПЛ покушајте са рестартом уређаја. - Мотори локације подешени: - Инсталирајте и подесите мотор за Обједињени МПЛ да бисте користили мрежну геолокацију, - Обједињени МПЛ има познату локацију: - Обједињени МПЛ нема последњу познату локацију. Неке апликације ће краховати због овога. - Обједињени МПЛ пружа освежавања локације: - Систем није пружио ниједну локацију Обједињеног МПЛ-а у последњих 10 секунди. - Мрежна локација укључена: - Или сте искључили мрежну локацију (у поставкама система) или систем није подржан. - Дозвола за локацију још није одобрена - - О програму - О микроГ Обједињеном МПЛ-у - Подаци о издању и коришћеним библиотекама - - за преподешене системе без Гуглових апликација - за застареле системе без Гуглових апликација - за прилагођене системе - diff --git a/unifiednlp-base/src/main/res/values-uk/strings.xml b/unifiednlp-base/src/main/res/values-uk/strings.xml deleted file mode 100644 index b33770f..0000000 --- a/unifiednlp-base/src/main/res/values-uk/strings.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - UnifiedNlp - Налаштування UnifiedNlp - Додати сервер - Сконфігурувати сервер позиціювання - Сконфігурувати сервер пошуку адрес - Географічне позиціювання на основі мереж - Пошук адрес - Конфігурація серверів - -Вмикання, вимикання чи конфігурування серверів позиціювання на основі мережі. - -Вмикання, вимикання чи конфігурування серверів для пошуку адрес. - визначення приблизного позиціювання - Примусово використовувати сервер позиціювання на основі мереж для визначення місцеперебування - - Підтримка постачальників позиціювання на основі мереж - Підтримка версії Android: - Ваша версія Android не підтримується офіційно. Проте це ще нічого не означає. - Підтримка постачальників позиціювання системою: - Ваша система не підтримує поточний додаток UnifiedNlp. Встановіть сумісну версію, або ж відповідний Xposed модуль. - - Стан UnifiedNlp - Реєстрація UnifiedNlp в системі: - Система не визначає сервіс UnifiedNlp. Якщо ви щойно встановили UnifiedNlp, спробуйте перезавантажити пристрій. - Налаштування серверу(ів) позиціювання: - Встановіть та сконфігуруйте UnifiedNlp сервери позиціювання для визначення місцеперебування на основі мереж. - Визначення UnifiedNlp місцеперебування: - UnifiedNlp не визначив місцеперебування. Це може викликати проблеми в деяких додатках. - Забезпечення оновленням позиціювання UnifiedNlp: - На протязі 10 секунд не було отримано місцеперебування від системи. - Стан позиціювання на основі мереж: - Вимкнено позиціювання на основі мереж (в системних налаштуваннях) або система не підтримується. - Дозвіл на отримання позиціювання ще не надано - - Про - Про microG UnifiedNlp - Версія та використані бібліотеки - - для типових систем без GAPPS - для застарілих систем без GAPPS - для нетипових систем - - UnifiedNlp не отримав місцеперебування для тестування геокодування - Будь ласка, перевірте сервер позиціювання - - Пошук адреси геокодером з місцеперебування: - Геокодер не визначив адресу. Будь ласка, встановіть та налаштуйте сервер пошуку адрес. - На протязі 10 секунд геокодер не надав визначеної адреси. - diff --git a/unifiednlp-base/src/main/res/values-zh-rTW/strings.xml b/unifiednlp-base/src/main/res/values-zh-rTW/strings.xml deleted file mode 100644 index 5ffcf8c..0000000 --- a/unifiednlp-base/src/main/res/values-zh-rTW/strings.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - UnifiedNlp - UnifiedNlp設定 - 新增背景伺服器 - 設定地點背景伺服器 - 設定地址查閱背景伺服器 - 基於網路的地理位置定位 - 地址查閱 - 設定背景伺服器 - - 為基於網路的地理位置定位啟用,停用或設定背景伺服器。 - - - 為地址查閱啟用,停用或設定背景伺服器。 - - 強制啟用精準位置 - 強制基於網路的地點供應者回報一個精確的地點 - - 是否支援網路的地點供應者 - 支援的Android版本: - 您的Android版本並不被正式支援。這並不一定代表什麼。 - 系統支援地點供應者: - 您的系統並不支援這個UnifiedNlp程式。安裝正確的程式或相容的Xposed模組。 - - UnifiedNlp狀態 - UnifiedNlp已註冊到系統: - 系統尚未綁定UnifiedNlp服務。 如果您剛剛安裝UnifiedNlp,您應該試著重啟設備。 - 地點背景伺服器設定: - 安裝或設定一個UnifiedNlp地點背景伺服器以使用基於網路的地理位置定位。 - UnifiedNlp有已知地點: - UnifiedNlp無最後已知地點。這可能導致某些程式無法運作。 - UnifiedNlp提供地點更新: - 這10秒內並沒有系統提供的UnifiedNlp位置。 - 啟用基於網路的位置定位: - 您不是在系統設定中停用了基於網路的位置定位就是系統不支援。 - 尚未允許定位權限 - - 關於 - 關於microG UnifiedNlp - 版本資訊和使用的程式庫 - - 給沒有GAPPS的支援系統 - 給沒有GAPPS的舊系統 - 給第三方系統 - diff --git a/unifiednlp-base/src/main/res/values/strings.xml b/unifiednlp-base/src/main/res/values/strings.xml deleted file mode 100644 index 113b316..0000000 --- a/unifiednlp-base/src/main/res/values/strings.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - UnifiedNlp - UnifiedNlp Settings - Add backend - Configure location backends - Configure address lookup backends - Network-based Geolocation - Address lookup - Configure backends - - Enable, disable and configure backends for network based geolocation. - - - Enable, disable and configure backends for address lookup. - - enforce approximate location - Force the network-based location provider to report a certain location - - location_backends - geocoder_backends - - Network location provider support - Android version supported: - Your Android version is not officially supported. This does not necessarily mean anything. - System supports location provider: - Your system does not support this UnifiedNlp package. Either install a matching package or a compatibility Xposed module. - - UnifiedNlp status - UnifiedNlp is registered in system: - The system did not bind the UnifiedNlp service. If you just installed UnifiedNlp you should try to reboot this device. - Location backend(s) set up: - Install and configure a UnifiedNlp location backend to use network-based geolocation. - UnifiedNlp has known location: - UnifiedNlp has no last known location. This will cause some apps to fail. - UnifiedNlp provides location updates: - No UnifiedNlp location was provided by the system within 10 seconds. - Network-based location enabled: - You either disabled network-based location (in system settings) or the system is not supported. - Location permission not yet granted - - About - About microG UnifiedNlp - Version information and used libraries - - for default systems without GAPPS - for legacy systems without GAPPS - for custom systems - - UnifiedNlp do not have Location to test Geocoder - Please verify your location Backend - - Geocoder provides address resolution from location: - Geocoder did not provide address resolution. Please install and configure an address lookup Backend. - Geocoder did not provide address resolution within 10 seconds. - diff --git a/unifiednlp-base/src/main/res/xml/nlp_about_preferences.xml b/unifiednlp-base/src/main/res/xml/nlp_about_preferences.xml deleted file mode 100644 index 3cff002..0000000 --- a/unifiednlp-base/src/main/res/xml/nlp_about_preferences.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/unifiednlp-base/src/main/res/xml/nlp_injected_setting.xml b/unifiednlp-base/src/main/res/xml/nlp_injected_setting.xml deleted file mode 100644 index 87db7ac..0000000 --- a/unifiednlp-base/src/main/res/xml/nlp_injected_setting.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - \ No newline at end of file diff --git a/unifiednlp-base/src/main/res/xml/nlp_preferences.xml b/unifiednlp-base/src/main/res/xml/nlp_preferences.xml deleted file mode 100644 index c082007..0000000 --- a/unifiednlp-base/src/main/res/xml/nlp_preferences.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - diff --git a/unifiednlp-base/src/main/res/xml/nlp_setup_preferences.xml b/unifiednlp-base/src/main/res/xml/nlp_setup_preferences.xml deleted file mode 100644 index 0a48d50..0000000 --- a/unifiednlp-base/src/main/res/xml/nlp_setup_preferences.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - \ No newline at end of file