mirror of
https://github.com/syncthing/syncthing-android.git
synced 2025-01-07 10:42:07 +00:00
Add tip - Workaround for device disconnected on Huawei
* Update APK version to 0.14.51.9 / 4172 * Add tip - Workaround for device disconnected on Huawei
This commit is contained in:
parent
200f50e940
commit
f3dac90124
4 changed files with 45 additions and 2 deletions
|
@ -36,8 +36,8 @@ android {
|
|||
applicationId "com.github.catfriend1.syncthingandroid"
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 26
|
||||
versionCode 4171
|
||||
versionName "0.14.51.8"
|
||||
versionCode 4172
|
||||
versionName "0.14.51.9"
|
||||
testApplicationId 'com.github.catfriend1.syncthingandroid.test'
|
||||
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
|
||||
playAccountConfig = playAccountConfigs.defaultAccountConfig
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
package com.nutomic.syncthingandroid.activities;
|
||||
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.net.wifi.WifiManager;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.text.format.Formatter;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
|
@ -55,6 +59,16 @@ public class TipsAndTricksActivity extends SyncthingActivity {
|
|||
mTipListAdapter.add(getString(R.string.tip_sync_on_local_network_title), getString(R.string.tip_sync_on_local_network_text));
|
||||
mTipListAdapter.add(getString(R.string.tip_custom_sync_conditions_title), getString(R.string.tip_custom_sync_conditions_text));
|
||||
|
||||
// Tips referring to Huawei devices.
|
||||
if ("huawei".equalsIgnoreCase(Build.MANUFACTURER)) {
|
||||
String ipAddress = getString(R.string.tip_phone_ip_address_syntax);
|
||||
if (isWifiOrEthernetConnection()) {
|
||||
WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(WIFI_SERVICE);
|
||||
ipAddress = Formatter.formatIpAddress(wifiManager.getConnectionInfo().getIpAddress());
|
||||
}
|
||||
mTipListAdapter.add(getString(R.string.tip_huawei_device_disconnected_title), getString(R.string.tip_huawei_device_disconnected_text, ipAddress));
|
||||
}
|
||||
|
||||
// Set onClick listener and add adapter to recycler view.
|
||||
mTipListAdapter.setOnClickListener(
|
||||
new ItemClickListener() {
|
||||
|
@ -72,4 +86,25 @@ public class TipsAndTricksActivity extends SyncthingActivity {
|
|||
mRecyclerView.setAdapter(mTipListAdapter);
|
||||
}
|
||||
|
||||
private boolean isWifiOrEthernetConnection() {
|
||||
ConnectivityManager cm = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);
|
||||
NetworkInfo ni = cm.getActiveNetworkInfo();
|
||||
if (ni == null) {
|
||||
// In flight mode.
|
||||
return false;
|
||||
}
|
||||
if (!ni.isConnected()) {
|
||||
// No network connection.
|
||||
return false;
|
||||
}
|
||||
switch (ni.getType()) {
|
||||
case ConnectivityManager.TYPE_WIFI:
|
||||
case ConnectivityManager.TYPE_WIMAX:
|
||||
case ConnectivityManager.TYPE_ETHERNET:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -299,6 +299,10 @@ Bitte melden Sie auftretende Probleme via GitHub.</string>
|
|||
<string name="tip_custom_sync_conditions_title">Sync-Bedingungen pro Ordner/Gerät festlegen</string>
|
||||
<string name="tip_custom_sync_conditions_text">Diese Funktion wird in zukünftigen Releases weiter verbessert. Für den Moment wollten wir das App-Verhalten nicht \"umstürzen\", um bestehende Konfigurationen nicht zu \"brechen\". Deshalb können die \"individuellen Sync-Bedingungen\" für einen bestimmten Netzwerktyp erst festgelegt werden, wenn dieser Netzwerktyp vorher in den globalen Laufkonditionen aktiviert wurde.</string>
|
||||
|
||||
<string name="tip_huawei_device_disconnected_title">Huawei: Workaround für \"Gerät getrennt\"</string>
|
||||
<string name="tip_huawei_device_disconnected_text">Falls der Computer das Huawei-Gerät permanent als \"getrennt\" meldet, öffne die Syncthing-Oberfläche auf dem Computer. Gehe zu \"Externe Geräte\", klappe den Eintrag des Mobilgeräts aus, klicke \"Bearbeiten\", wechsle zu \"Erweitert\". Trage die IP-Adresse deines Mobilgeräts in \"Adressen\" wie folgt ein:\ntcp4://%1$s, dynamic\nFunktioniert sicher auf: Huawei P10</string>
|
||||
<string name="tip_phone_ip_address_syntax">TELEFON_IP_ADRESSE</string>
|
||||
|
||||
<!-- WebGuiActivity -->
|
||||
|
||||
<!-- Title of the web gui activity -->
|
||||
|
|
|
@ -299,6 +299,10 @@ Please report any problems you encounter via Github.</string>
|
|||
<string name="tip_custom_sync_conditions_title">Use per folder/device custom sync conditions</string>
|
||||
<string name="tip_custom_sync_conditions_text">This feature will still be improved in future releases. For now, we didn\'t want to break existing configs and app behaviour. That\'s why custom sync conditions for a certain network type can only be set if you enable syncing on the network in the global run conditions first.</string>
|
||||
|
||||
<string name="tip_huawei_device_disconnected_title">Huawei \'device disconnected\' workaround</string>
|
||||
<string name="tip_huawei_device_disconnected_text">If your desktop constantly reports your Huawei device as disconnected, open Syncthing UI of your desktop. Go to \'remote devices\', expand the phone\'s entry, click \'Edit\', switch to \'Advanced\'. Put your phone IP address into \'Addresses\' like this:\ntcp4://%1$s, dynamic\nConfirmed working for: Huawei P10</string>
|
||||
<string name="tip_phone_ip_address_syntax">PHONE_IP_ADDRESS</string>
|
||||
|
||||
<!-- WebGuiActivity -->
|
||||
|
||||
<!-- Title of the web gui activity -->
|
||||
|
|
Loading…
Reference in a new issue