Skip to content

Commit

Permalink
try fix reboot issue
Browse files Browse the repository at this point in the history
  • Loading branch information
fqrouter committed Nov 20, 2013
1 parent fd23370 commit 331029a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions android/src/fq/router2/life_cycle/Deployer.java
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ private void unzipPayloadZip() throws Exception {
}

private void linkLibs() throws Exception {
if (isXperia()) {
LogUtils.i("skip link libs for xperia");
return;
}
if (!shouldLinkLibs()) {
return;
}
Expand All @@ -244,6 +248,7 @@ private void linkLibs() throws Exception {
String targetPath = "/system/lib/" + file.getName();
if (!new File(targetPath).exists()) {
try {
LogUtils.i("rm " + targetPath);
ShellUtils.sudo("rm " + targetPath);
} catch (Exception e) {
// ignore
Expand All @@ -257,6 +262,15 @@ private void linkLibs() throws Exception {
}
}

private boolean isXperia() {
try {
return new File("/sbin/ric").exists();
} catch (Exception e) {
LogUtils.e("failed to tell if it is xperia", e);
return true;
}
}

private boolean shouldLinkLibs() throws Exception {
File[] files = new File(PYTHON_DIR, "lib").listFiles();
if (files == null) {
Expand Down

0 comments on commit 331029a

Please sign in to comment.