Drop legacy

This commit is contained in:
Marvin W 2020-06-05 18:37:00 +02:00
parent 8b8fbb546b
commit d0d3f50080
No known key found for this signature in database
GPG Key ID: 072E9235DB996F2A
71 changed files with 0 additions and 3805 deletions

View File

@ -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-<lang>/strings.xml
source_file = unifiednlp-base/src/main/res/values/strings.xml
source_lang = en
type = ANDROID

View File

@ -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'
}

View File

@ -1,39 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ 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.
-->
<manifest package="org.microg.nlp.app"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<!-- TODO: Does it work on SDK 9? -->
<uses-sdk tools:overrideLibrary="com.takisoft.fix.support.v7.preference,android.support.graphics.drawable.animated,android.arch.lifecycle" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_nlp_app"
android:label="@string/nlp_app_name">
<activity
android:name="org.microg.nlp.ui.SettingsLauncherActivity"
android:icon="@mipmap/ic_nlp_settings"
android:label="@string/nlp_app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>

View File

@ -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);
}
}
}
}

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ 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.
-->
<resources>
<bool name="is_unifiednlp_app">true</bool>
</resources>

View File

@ -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')
}

View File

@ -1,122 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ 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.
-->
<manifest package="org.microg.nlp"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<permission
android:name="org.microg.permission.FORCE_COARSE_LOCATION"
android:description="@string/perm_force_coarse_location_desc"
android:label="@string/perm_force_coarse_location_label"
android:permissionGroup="android.permission-group.LOCATION"
android:protectionLevel="dangerous"/>
<uses-permission
android:name="android.permission.INSTALL_LOCATION_PROVIDER"
tools:ignore="ProtectedPermissions"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_UPDATES"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="org.microg.permission.FORCE_COARSE_LOCATION"/>
<uses-permission android:name="com.android.settings.INJECT_SETTINGS"/>
<application>
<uses-library android:name="com.android.location.provider"/>
<!-- Gingerbread / Ice Cream Sandwich -->
<service
android:name="org.microg.nlp.location.LocationServiceV1"
android:exported="true"
android:permission="android.permission.ACCESS_COARSE_LOCATION">
<intent-filter>
<action android:name="com.android.location.service.NetworkLocationProvider"/>
<action android:name="com.google.android.location.NetworkLocationProvider"/>
</intent-filter>
<meta-data
android:name="serviceVersion"
android:value="1"/>
<meta-data
android:name="version"
android:value="1"/>
</service>
<!-- Jelly Bean / KitKat -->
<service
android:name="org.microg.nlp.location.LocationServiceV2"
android:exported="true"
android:permission="android.permission.ACCESS_COARSE_LOCATION">
<intent-filter>
<!-- KitKat changed the action name but nothing else, hence we handle it the same -->
<action android:name="com.android.location.service.v3.NetworkLocationProvider"/>
<action android:name="com.android.location.service.v2.NetworkLocationProvider"/>
</intent-filter>
<meta-data
android:name="serviceVersion"
android:value="2"/>
<meta-data
android:name="serviceIsMultiuser"
android:value="false"/>
</service>
<service
android:name="org.microg.nlp.geocode.GeocodeServiceV1"
android:exported="true">
<intent-filter>
<!-- Jelly Bean changed the action name but nothing else, hence we handle it the same -->
<action android:name="com.android.location.service.GeocodeProvider"/>
<action android:name="com.google.android.location.GeocodeProvider"/>
</intent-filter>
<meta-data
android:name="serviceVersion"
android:value="2"/>
<meta-data
android:name="serviceIsMultiuser"
android:value="false"/>
</service>
<service android:name=".ui.SettingInjectorService">
<intent-filter>
<action android:name="android.location.SettingInjectorService"/>
</intent-filter>
<meta-data
android:name="android.location.SettingInjectorService"
android:resource="@xml/nlp_injected_setting"/>
</service>
<activity
android:name=".ui.SettingsActivity"
android:icon="@mipmap/ic_nlp_settings"
android:label="@string/nlp_settings_label"
android:theme="@style/Theme.AppCompat.Settings"/>
<receiver android:name="org.microg.nlp.PackageReceiver">
<intent-filter>
<action android:name="android.intent.action.PACKAGE_CHANGED"/>
<action android:name="android.intent.action.PACKAGE_UPGRADED"/>
<action android:name="android.intent.action.PACKAGE_REMOVED"/>
<action android:name="android.intent.action.PACKAGE_REPLACED"/>
<action android:name="android.intent.action.PACKAGE_RESTARTED"/>
<data android:scheme="package"/>
</intent-filter>
</receiver>
</application>
</manifest>

View File

@ -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);
}
}
}
}

View File

@ -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<T extends Provider> 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.
* <p/>
* 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}.
* <p/>
* 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
}
}

View File

@ -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);
}
}
}

View File

@ -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;
}
}

View File

@ -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();
}

View File

@ -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<GeocodeProvider> {
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();
}
}
}
}

View File

@ -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<BackendHelper> backendHelpers = new ArrayList<BackendHelper>();
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<Address> getFromLocation(double latitude, double longitude, int maxResults,
String locale) {
if (backendHelpers.isEmpty())
return null;
ArrayList<Address> result = new ArrayList<Address>();
for (BackendHelper backendHelper : backendHelpers) {
List<Address> backendResult = backendHelper
.getFromLocation(latitude, longitude, maxResults, locale);
if (backendResult != null) {
result.addAll(backendResult);
}
}
return result;
}
public List<Address> getFromLocationName(String locationName, int maxResults,
double lowerLeftLatitude, double lowerLeftLongitude,
double upperRightLatitude, double upperRightLongitude,
String locale) {
if (backendHelpers.isEmpty())
return null;
ArrayList<Address> result = new ArrayList<Address>();
for (BackendHelper backendHelper : backendHelpers) {
List<Address> 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));
}
}
}
}

View File

@ -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<Address> 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<Address> 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;
}
}

View File

@ -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 {
}

View File

@ -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<Address> addresses) {
List<Address> 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<Address> addresses) {
List<Address> fuserResult = backendFuser.getFromLocationName(locationName, maxResults,
lowerLeftLatitude, lowerLeftLongitude, upperRightLatitude, upperRightLongitude,
params.getLocale().toString());
return handleResult(addresses, fuserResult);
}
private String handleResult(List<Address> realResult, List<Address> 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();
}
}

View File

@ -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;
}
}

View File

@ -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<LocationProvider> {
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
}
}
}

View File

@ -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<BackendHelper> backendHelpers = new ArrayList<BackendHelper>();
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<Location> locations = new ArrayList<Location>();
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<Location> 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<Location> backendResults = new ArrayList<Location>();
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<Location> {
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());
}
}
}

View File

@ -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();
}
}
}

View File

@ -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);
}

View File

@ -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();
}
}

View File

@ -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();
}
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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();
}
}

View File

@ -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<BackendInfo> 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<BackendInfo> 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<BackendInfo> intentToKnownBackends(Intent intent) {
List<BackendInfo> knownBackends = new ArrayList<BackendInfo>();
List<ResolveInfo> 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<BackendInfo> {
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;
}
}
}

View File

@ -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;
}
}
}

View File

@ -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;
}
}
}

View File

@ -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<ResolveInfo> 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;
}
}

View File

@ -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<SelfCheckGroup> 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<Library> libraries) {
libraries.add(new Library("org.microg.nlp.api", "microG UnifiedNlp Api", "Apache License 2.0 by microG Team"));
}
}
}

View File

@ -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;
}
}
}

View File

@ -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();
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 616 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 608 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 445 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 451 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 775 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 725 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24"
android:viewportWidth="24">
<path
android:fillColor="#000000"
android:pathData="M12,11.5A2.5,2.5 0 0,1 9.5,9A2.5,2.5 0 0,1 12,6.5A2.5,2.5 0 0,1 14.5,9A2.5,2.5 0 0,1 12,11.5M12,2A7,7 0 0,0 5,9C5,14.25 12,22 12,22C12,22 19,14.25 19,9A7,7 0 0,0 12,2Z"/>
</vector>

View File

@ -1,79 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ 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.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:padding="16dp">
<LinearLayout
android:orientation="vertical"
android:layout_width="0dip"
android:layout_weight="1"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:layout_height="wrap_content">
<!-- simple name -->
<TextView
android:id="@android:id/text1"
style="?android:textAppearanceMedium"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<!-- service info -->
<TextView
android:id="@android:id/text2"
style="?android:textAppearanceSmall"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<ImageView
android:id="@android:id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
android:clickable="false"
android:tintMode="src_in"
android:tint="?attr/colorPrimary"
android:background="?attr/selectableItemBackground"
android:padding="4dp"
android:src="@drawable/info" />
<ImageView
android:id="@android:id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
android:clickable="false"
android:tintMode="src_in"
android:tint="?attr/colorPrimary"
android:background="?attr/selectableItemBackground"
android:padding="4dp"
android:src="@drawable/settings" />
<CheckBox
android:id="@+id/enabled"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

View File

@ -1,64 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ 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.
-->
<resources>
<string name="nlp_app_name">UnifiedNlp</string>
<string name="nlp_settings_label">UnifiedNlp Einstellungen</string>
<string name="add_backend">Dienst hinzufügen</string>
<string name="configure_location_backends">Ortungsdienste konfigurieren</string>
<string name="configure_geocoder_backends">Adressauflösungsdienste konfigurieren</string>
<string name="network_location">Funknetz-basierte Ortung</string>
<string name="geocoding">Adressauflösung</string>
<string name="configure_backends">Dienste konfigurieren</string>
<string name="configure_location_backends_summary">Aktiviere, deaktiviere und konfiguriere Dienste zur Funknetz-basierten Ortung.</string>
<string name="configure_geocoder_backends_summary">Aktiviere, deaktiviere und konfiguriere Dienste zur Adressauflösung.</string>
<string name="perm_force_coarse_location_label">Funknetz-basierte Ortung erzwingen</string>
<string name="perm_force_coarse_location_desc">Erzwinge ein bestimmtes Ergebnis bei der Funknetz-basierten Ortung</string>
<string name="self_check_cat_nlpcompat">Unterstützung für Funknetz-basierte Ortung</string>
<string name="self_check_name_system_supported">Android-Version unterstützt:</string>
<string name="self_check_resolution_system_supported">Deine Android-Version wird nicht offiziell unterstützt. Das heißt jedoch nicht, dass etwas nicht funktioniert.</string>
<string name="self_check_name_nlp_package_name">System unterstützt Ortungsdienste:</string>
<string name="self_check_resolution_nlp_package_name">Dein System unterstützt diese Version von UnifiedNlp nicht. Installiere eine andere Version oder nutze ein Xposed-Modul zur Kompatibilität.</string>
<string name="self_check_cat_nlp_status">UnifiedNlp Status</string>
<string name="self_check_name_nlp_bound">UnifiedNlp ist im system registriert:</string>
<string name="self_check_resolution_nlp_bound">Das Betriebssystem hat sich nicht mit UnifiedNlp verbunden. Wenn du UnifiedNlp gerade erst installiert hast, probiere dein Gerät neuzustarten.</string>
<string name="self_check_name_nlp_setup">Ortungsdienst(e) eingerichtet:</string>
<string name="self_check_resolution_nlp_setup">Installiere und konfiguriere ein UnifiedNlp Ortungsdienst um Funknetz-basierte Ortung zu nutzen.</string>
<string name="self_check_name_last_location">UnifiedNlp Ortung erfolgreich:</string>
<string name="self_check_resolution_last_location">UnifiedNlp konnte bisher keine Ortung durchführen. Einige Anwendungen könnten dadurch Probleme haben.</string>
<string name="self_check_name_nlp_is_providing">UnifiedNlp erneuert die Ortung:</string>
<string name="self_check_resolution_nlp_is_providing">UnifiedNlp hat in den letzten 10 Sekunden keine Ortung durchführen können.</string>
<string name="self_check_name_network_enabled">Funknetz-basierte Ortung aktiv:</string>
<string name="self_check_resolution_network_enabled">Entweder ist die Funknetz-basierte Ortung (in den System-Einstellungen) deaktiviert oder dein System unterstützt dies nicht.</string>
<string name="self_check_loc_perm_missing">Die Berechtigung zum Zugriff auf den Ort wurde nicht gestattet.</string>
<string name="prefcat_about">Infos</string>
<string name="pref_about_title">Über microG UnifiedNlp</string>
<string name="pref_about_summary">Versionsinformationen und genutzte Bibliotheken</string>
<string name="nlp_version_default">für Systeme ohne Google Apps</string>
<string name="nlp_version_legacy">für alte Systeme ohne Google Apps</string>
<string name="nlp_version_custom">für angepasste Systeme</string>
<string name="self_check_geocoder_no_location">UnifiedNlp konnte keine Ortung durchführen um die Adressauflösung zu testen.</string>
<string name="self_check_geocoder_verify_backend">Bitte prüfe deinen Ortungsdienst</string>
<string name="self_check_name_nlp_geocoder_is_providing_addresses">Adressauflösung an aktuellem Ort möglich:</string>
<string name="self_check_resolution_nlp_geocoder_no_address">Der Adressauflösungsdienst hat zur aktuellen Position keine Adressdaten bereitgestellt. Bitte installiere und konfiguriere einen Adressauflösungsdienst.</string>
<string name="self_check_resolution_nlp_geocoder_no_address_timeout">Der Adressauflösungsdienst hat binnen 10 Sekunden kein Ergebnis geliefert.</string>
</resources>

View File

@ -1,66 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ 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.
-->
<resources>
<string name="nlp_app_name">UnifiedNlp</string>
<string name="nlp_settings_label">Agordoj de UnifiedNlp</string>
<string name="add_backend">Aldoni subservon</string>
<string name="configure_location_backends">Agordi pozici-trovajn subservojn</string>
<string name="configure_geocoder_backends">Agordi adres-trovajn subservojn</string>
<string name="network_location">Ret-bazita pozici-trovado</string>
<string name="geocoding">Adres-elserĉado</string>
<string name="configure_backends">Agordi subservojn</string>
<string name="configure_location_backends_summary">
Aktivigu, malaktivigu kaj agordu subservojn por ret-bazita pozici-trovado. </string>
<string name="configure_geocoder_backends_summary">
Aktivigu, malaktivigu kaj agordu subservojn por elserĉado de adresoj.</string>
<string name="perm_force_coarse_location_label">devigi proksimuman pozicion</string>
<string name="perm_force_coarse_location_desc">Devigas al ret-bazita liverilo de pozicio raporti certan pozicion</string>
<string name="self_check_cat_nlpcompat">Subteno por ret-bazita liverilo de pozicio</string>
<string name="self_check_name_system_supported">Androida versio subtenata:</string>
<string name="self_check_resolution_system_supported">Versio de via Androida sistemo ne estas oficiale subtenata. Tio ĉi eĉ ne gravas.</string>
<string name="self_check_name_nlp_package_name">Sistemo subtenas liverilon de pozicio:</string>
<string name="self_check_resolution_nlp_package_name">Via sistemo ne subtenas tiun ĉi UnifieldNlp pakaĵon. Aŭ instalu kongruan pakaĵon, aŭ kongruigan modulon Xposed.</string>
<string name="self_check_cat_nlp_status">Stato de UnifiedNlp</string>
<string name="self_check_name_nlp_bound">UnifiedNlp estas registrita en sistemo:</string>
<string name="self_check_resolution_nlp_bound">La sistemo ne kuniĝis kun servo UnifieldNlp. Se vi ĵus instalis servon UnifieldNlp, provu restartigi la aparaton.</string>
<string name="self_check_name_nlp_setup">Pozici-trova(j) subservo(j) agordita(j):</string>
<string name="self_check_resolution_nlp_setup">Instalu kaj agordu UnifieldNlp pozici-trovan subservon por uzi ret-bazitan pozici-trovadon.</string>
<string name="self_check_name_last_location">UnifiedNlp trovis pozicion:</string>
<string name="self_check_resolution_last_location">UnifiedNlp ne trovis lastatempe pozicion. Tio ĉi kaŭzos problemojn kun iuj programoj.</string>
<string name="self_check_name_nlp_is_providing">UnifiedNlp liveras aktualigojn de pozicio:</string>
<string name="self_check_resolution_nlp_is_providing">Neniu UnifieldNlp pozicio estas liverita de sistemo dum lastaj 10 sekundoj.</string>
<string name="self_check_name_network_enabled">Ret-bazita pozicio aktiva:</string>
<string name="self_check_resolution_network_enabled">Vi aŭ malaktivigis ret-bazitan pozici-travadon (per sistemaj agordoj), aŭ la sistemo ne estas subtenata.</string>
<string name="self_check_loc_perm_missing">Pozici-permeso ne estas jam akirita</string>
<string name="prefcat_about">Pri</string>
<string name="pref_about_title">Pri microG UnifiedNlp</string>
<string name="pref_about_summary">Informoj pri versio kaj uzataj bibliotekoj</string>
<string name="nlp_version_default">por normaj sistemoj sen GAPPS</string>
<string name="nlp_version_legacy">por malnovaj sistemoj sen GAPPS</string>
<string name="nlp_version_custom">por tajloritaj sistemoj</string>
<string name="self_check_geocoder_no_location">UnifiedNlp ne konas pozicion por testi adres-trovan subservon</string>
<string name="self_check_geocoder_verify_backend">Bonvolu kontroli vian pozici-trovan subservon</string>
<string name="self_check_name_nlp_geocoder_is_providing_addresses">Adres-trova servo liveras adreson el la pozicio:</string>
<string name="self_check_resolution_nlp_geocoder_no_address">Ne povas trovi adreson. Bonvolu instali kaj agordi adres-trovan subservon.</string>
<string name="self_check_resolution_nlp_geocoder_no_address_timeout">Adres-trova subservo ne liveris adreson dum 10 sekundoj.</string>
</resources>

View File

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ 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.
-->
<resources>
</resources>

View File

@ -1,68 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ 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.
-->
<resources>
<string name="nlp_app_name">UnifiedNlp</string>
<string name="nlp_settings_label">Paramètres UnifiedNlp</string>
<string name="add_backend">Ajouter un fournisseur</string>
<string name="configure_location_backends">Configurer les fournisseurs de géolocalisation</string>
<string name="configure_geocoder_backends">Configurer les fournisseurs de géocodage</string>
<string name="network_location">Géolocalisation réseau</string>
<string name="geocoding">Géocodage</string>
<string name="configure_backends">Configurer les fournisseurs</string>
<string name="configure_location_backends_summary">
Activer, désactiver et configurer les fournisseurs de géolocalisation réseau.
</string>
<string name="configure_geocoder_backends_summary">
Activer, désactiver et configurer les fournisseurs de géocodage.
</string>
<string name="perm_force_coarse_location_label">Forcer une localisation approximative</string>
<string name="perm_force_coarse_location_desc">Forcer la géolocalisation réseau à présenter une certaine position</string>
<string name="self_check_cat_nlpcompat">Support de la géolocalisation réseau</string>
<string name="self_check_name_system_supported">Version dAndroid supportée :</string>
<string name="self_check_resolution_system_supported">Votre version dAndroid nest pas officiellement supportée. Cela na pas forcément dimportance.</string>
<string name="self_check_name_nlp_package_name">Support système de la géolocalisation réseau :</string>
<string name="self_check_resolution_nlp_package_name">Votre système ne supporte pas ce paquet UnifiedNlp. Installez un paquet adéquat ou un module Xposed de compatibilité.</string>
<string name="self_check_cat_nlp_status">Status dUnifiedNlp</string>
<string name="self_check_name_nlp_bound">UnifiedNlp est enregistré auprès du système :</string>
<string name="self_check_resolution_nlp_bound">Le système na pas établi de liaison avec le service UnifiedNlp. Si vous venez juste dinstaller UnifiedNlp, vous devriez redémarrer votre terminal.</string>
<string name="self_check_name_nlp_setup">Fournisseur(s) de localisation configuré(s) :</string>
<string name="self_check_resolution_nlp_setup">Installez et configurez un fournisseur de localisation UnifiedNlp afin dutiliser la géolocalisation réseau.</string>
<string name="self_check_name_last_location">UnifiedNlp connaît la position :</string>
<string name="self_check_resolution_last_location">UnifiedNlp na pas de dernière position connue. Cela entraînera un échec de fonctionnement de certaines applications.</string>
<string name="self_check_name_nlp_is_providing">UnifiedNlp fournit des mises à jour de la position :</string>
<string name="self_check_resolution_nlp_is_providing">UnifiedNlp na pas fourni de position au système dans un intervalle de 10 secondes.</string>
<string name="self_check_name_network_enabled">Géolocalisation réseau activée :</string>
<string name="self_check_resolution_network_enabled">Vous avez désactivé la géolocalisation réseau (dans les paramètres systèmes) ou bien votre système nest pas supporté.</string>
<string name="self_check_loc_perm_missing">Lautorisation daccès à la position na pas (encore) été accordée.</string>
<string name="prefcat_about">À propos</string>
<string name="pref_about_title">À propos de microG UnifiedNlp</string>
<string name="pref_about_summary">Informations de version et librairies utilisées</string>
<string name="nlp_version_default">pour systèmes standards sans GAPPS</string>
<string name="nlp_version_legacy">pour anciens systèmes sans GAPPS</string>
<string name="nlp_version_custom">pour systèmes personnalisés</string>
<string name="self_check_geocoder_no_location">UnifiedNlp na pas de position pour tester le géocodeur.</string>
<string name="self_check_geocoder_verify_backend">Veuillez vérifier votre fournisseur de géolocalisation.</string>
<string name="self_check_name_nlp_geocoder_is_providing_addresses">Le géocodeur fournit une résolution dadresse à partir de la position :</string>
<string name="self_check_resolution_nlp_geocoder_no_address">Le géocodeur na pas fournit de résolution dadresse. Veuillez installer et configurer un fournisseur de géocodage.</string>
<string name="self_check_resolution_nlp_geocoder_no_address_timeout">Le géocodeur na pas fournit de résolution dadresse dans un intervalle de 10 secondes.</string>
</resources>

View File

@ -1,66 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ 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.
-->
<resources>
<string name="nlp_app_name">UnifiedNlp</string>
<string name="nlp_settings_label">Ustawienia UnifiedNlp</string>
<string name="add_backend">Dodaj usługę</string>
<string name="configure_location_backends">Konfiguruj usługi lokalizacyjne</string>
<string name="configure_geocoder_backends">Konfiguruj usługi wyszukiwania adresów</string>
<string name="network_location">Geolokalizacja oparta o sieć</string>
<string name="geocoding">Wyszukiwanie adresów</string>
<string name="configure_backends">Konfiguruj usługi</string>
<string name="configure_location_backends_summary">
Włącz, wyłącz i skonfiguruj usługi geolokalizacji opartej o sieć.</string>
<string name="configure_geocoder_backends_summary">
Włącz, wyłącz i skonfiguruj usługi wyszukiwania adresów. </string>
<string name="perm_force_coarse_location_label">wymuś przybliżoną lokalizację</string>
<string name="perm_force_coarse_location_desc">Wymuś raportowanie przez dostawcę lokalizacji opartej o sieć</string>
<string name="self_check_cat_nlpcompat">Wsparcie dla dostawcy lokalizacji opartej o sieć</string>
<string name="self_check_name_system_supported">Wspierana wersja Androida:</string>
<string name="self_check_resolution_system_supported">Twoja wersja systemu Android nie jest oficjalnie wspierana. W gruncie rzeczy nie ma to znaczenia.</string>
<string name="self_check_name_nlp_package_name">System wspiera dostawcę lokalizacji:</string>
<string name="self_check_resolution_nlp_package_name">Twój system nie wspiera tej paczki UnifieldNlp. Albo zainstaluj odpowiednią paczkę, albo moduł kompatybilności Xposed.</string>
<string name="self_check_cat_nlp_status">Stan UnifiedNlp</string>
<string name="self_check_name_nlp_bound">UnifiedNlp jest zarejestrowany w systemie:</string>
<string name="self_check_resolution_nlp_bound">Usługa UnifieldNlp nie została powiązana z systemem. Jeżeli dopiero co zainstalowałeś UnifildNlp, powinieneś spróbować zrestartować urządzenie.</string>
<string name="self_check_name_nlp_setup">Usługa lokalizacji skonfigurowana:</string>
<string name="self_check_resolution_nlp_setup">Zainstaluj i skonfiguruj usługę dostawcy lokalizacji UnifieldNlp, aby móc korzystać z lokalizacji opartej na sieć.</string>
<string name="self_check_name_last_location">UnifiedNlp określił lokalizację:</string>
<string name="self_check_resolution_last_location">UnifiedNlp nie określił ostatnio lokalizacji. To sprawi problemy w niektórych aplikacjach.</string>
<string name="self_check_name_nlp_is_providing">UnifiedNlp dostarcza aktualizacje lokalizacji:</string>
<string name="self_check_resolution_nlp_is_providing">Nie została dostarczona żadna lokalizacja UnifieldNlp przez system w ciągu ostatnich 10 sekund.</string>
<string name="self_check_name_network_enabled">Lokalizacja oparta o sieć włączona:</string>
<string name="self_check_resolution_network_enabled">Albo wyłączyłeś lokalizację opartą o sieć (w ustawieniach systemu), albo Twój system nie jest wspierany.</string>
<string name="self_check_loc_perm_missing">Uprawnienie lokalizacji nie zostało jeszcze przydzielone</string>
<string name="prefcat_about">O programie</string>
<string name="pref_about_title">O microG UnifiedNlp</string>
<string name="pref_about_summary">Informacje o wersji i użytych bibliotekach</string>
<string name="nlp_version_default">dla nowszych systemów bez GAPPS</string>
<string name="nlp_version_legacy">dla starszych systemów bez GAPPS</string>
<string name="nlp_version_custom">dla dostosowanych systemów</string>
<string name="self_check_geocoder_no_location">UnifiedNlp nie dysponuje pozycją, aby sprawdzić usługę wyszukiwania adresów</string>
<string name="self_check_geocoder_verify_backend">Proszę skontrolować usługę geolokalizacji</string>
<string name="self_check_name_nlp_geocoder_is_providing_addresses">Usługa wyszukiwania adresów znalazła adres:</string>
<string name="self_check_resolution_nlp_geocoder_no_address">Nie można odczytać adresu. Prosimy zainstalować i skonfigurować usługę wyszukiwania adresów.</string>
<string name="self_check_resolution_nlp_geocoder_no_address_timeout">Usługa wyszukiwania adresów nie dostarczyła adresu w ciągu 10 sekund.</string>
</resources>

View File

@ -1,35 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ 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.
-->
<resources>
<string name="nlp_app_name">Nlp Unificat</string>
<string name="nlp_settings_label">Setări Nlp Unificat</string>
<string name="add_backend">Adăugaţi un motor</string>
<string name="configure_location_backends">Configuraţi motoarele de localizare</string>
<string name="configure_geocoder_backends">Configuraţi motoarele de căutare a adreselor</string>
<string name="network_location">Localizare geografică bazată pe rețea</string>
<string name="geocoding">Căutare adrese</string>
<string name="configure_backends">Configuraţi motoarele</string>
<string name="configure_location_backends_summary">
Activaţi, dezactivaţi şi configuraţi motoarele pentru localizare geografică bazată pe rețea.
</string>
<string name="configure_geocoder_backends_summary">
Activaţi, dezactivaţi şi configuraţi motoarele pentru căutarea adreselor.
</string>
<string name="perm_force_coarse_location_label">impunere locație aproximativă</string>
<string name="perm_force_coarse_location_desc">Se impune furnizorului de locaţie bazată pe reţea să raporteze o anumită locație</string>
</resources>

View File

@ -1,69 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ 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.
-->
<resources>
<string name="nlp_app_name">UnifiedNlp</string>
<string name="nlp_settings_label">Настройки UnifiedNlp</string>
<string name="add_backend">Добавить backend-программу</string>
<string name="configure_location_backends">Backend-программы определения местоположения</string>
<string name="configure_geocoder_backends">Backend-программы поиска адреса</string>
<string name="network_location">Местоположение по сети</string>
<string name="geocoding">Поиск адреса</string>
<string name="configure_backends">Настроить backend-программы</string>
<string name="configure_location_backends_summary">
Включить, отключить и настроить программы для определения местоположениея по сети.
</string>
<string name="configure_geocoder_backends_summary">
Включить, отключить и настроить программы для поиска адреса.
</string>
<string name="perm_force_coarse_location_label">определение приблизительного местоположения</string>
<string name="perm_force_coarse_location_desc">Принудительно использовать сеть для определения местоположения</string>
<string name="self_check_cat_nlpcompat">Поддержка провайдеров местонахождения по сети</string>
<string name="self_check_name_system_supported">Версия Android поддерживается:</string>
<string name="self_check_resolution_system_supported">Ваша версия Android официально не поддерживается. Это не обязательно должно что-то значить.</string>
<string name="self_check_name_nlp_package_name">Система поддерживает провайдеров местонахождения:</string>
<string name="self_check_resolution_nlp_package_name">Ваша система не поддерживает этот UnifiedNlp. Установите совместимый или модуль Xposed.</string>
<string name="self_check_cat_nlp_status">Статус UnifiedNlp</string>
<string name="self_check_name_nlp_bound">UnifiedNlp зарегистрирован в системе:</string>
<string name="self_check_resolution_nlp_bound">Не запускаються сервисы UnifiedNlp. Если вы только что установили UnifiedNlp, то перезагрузите устройство.</string>
<string name="self_check_name_nlp_setup">Backend-программы для местоположения настроены:</string>
<string name="self_check_resolution_nlp_setup">Установите и настройте UnifiedNlp backend-программу для использования местоположения по сети.</string>
<string name="self_check_name_last_location">UnifiedNlp знает ваше местоположение:</string>
<string name="self_check_resolution_last_location">UnifiedNlp не знает вашего местоположения. Это может вызвать ошибки в некоторых приложениях.</string>
<string name="self_check_name_nlp_is_providing">UnifiedNlp обеспечивает обновление местоположения:</string>
<string name="self_check_resolution_nlp_is_providing">Местоположение не было предоставлено системой в течение 10 секунд.</string>
<string name="self_check_name_network_enabled">Местоположение по сети включено:</string>
<string name="self_check_resolution_network_enabled">Отключено нахождение местоположение по сети (в настройках системы) или система не поддерживается.</string>
<string name="self_check_loc_perm_missing">Разрешение на доступ к местоположению еще не предоставлено.</string>
<string name="prefcat_about">О программе</string>
<string name="pref_about_title">О microG UnifiedNlp</string>
<string name="pref_about_summary">Информация о версии и используемые библиотеки</string>
<string name="nlp_version_default">для прошивок по умолчанию без GAPPS</string>
<string name="nlp_version_legacy">для устаревших прошивок без GAPPS</string>
<string name="nlp_version_custom">для кастомных прошивок</string>
<string name="self_check_geocoder_no_location">UnifiedNlp не имеет местоположения для тестирования геокодера</string>
<string name="self_check_geocoder_verify_backend">Пожалуйста, проверьте backend-программы определения местоположения</string>
<string name="self_check_name_nlp_geocoder_is_providing_addresses">Геокодер предоставляет анализ адреса из местоположения:</string>
<string name="self_check_resolution_nlp_geocoder_no_address">Геокодер не предоставляет анализ адреса. Пожалуйста, установите и настройте программу-backend для поиска адреса.</string>
<string name="self_check_resolution_nlp_geocoder_no_address_timeout">>Геокодер не предоставляет анализ адреса в течении 10 секунд.</string>
</resources>

View File

@ -1,61 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ 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.
-->
<resources>
<string name="nlp_app_name">Обједињени МПЛ</string>
<string name="nlp_settings_label">Поставке Обједињеног МПЛ</string>
<string name="add_backend">Додај мотор</string>
<string name="configure_location_backends">Поставке мотора за локацију</string>
<string name="configure_geocoder_backends">Поставке мотора за потрагу адреса</string>
<string name="network_location">Мрежна геолокација</string>
<string name="geocoding">Потрага адресе</string>
<string name="configure_backends">Подеси моторе</string>
<string name="configure_location_backends_summary">
Укључење, искључење и подешавање мотора за мрежну геолокацију.
</string>
<string name="configure_geocoder_backends_summary">
Укључење, искључење и подешавање мотора за мрежну потрагу адресе.
</string>
<string name="perm_force_coarse_location_label">присиљавање приближне локације</string>
<string name="perm_force_coarse_location_desc">Присиљавање мотора за мрежну локацију да пријави одређену локацију</string>
<string name="self_check_cat_nlpcompat">Подршка за Мрежне Провајдере Локације</string>
<string name="self_check_name_system_supported">Издање Андроида подржано:</string>
<string name="self_check_resolution_system_supported">Ваше издање Андроида није службено подржано. Ово нужно не мора да значи ништа.</string>
<string name="self_check_name_nlp_package_name">Систем подржава провајдере локације:</string>
<string name="self_check_resolution_nlp_package_name">Ваш систем не подржава овај пакет Обједињеног МПЛ. Или инсталирајте одговарајући пакет или Xposed модул за компатибилност.</string>
<string name="self_check_cat_nlp_status">Стање Обједињеног МПЛ-а</string>
<string name="self_check_name_nlp_bound">Обједињени МПЛ је регистрован у систему:</string>
<string name="self_check_resolution_nlp_bound">Систем се није повезао са услугом Обједињеног МПЛ-а. Ако сте инсталирали Обједињени МПЛ покушајте са рестартом уређаја.</string>
<string name="self_check_name_nlp_setup">Мотори локације подешени:</string>
<string name="self_check_resolution_nlp_setup">Инсталирајте и подесите мотор за Обједињени МПЛ да бисте користили мрежну геолокацију,</string>
<string name="self_check_name_last_location">Обједињени МПЛ има познату локацију:</string>
<string name="self_check_resolution_last_location">Обједињени МПЛ нема последњу познату локацију. Неке апликације ће краховати због овога.</string>
<string name="self_check_name_nlp_is_providing">Обједињени МПЛ пружа освежавања локације:</string>
<string name="self_check_resolution_nlp_is_providing">Систем није пружио ниједну локацију Обједињеног МПЛ-а у последњих 10 секунди.</string>
<string name="self_check_name_network_enabled">Мрежна локација укључена:</string>
<string name="self_check_resolution_network_enabled">Или сте искључили мрежну локацију (у поставкама система) или систем није подржан.</string>
<string name="self_check_loc_perm_missing">Дозвола за локацију још није одобрена</string>
<string name="prefcat_about">О програму</string>
<string name="pref_about_title">О микроГ Обједињеном МПЛ-у</string>
<string name="pref_about_summary">Подаци о издању и коришћеним библиотекама</string>
<string name="nlp_version_default">за преподешене системе без Гуглових апликација</string>
<string name="nlp_version_legacy">за застареле системе без Гуглових апликација</string>
<string name="nlp_version_custom">за прилагођене системе</string>
</resources>

View File

@ -1,66 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ 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.
-->
<resources>
<string name="nlp_app_name">UnifiedNlp</string>
<string name="nlp_settings_label">Налаштування UnifiedNlp</string>
<string name="add_backend">Додати сервер</string>
<string name="configure_location_backends">Сконфігурувати сервер позиціювання</string>
<string name="configure_geocoder_backends">Сконфігурувати сервер пошуку адрес</string>
<string name="network_location">Географічне позиціювання на основі мереж</string>
<string name="geocoding">Пошук адрес</string>
<string name="configure_backends">Конфігурація серверів</string>
<string name="configure_location_backends_summary">
Вмикання, вимикання чи конфігурування серверів позиціювання на основі мережі.</string>
<string name="configure_geocoder_backends_summary">
Вмикання, вимикання чи конфігурування серверів для пошуку адрес.</string>
<string name="perm_force_coarse_location_label">визначення приблизного позиціювання</string>
<string name="perm_force_coarse_location_desc">Примусово використовувати сервер позиціювання на основі мереж для визначення місцеперебування</string>
<string name="self_check_cat_nlpcompat">Підтримка постачальників позиціювання на основі мереж</string>
<string name="self_check_name_system_supported">Підтримка версії Android:</string>
<string name="self_check_resolution_system_supported">Ваша версія Android не підтримується офіційно. Проте це ще нічого не означає.</string>
<string name="self_check_name_nlp_package_name">Підтримка постачальників позиціювання системою:</string>
<string name="self_check_resolution_nlp_package_name">Ваша система не підтримує поточний додаток UnifiedNlp. Встановіть сумісну версію, або ж відповідний Xposed модуль.</string>
<string name="self_check_cat_nlp_status">Стан UnifiedNlp</string>
<string name="self_check_name_nlp_bound">Реєстрація UnifiedNlp в системі:</string>
<string name="self_check_resolution_nlp_bound">Система не визначає сервіс UnifiedNlp. Якщо ви щойно встановили UnifiedNlp, спробуйте перезавантажити пристрій.</string>
<string name="self_check_name_nlp_setup">Налаштування серверу(ів) позиціювання:</string>
<string name="self_check_resolution_nlp_setup">Встановіть та сконфігуруйте UnifiedNlp сервери позиціювання для визначення місцеперебування на основі мереж.</string>
<string name="self_check_name_last_location">Визначення UnifiedNlp місцеперебування:</string>
<string name="self_check_resolution_last_location">UnifiedNlp не визначив місцеперебування. Це може викликати проблеми в деяких додатках.</string>
<string name="self_check_name_nlp_is_providing">Забезпечення оновленням позиціювання UnifiedNlp:</string>
<string name="self_check_resolution_nlp_is_providing">На протязі 10 секунд не було отримано місцеперебування від системи.</string>
<string name="self_check_name_network_enabled">Стан позиціювання на основі мереж:</string>
<string name="self_check_resolution_network_enabled">Вимкнено позиціювання на основі мереж (в системних налаштуваннях) або система не підтримується.</string>
<string name="self_check_loc_perm_missing">Дозвіл на отримання позиціювання ще не надано</string>
<string name="prefcat_about">Про</string>
<string name="pref_about_title">Про microG UnifiedNlp</string>
<string name="pref_about_summary">Версія та використані бібліотеки</string>
<string name="nlp_version_default">для типових систем без GAPPS</string>
<string name="nlp_version_legacy">для застарілих систем без GAPPS</string>
<string name="nlp_version_custom">для нетипових систем</string>
<string name="self_check_geocoder_no_location">UnifiedNlp не отримав місцеперебування для тестування геокодування</string>
<string name="self_check_geocoder_verify_backend">Будь ласка, перевірте сервер позиціювання</string>
<string name="self_check_name_nlp_geocoder_is_providing_addresses">Пошук адреси геокодером з місцеперебування:</string>
<string name="self_check_resolution_nlp_geocoder_no_address">Геокодер не визначив адресу. Будь ласка, встановіть та налаштуйте сервер пошуку адрес.</string>
<string name="self_check_resolution_nlp_geocoder_no_address_timeout">На протязі 10 секунд геокодер не надав визначеної адреси.</string>
</resources>

View File

@ -1,61 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ 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.
-->
<resources>
<string name="nlp_app_name">UnifiedNlp</string>
<string name="nlp_settings_label">UnifiedNlp設定</string>
<string name="add_backend">新增背景伺服器</string>
<string name="configure_location_backends">設定地點背景伺服器</string>
<string name="configure_geocoder_backends">設定地址查閱背景伺服器</string>
<string name="network_location">基於網路的地理位置定位</string>
<string name="geocoding">地址查閱</string>
<string name="configure_backends">設定背景伺服器</string>
<string name="configure_location_backends_summary">
為基於網路的地理位置定位啟用,停用或設定背景伺服器。
</string>
<string name="configure_geocoder_backends_summary">
為地址查閱啟用,停用或設定背景伺服器。
</string>
<string name="perm_force_coarse_location_label">強制啟用精準位置</string>
<string name="perm_force_coarse_location_desc">強制基於網路的地點供應者回報一個精確的地點</string>
<string name="self_check_cat_nlpcompat">是否支援網路的地點供應者</string>
<string name="self_check_name_system_supported">支援的Android版本</string>
<string name="self_check_resolution_system_supported">您的Android版本並不被正式支援。這並不一定代表什麼。</string>
<string name="self_check_name_nlp_package_name">系統支援地點供應者:</string>
<string name="self_check_resolution_nlp_package_name">您的系統並不支援這個UnifiedNlp程式。安裝正確的程式或相容的Xposed模組。</string>
<string name="self_check_cat_nlp_status">UnifiedNlp狀態</string>
<string name="self_check_name_nlp_bound">UnifiedNlp已註冊到系統</string>
<string name="self_check_resolution_nlp_bound">系統尚未綁定UnifiedNlp服務。 如果您剛剛安裝UnifiedNlp您應該試著重啟設備。</string>
<string name="self_check_name_nlp_setup">地點背景伺服器設定:</string>
<string name="self_check_resolution_nlp_setup">安裝或設定一個UnifiedNlp地點背景伺服器以使用基於網路的地理位置定位。</string>
<string name="self_check_name_last_location">UnifiedNlp有已知地點</string>
<string name="self_check_resolution_last_location">UnifiedNlp無最後已知地點。這可能導致某些程式無法運作。</string>
<string name="self_check_name_nlp_is_providing">UnifiedNlp提供地點更新</string>
<string name="self_check_resolution_nlp_is_providing">這10秒內並沒有系統提供的UnifiedNlp位置。</string>
<string name="self_check_name_network_enabled">啟用基於網路的位置定位:</string>
<string name="self_check_resolution_network_enabled">您不是在系統設定中停用了基於網路的位置定位就是系統不支援。</string>
<string name="self_check_loc_perm_missing">尚未允許定位權限</string>
<string name="prefcat_about">關於</string>
<string name="pref_about_title">關於microG UnifiedNlp</string>
<string name="pref_about_summary">版本資訊和使用的程式庫</string>
<string name="nlp_version_default">給沒有GAPPS的支援系統</string>
<string name="nlp_version_legacy">給沒有GAPPS的舊系統</string>
<string name="nlp_version_custom">給第三方系統</string>
</resources>

View File

@ -1,71 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ 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.
-->
<resources>
<string name="nlp_app_name">UnifiedNlp</string>
<string name="nlp_settings_label">UnifiedNlp Settings</string>
<string name="add_backend">Add backend</string>
<string name="configure_location_backends">Configure location backends</string>
<string name="configure_geocoder_backends">Configure address lookup backends</string>
<string name="network_location">Network-based Geolocation</string>
<string name="geocoding">Address lookup</string>
<string name="configure_backends">Configure backends</string>
<string name="configure_location_backends_summary">
Enable, disable and configure backends for network based geolocation.
</string>
<string name="configure_geocoder_backends_summary">
Enable, disable and configure backends for address lookup.
</string>
<string name="perm_force_coarse_location_label">enforce approximate location</string>
<string name="perm_force_coarse_location_desc">Force the network-based location provider to report a certain location</string>
<string name="pref_location_backends" translatable="false">location_backends</string>
<string name="pref_geocoder_backends" translatable="false">geocoder_backends</string>
<string name="self_check_cat_nlpcompat">Network location provider support</string>
<string name="self_check_name_system_supported">Android version supported:</string>
<string name="self_check_resolution_system_supported">Your Android version is not officially supported. This does not necessarily mean anything.</string>
<string name="self_check_name_nlp_package_name">System supports location provider:</string>
<string name="self_check_resolution_nlp_package_name">Your system does not support this UnifiedNlp package. Either install a matching package or a compatibility Xposed module.</string>
<string name="self_check_cat_nlp_status">UnifiedNlp status</string>
<string name="self_check_name_nlp_bound">UnifiedNlp is registered in system:</string>
<string name="self_check_resolution_nlp_bound">The system did not bind the UnifiedNlp service. If you just installed UnifiedNlp you should try to reboot this device.</string>
<string name="self_check_name_nlp_setup">Location backend(s) set up:</string>
<string name="self_check_resolution_nlp_setup">Install and configure a UnifiedNlp location backend to use network-based geolocation.</string>
<string name="self_check_name_last_location">UnifiedNlp has known location:</string>
<string name="self_check_resolution_last_location">UnifiedNlp has no last known location. This will cause some apps to fail.</string>
<string name="self_check_name_nlp_is_providing">UnifiedNlp provides location updates:</string>
<string name="self_check_resolution_nlp_is_providing">No UnifiedNlp location was provided by the system within 10 seconds.</string>
<string name="self_check_name_network_enabled">Network-based location enabled:</string>
<string name="self_check_resolution_network_enabled">You either disabled network-based location (in system settings) or the system is not supported.</string>
<string name="self_check_loc_perm_missing">Location permission not yet granted</string>
<string name="prefcat_about">About</string>
<string name="pref_about_title">About microG UnifiedNlp</string>
<string name="pref_about_summary">Version information and used libraries</string>
<string name="nlp_version_default">for default systems without GAPPS</string>
<string name="nlp_version_legacy">for legacy systems without GAPPS</string>
<string name="nlp_version_custom">for custom systems</string>
<string name="self_check_geocoder_no_location">UnifiedNlp do not have Location to test Geocoder</string>
<string name="self_check_geocoder_verify_backend">Please verify your location Backend</string>
<string name="self_check_name_nlp_geocoder_is_providing_addresses">Geocoder provides address resolution from location:</string>
<string name="self_check_resolution_nlp_geocoder_no_address">Geocoder did not provide address resolution. Please install and configure an address lookup Backend.</string>
<string name="self_check_resolution_nlp_geocoder_no_address_timeout">Geocoder did not provide address resolution within 10 seconds.</string>
</resources>

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ 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.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory android:title="@string/prefcat_about">
<Preference
android:key="@string/pref_about_title"
android:summary="@string/pref_about_summary"
android:title="@string/pref_about_title">
</Preference>
</PreferenceCategory>
</PreferenceScreen>

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ 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.
-->
<injected-location-setting xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/nlp_settings_label"
android:icon="@mipmap/ic_nlp_settings"
android:settingsActivity="org.microg.nlp.ui.SettingsActivity" />

View File

@ -1,31 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ 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.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:key="nlp_preferences">
<PreferenceCategory android:title="@string/network_location">
<org.microg.nlp.ui.LocationBackendPreference
android:key="@string/pref_location_backends"
android:title="@string/configure_backends"
android:summary="@string/configure_location_backends_summary" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/geocoding">
<org.microg.nlp.ui.GeocoderBackendPreference
android:key="@string/pref_geocoder_backends"
android:title="@string/configure_backends"
android:summary="@string/configure_geocoder_backends_summary" />
</PreferenceCategory>
</PreferenceScreen>

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ 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.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:key="nlp_self_check_preferences">
<PreferenceCategory android:title="@string/prefcat_setup">
<Preference
android:key="@string/self_check_title"
android:summary="@string/self_check_desc"
android:title="@string/self_check_title">
</Preference>
</PreferenceCategory>
</PreferenceScreen>