mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-12-02 01:01:17 +00:00
Add notice to "ignore battery optimizations" welcome slide for nVidia shield TV's (fixes #192) (#195)
* Add wiki article: nVidia Shield TV preparations (fixes #192) * Update wiki: line breaks * Add os notice to ignore doze permission welcome slide (fixes #192) * Add Util#containsIgnoreCase * Updated translations
This commit is contained in:
parent
21cd185d75
commit
0664c33551
10 changed files with 81 additions and 7 deletions
|
@ -41,6 +41,7 @@ import com.nutomic.syncthingandroid.SyncthingApp;
|
||||||
import com.nutomic.syncthingandroid.service.Constants;
|
import com.nutomic.syncthingandroid.service.Constants;
|
||||||
import com.nutomic.syncthingandroid.service.SyncthingRunnable.ExecutableNotFoundException;
|
import com.nutomic.syncthingandroid.service.SyncthingRunnable.ExecutableNotFoundException;
|
||||||
import com.nutomic.syncthingandroid.util.ConfigXml;
|
import com.nutomic.syncthingandroid.util.ConfigXml;
|
||||||
|
import com.nutomic.syncthingandroid.util.Util;
|
||||||
|
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
|
|
||||||
|
@ -239,7 +240,18 @@ public class FirstStartActivity extends Activity {
|
||||||
// Move to next slide.
|
// Move to next slide.
|
||||||
mViewPager.setCurrentItem(current);
|
mViewPager.setCurrentItem(current);
|
||||||
mBackButton.setVisibility(View.VISIBLE);
|
mBackButton.setVisibility(View.VISIBLE);
|
||||||
if (current == mSlidePosKeyGeneration) {
|
if (current == mSlidePosIgnoreDozePermission) {
|
||||||
|
if ("NVIDIA".equalsIgnoreCase(Build.MANUFACTURER)) {
|
||||||
|
if (Util.containsIgnoreCase(Build.MODEL, "Android TV")) {
|
||||||
|
/**
|
||||||
|
* Display workaround notice: Without workaround SyncthingNative can't run on this OS reliably.
|
||||||
|
* See issue https://github.com/Catfriend1/syncthing-android/issues/192
|
||||||
|
*/
|
||||||
|
((TextView) findViewById(R.id.tvIgnoreDozePermissionOsNotice)).setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (current == mSlidePosKeyGeneration) {
|
||||||
onKeyGenerationSlideShown();
|
onKeyGenerationSlideShown();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -283,4 +283,17 @@ public class Util {
|
||||||
public static String formatPath(String path) {
|
public static String formatPath(String path) {
|
||||||
return new File(path).toURI().normalize().getPath();
|
return new File(path).toURI().normalize().getPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean containsIgnoreCase(String src, String what) {
|
||||||
|
final int length = what.length();
|
||||||
|
if (length == 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
for (int i = src.length() - length; i >= 0; i--) {
|
||||||
|
if (src.regionMatches(true, i, what, 0, length)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,6 +51,18 @@
|
||||||
android:textSize="@dimen/slide_title"
|
android:textSize="@dimen/slide_title"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvIgnoreDozePermissionOsNotice"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingLeft="@dimen/desc_padding"
|
||||||
|
android:paddingRight="@dimen/desc_padding"
|
||||||
|
android:text="@string/ignore_doze_permission_os_notice"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textSize="@dimen/slide_desc"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|
|
@ -22,7 +22,7 @@ Ens podeu informar dels problemes que trobeu a través de Github.</string>
|
||||||
<string name="storage_permission_title">Permís d\'emmagatzematge</string>
|
<string name="storage_permission_title">Permís d\'emmagatzematge</string>
|
||||||
<string name="storage_permission_desc">El Syncthing necessita accés a l\'emmagatzematge per poder sincronitzar els arxius</string>
|
<string name="storage_permission_desc">El Syncthing necessita accés a l\'emmagatzematge per poder sincronitzar els arxius</string>
|
||||||
|
|
||||||
<!-- Slide "Location Permission"" -->
|
<!-- Slide "Location Permission" -->
|
||||||
<string name="location_permission_title">Permís d\'ubicació</string>
|
<string name="location_permission_title">Permís d\'ubicació</string>
|
||||||
<string name="location_permission_desc">Podeu configurar el Syncthing perquè funcioni amb les xarxes Wi-Fi que seleccioneu. L\'Android requereix que les aplicacions tinguin permís d\'ubicació per poder cercar el nom de les xarxes Wi-Fi actives, ja que es podria deduir la localització de l\'usuari a partir del nom de la xarxa a la qual es troba connectat. Si voleu utilitzar aquesta característica, premeu el botó de la part superior per donar els permisos necessaris al Syncthing. Altrament podeu ometre aquest pas.</string>
|
<string name="location_permission_desc">Podeu configurar el Syncthing perquè funcioni amb les xarxes Wi-Fi que seleccioneu. L\'Android requereix que les aplicacions tinguin permís d\'ubicació per poder cercar el nom de les xarxes Wi-Fi actives, ja que es podria deduir la localització de l\'usuari a partir del nom de la xarxa a la qual es troba connectat. Si voleu utilitzar aquesta característica, premeu el botó de la part superior per donar els permisos necessaris al Syncthing. Altrament podeu ometre aquest pas.</string>
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,10 @@ Bitte melden Sie auftretende Probleme via GitHub.</string>
|
||||||
<string name="storage_permission_title">Speicher-Berechtigung</string>
|
<string name="storage_permission_title">Speicher-Berechtigung</string>
|
||||||
<string name="storage_permission_desc">Syncthing muss auf den Speicher zugreifen können, um Dateien zu synchronisieren.</string>
|
<string name="storage_permission_desc">Syncthing muss auf den Speicher zugreifen können, um Dateien zu synchronisieren.</string>
|
||||||
|
|
||||||
<!-- Slide "Location Permission"" -->
|
<!-- Slide "Ignore battery optimizations" -->
|
||||||
|
<string name="ignore_doze_permission_os_notice">Das aktuell installierte herstellerspezifische Android OS ist bekannt dafür, Probleme zu haben, diese App zuverlässig im Hintergrund auszuführen. Eine Lösung ist im Wiki unter https://github.com/Catfriend1/syncthing-android/wiki/nVidia-Shield-TV-preparations verfügbar . Starte diese App nach dem Durcharbeiten der Anleitung neu.</string>
|
||||||
|
|
||||||
|
<!-- Slide "Location Permission" -->
|
||||||
<string name="location_permission_title">Standort-Berechtigung</string>
|
<string name="location_permission_title">Standort-Berechtigung</string>
|
||||||
<string name="location_permission_desc">Syncthing kann eingestellt werden, nur in bestimmten WLAN-Netzwerken zu laufen. Android erfordert, dass Apps die Standortberechtigung haben müssen, um den Namen des gerade verbundenen WLAN-Netzwerks ermitteln zu können, da diese potentiell den Standort des Nutzers aus dem Namen des Netzwerks ableiten können. Wenn du diese Funktion nutzen möchtest, klicke die Schaltfläche, um Syncthing die dafür benötigte Berechtigung zu erteilen. Andernfalls kannst du diesen Schritt auslassen.</string>
|
<string name="location_permission_desc">Syncthing kann eingestellt werden, nur in bestimmten WLAN-Netzwerken zu laufen. Android erfordert, dass Apps die Standortberechtigung haben müssen, um den Namen des gerade verbundenen WLAN-Netzwerks ermitteln zu können, da diese potentiell den Standort des Nutzers aus dem Namen des Netzwerks ableiten können. Wenn du diese Funktion nutzen möchtest, klicke die Schaltfläche, um Syncthing die dafür benötigte Berechtigung zu erteilen. Andernfalls kannst du diesen Schritt auslassen.</string>
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ Als je problemen tegenkomt, meld ze dan via GitHub.</string>
|
||||||
<string name="storage_permission_title">Opslagmachtiging</string>
|
<string name="storage_permission_title">Opslagmachtiging</string>
|
||||||
<string name="storage_permission_desc">Synchting heeft toegang nodig tot je bestanden om ze te kunnen synchroniseren.</string>
|
<string name="storage_permission_desc">Synchting heeft toegang nodig tot je bestanden om ze te kunnen synchroniseren.</string>
|
||||||
|
|
||||||
<!-- Slide "Location Permission"" -->
|
<!-- Slide "Location Permission" -->
|
||||||
<string name="location_permission_title">Locatiemachtiging</string>
|
<string name="location_permission_title">Locatiemachtiging</string>
|
||||||
<!-- Slide "Key Generation" -->
|
<!-- Slide "Key Generation" -->
|
||||||
<string name="key_generation_title">Sleutelgeneratie</string>
|
<string name="key_generation_title">Sleutelgeneratie</string>
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
<string name="storage_permission_title">Доступ к файлам</string>
|
<string name="storage_permission_title">Доступ к файлам</string>
|
||||||
<string name="storage_permission_desc">Syncthing требуется доступ к вашим файлам для осуществления синхронизации.</string>
|
<string name="storage_permission_desc">Syncthing требуется доступ к вашим файлам для осуществления синхронизации.</string>
|
||||||
|
|
||||||
<!-- Slide "Location Permission"" -->
|
<!-- Slide "Location Permission" -->
|
||||||
<string name="location_permission_title">Доступ к местоположению</string>
|
<string name="location_permission_title">Доступ к местоположению</string>
|
||||||
<string name="location_permission_desc">Syncthing может быть настроен работать только на выбранных Wi-Fi сетях. Android требует, чтобы приложения имели доступ к местоположению, чтобы узнать имя активной Wi-Fi сети, так как вы иногда можете узнать местоположение пользователя по имени сети, к которой он подключён. Если вы хотите использовать эту функцию, нажмите кнопку вверху, чтобы предоставить Syncthing необходимые разрешения. В противном случае вы можете пропустить этот шаг.</string>
|
<string name="location_permission_desc">Syncthing может быть настроен работать только на выбранных Wi-Fi сетях. Android требует, чтобы приложения имели доступ к местоположению, чтобы узнать имя активной Wi-Fi сети, так как вы иногда можете узнать местоположение пользователя по имени сети, к которой он подключён. Если вы хотите использовать эту функцию, нажмите кнопку вверху, чтобы предоставить Syncthing необходимые разрешения. В противном случае вы можете пропустить этот шаг.</string>
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ Vänligen rapportera eventuella problem du stöter på via Github.</string>
|
||||||
<string name="storage_permission_title">Lagringsbehörighet</string>
|
<string name="storage_permission_title">Lagringsbehörighet</string>
|
||||||
<string name="storage_permission_desc">Syncthing behöver komma åt din lagring för att göra filsynkronisering.</string>
|
<string name="storage_permission_desc">Syncthing behöver komma åt din lagring för att göra filsynkronisering.</string>
|
||||||
|
|
||||||
<!-- Slide "Location Permission"" -->
|
<!-- Slide "Location Permission" -->
|
||||||
<string name="location_permission_title">Plats tillstånd</string>
|
<string name="location_permission_title">Plats tillstånd</string>
|
||||||
<string name="key_generation_success">Säkra nycklar för privat datautbyte har genererats.</string>
|
<string name="key_generation_success">Säkra nycklar för privat datautbyte har genererats.</string>
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,10 @@ Please report any problems you encounter via Github.</string>
|
||||||
<string name="storage_permission_title">Storage Permission</string>
|
<string name="storage_permission_title">Storage Permission</string>
|
||||||
<string name="storage_permission_desc">Syncthing needs to access your storage to do file synchronization.</string>
|
<string name="storage_permission_desc">Syncthing needs to access your storage to do file synchronization.</string>
|
||||||
|
|
||||||
<!-- Slide "Location Permission"" -->
|
<!-- Slide "Ignore battery optimizations" -->
|
||||||
|
<string name="ignore_doze_permission_os_notice">The currently installed manufacturer-specific Android OS is known to cause problems running this app reliably in the background. A solution is available on the wiki at https://github.com/Catfriend1/syncthing-android/wiki/nVidia-Shield-TV-preparations . After working through the instructions, restart this app.</string>
|
||||||
|
|
||||||
|
<!-- Slide "Location Permission" -->
|
||||||
<string name="location_permission_title">Location Permission</string>
|
<string name="location_permission_title">Location Permission</string>
|
||||||
<string name="location_permission_desc">Syncthing can be configured to run on selected Wi-Fi networks. Android requires applications to have location permissions to be able look up active Wi-Fi network name, as you can sometimes infer users location from the name of the network they are connected to. If you want to use this feature, press the button above to give the required location permissions to Syncthing. Otherwise you can skip this step.</string>
|
<string name="location_permission_desc">Syncthing can be configured to run on selected Wi-Fi networks. Android requires applications to have location permissions to be able look up active Wi-Fi network name, as you can sometimes infer users location from the name of the network they are connected to. If you want to use this feature, press the button above to give the required location permissions to Syncthing. Otherwise you can skip this step.</string>
|
||||||
|
|
||||||
|
|
31
wiki/nVidia Shield TV preparations.md
Normal file
31
wiki/nVidia Shield TV preparations.md
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
nVidia Shield TV's Android OS seem to lack the "regular" battery optimization consent and settings dialogs as they are known from mobile phones and tablets. Because of the missing functionality, you can't setup Syncthing-Fork on those TV's without making some steps to prepare the installation of the Syncthing-Fork app first.
|
||||||
|
|
||||||
|
The following instructions to solve the problem by preparing the Android TV for running the app have been contributed by @o-l-a-v :
|
||||||
|
|
||||||
|
* Enable Developer options (rapidly tab build info inside Settings > About)
|
||||||
|
* Enable "USB debugging" and then "Network debugging" inside Developer options
|
||||||
|
* Wait for ip:port to show
|
||||||
|
* Locate / Download Google platform-tools, navigate to folder where adb.exe resides. Open Command Prompt here
|
||||||
|
* Type the following:
|
||||||
|
|
||||||
|
*adb start-server*
|
||||||
|
|
||||||
|
*adb connect ip:port* (example: *adb connect 192.168.1.76:5555*)
|
||||||
|
* Enable "Allow Network debugging" on the prompt that pops up on the nVidia Shield Android TV
|
||||||
|
* Then type the following to check weather you are successfully connected. Should state one device, and "connected"
|
||||||
|
|
||||||
|
*adb devices*
|
||||||
|
* To whitelist Syncthing-Fork from doze / Android Battery Optimization, type the following
|
||||||
|
|
||||||
|
*adb shell dumpsys deviceidle whitelist +com.github.catfriend1.syncthingandroid*
|
||||||
|
|
||||||
|
*adb shell dumpsys deviceidle whitelist +com.github.catfriend1.syncthingandroid.debug*
|
||||||
|
* If you ever want to revert this change, type the following in ADB
|
||||||
|
|
||||||
|
*adb shell dumpsys deviceidle whitelist -com.github.catfriend1.syncthingandroid*
|
||||||
|
|
||||||
|
*adb shell dumpsys deviceidle whitelist -com.github.catfriend1.syncthingandroid.debug*
|
||||||
|
|
||||||
|
Related:
|
||||||
|
- [GitHub issue](https://github.com/Catfriend1/syncthing-android/issues/192)
|
||||||
|
- [nVidia GeForce forum topic](https://forums.geforce.com/default/topic/1092750)
|
Loading…
Reference in a new issue