Increase root installer timeout from 5 to 30s. Fixes Issue #74.

The superuser shell has a timeout that can be specified. The timeout
was set to 5 seconds, thus the exit code from the shell is -1 (a
reserved exit code used by libsuperuse to indicate timeout).

By my estimate, it is more likely that a user will hit this error
message and get annoyed, compared to actually hitting a genuine timeout
because of some issue with superuser. Especially when we factor in slow
devices and large apps to install. Thus, the timeout has been bumped
to a more generous 30 seconds.
This commit is contained in:
Peter Serwylo 2014-08-19 08:12:47 +09:30
parent 3a3ea52077
commit 82fed66a8a

View File

@ -19,15 +19,15 @@
package org.fdroid.fdroid.installer; package org.fdroid.fdroid.installer;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import eu.chainfire.libsuperuser.Shell;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.util.Log; import android.util.Log;
import eu.chainfire.libsuperuser.Shell;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
/** /**
* Installer using a root shell and "pm install", "pm uninstall" commands * Installer using a root shell and "pm install", "pm uninstall" commands
@ -45,8 +45,8 @@ public class RootInstaller extends Installer {
Shell.Builder shellBuilder = new Shell.Builder() Shell.Builder shellBuilder = new Shell.Builder()
.useSU() .useSU()
.setWantSTDERR(true) .setWantSTDERR(true)
.setWatchdogTimeout(5) .setWatchdogTimeout(30)
.setMinimalLogging(true); .setMinimalLogging(false);
return shellBuilder; return shellBuilder;
} }