Merge "Add Plugin API for controling the device power states" into honeycomb

This commit is contained in:
Derek Sollenberger
2011-01-27 15:26:53 -08:00
committed by Android (Google) Code Review
2 changed files with 16 additions and 1 deletions

View File

@@ -673,6 +673,7 @@ public class WebView extends AbsoluteLayout
static final int AUTOFILL_COMPLETE = 134;
static final int SELECT_AT = 135;
static final int SCREEN_ON = 136;
private static final int FIRST_PACKAGE_MSG_ID = SCROLL_TO_MSG_ID;
private static final int LAST_PACKAGE_MSG_ID = SET_TOUCH_HIGHLIGHT_RECTS;
@@ -726,7 +727,8 @@ public class WebView extends AbsoluteLayout
"SAVE_WEBARCHIVE_FINISHED", // = 132;
"SET_AUTOFILLABLE", // = 133;
"AUTOFILL_COMPLETE", // = 134;
"SELECT_AT" // = 135;
"SELECT_AT", // = 135;
"SCREEN_ON" // = 136;
};
// If the site doesn't use the viewport meta tag to specify the viewport,
@@ -7454,6 +7456,10 @@ public class WebView extends AbsoluteLayout
doMotionUp(msg.arg1, msg.arg2);
break;
case SCREEN_ON:
setKeepScreenOn(msg.arg1 == 1);
break;
case SHOW_FULLSCREEN: {
View view = (View) msg.obj;
int npp = msg.arg1;

View File

@@ -2548,6 +2548,15 @@ final class WebViewCore {
return mContext;
}
// called by JNI
private void keepScreenOn(boolean screenOn) {
if (mWebView != null) {
Message message = mWebView.mPrivateHandler.obtainMessage(WebView.SCREEN_ON);
message.arg1 = screenOn ? 1 : 0;
message.sendToTarget();
}
}
// called by JNI
private Class<?> getPluginClass(String libName, String clsName) {