-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
152 additions
and
1,407 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "nanohttpd"] | ||
path = nanohttpd | ||
url = https://github.com/NanoHttpd/nanohttpd.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
source.dir=src;nanohttpd/core/src/main/java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
package com.github.uiautomatorstub; | ||
|
||
import java.lang.reflect.InvocationTargetException; | ||
|
||
/** | ||
* Created by b036 on 12/26/13. | ||
*/ | ||
public class ConfiguratorInfo { | ||
|
||
public ConfiguratorInfo() { | ||
try { | ||
Class clz = Class.forName("com.android.uiautomator.core.Configurator"); | ||
Object conf = clz.getMethod("getInstance").invoke(null); | ||
this._actionAcknowledgmentTimeout = (Long)clz.getMethod("getActionAcknowledgmentTimeout").invoke(conf); | ||
this._keyInjectionDelay = (Long)clz.getMethod("getKeyInjectionDelay").invoke(conf); | ||
this._scrollAcknowledgmentTimeout = (Long)clz.getMethod("getScrollAcknowledgmentTimeout").invoke(conf); | ||
this._waitForIdleTimeout = (Long)clz.getMethod("getWaitForIdleTimeout").invoke(conf); | ||
this._waitForSelectorTimeout = (Long)clz.getMethod("getWaitForSelectorTimeout").invoke(conf); | ||
} catch (IllegalAccessException e) { | ||
e.printStackTrace(); | ||
} catch (InvocationTargetException e) { | ||
e.printStackTrace(); | ||
} catch (NoSuchMethodException e) { | ||
e.printStackTrace(); | ||
} catch (ClassNotFoundException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
|
||
public long getActionAcknowledgmentTimeout() { | ||
return _actionAcknowledgmentTimeout; | ||
} | ||
|
||
public void setActionAcknowledgmentTimeout(long _actionAcknowledgmentTimeout) { | ||
this._actionAcknowledgmentTimeout = _actionAcknowledgmentTimeout; | ||
} | ||
|
||
public long getKeyInjectionDelay() { | ||
return _keyInjectionDelay; | ||
} | ||
|
||
public void setKeyInjectionDelay(long _keyInjectionDelay) { | ||
this._keyInjectionDelay = _keyInjectionDelay; | ||
} | ||
|
||
public long getScrollAcknowledgmentTimeout() { | ||
return _scrollAcknowledgmentTimeout; | ||
} | ||
|
||
public void setScrollAcknowledgmentTimeout(long _scrollAcknowledgmentTimeout) { | ||
this._scrollAcknowledgmentTimeout = _scrollAcknowledgmentTimeout; | ||
} | ||
|
||
public long getWaitForIdleTimeout() { | ||
return _waitForIdleTimeout; | ||
} | ||
|
||
public void setWaitForIdleTimeout(long _waitForIdleTimeout) { | ||
this._waitForIdleTimeout = _waitForIdleTimeout; | ||
} | ||
|
||
public long getWaitForSelectorTimeout() { | ||
return _waitForSelectorTimeout; | ||
} | ||
|
||
public void setWaitForSelectorTimeout(long _waitForSelectorTimeout) { | ||
this._waitForSelectorTimeout = _waitForSelectorTimeout; | ||
} | ||
|
||
public static void setConfigurator(ConfiguratorInfo info) { | ||
try { | ||
Class clz = Class.forName("com.android.uiautomator.core.Configurator"); | ||
Object conf = clz.getMethod("getInstance").invoke(null); | ||
clz.getMethod("setActionAcknowledgmentTimeout", Long.TYPE).invoke(conf, info.getActionAcknowledgmentTimeout()); | ||
clz.getMethod("setKeyInjectionDelay", Long.TYPE).invoke(conf, info.getKeyInjectionDelay()); | ||
clz.getMethod("setScrollAcknowledgmentTimeout", Long.TYPE).invoke(conf, info.getScrollAcknowledgmentTimeout()); | ||
clz.getMethod("setWaitForIdleTimeout", Long.TYPE).invoke(conf, info.getWaitForIdleTimeout()); | ||
clz.getMethod("setWaitForSelectorTimeout", Long.TYPE).invoke(conf, info.getWaitForSelectorTimeout()); | ||
} catch (IllegalAccessException e) { | ||
Log.d(e.getMessage()); | ||
} catch (InvocationTargetException e) { | ||
Log.d(e.getMessage()); | ||
} catch (NoSuchMethodException e) { | ||
Log.d(e.getMessage()); | ||
} catch (ClassNotFoundException e) { | ||
Log.d(e.getMessage()); | ||
} | ||
} | ||
|
||
private long _actionAcknowledgmentTimeout; | ||
private long _keyInjectionDelay; | ||
private long _scrollAcknowledgmentTimeout; | ||
private long _waitForIdleTimeout; | ||
private long _waitForSelectorTimeout; | ||
} |
Oops, something went wrong.