merge in jb-release history after reset to jb-dev
diff --git a/uiautomator/utils/DummyIME/src/com/android/testing/dummyime/DummyIme.java b/uiautomator/utils/DummyIME/src/com/android/testing/dummyime/DummyIme.java
index 7b7a39a..35659ef 100644
--- a/uiautomator/utils/DummyIME/src/com/android/testing/dummyime/DummyIme.java
+++ b/uiautomator/utils/DummyIME/src/com/android/testing/dummyime/DummyIme.java
@@ -22,14 +22,4 @@
* Dummy IME implementation that basically does nothing
*/
public class DummyIme extends InputMethodService {
-
- @Override
- public boolean onEvaluateFullscreenMode() {
- return false;
- }
-
- @Override
- public boolean onEvaluateInputViewShown() {
- return false;
- }
}
diff --git a/uiautomator/utils/uiautomatorviewer/src/com/android/uiautomator/UiAutomatorModel.java b/uiautomator/utils/uiautomatorviewer/src/com/android/uiautomator/UiAutomatorModel.java
index 0a1fab0..ce7379d 100644
--- a/uiautomator/utils/uiautomatorviewer/src/com/android/uiautomator/UiAutomatorModel.java
+++ b/uiautomator/utils/uiautomatorviewer/src/com/android/uiautomator/UiAutomatorModel.java
@@ -28,7 +28,6 @@
import org.eclipse.swt.graphics.Rectangle;
import java.io.File;
-import java.util.ArrayList;
import java.util.List;
public class UiAutomatorModel {
@@ -42,7 +41,6 @@
private BasicTreeNode mSelectedNode;
private Rectangle mCurrentDrawingRect;
private List<Rectangle> mNafNodes;
- private List<File> mTmpDirs;
// determines whether we lookup the leaf UI node on mouse move of screenshot image
private boolean mExploreMode = true;
@@ -51,7 +49,6 @@
private UiAutomatorModel(UiAutomatorViewer view) {
mView = view;
- mTmpDirs = new ArrayList<File>();
}
public static UiAutomatorModel createInstance(UiAutomatorViewer view) {
@@ -219,22 +216,4 @@
public boolean shouldShowNafNodes() {
return mShowNafNodes;
}
-
- /**
- * Registers a temporary directory for deletion when app exists
- *
- * @param tmpDir
- */
- public void registerTempDirectory(File tmpDir) {
- mTmpDirs.add(tmpDir);
- }
-
- /**
- * Performs cleanup tasks when the app is exiting
- */
- public void cleanUp() {
- for (File dir : mTmpDirs) {
- Utils.deleteRecursive(dir);
- }
- }
}
diff --git a/uiautomator/utils/uiautomatorviewer/src/com/android/uiautomator/UiAutomatorViewer.java b/uiautomator/utils/uiautomatorviewer/src/com/android/uiautomator/UiAutomatorViewer.java
index 9f758ae..bb3e893 100644
--- a/uiautomator/utils/uiautomatorviewer/src/com/android/uiautomator/UiAutomatorViewer.java
+++ b/uiautomator/utils/uiautomatorviewer/src/com/android/uiautomator/UiAutomatorViewer.java
@@ -97,9 +97,10 @@
*/
@Override
protected Control createContents(Composite parent) {
+ parent.setLayout(new FillLayout());
SashForm baseSash = new SashForm(parent, SWT.HORIZONTAL | SWT.NONE);
// draw the canvas with border, so the divider area for sash form can be highlighted
- mScreenshotCanvas = new Canvas(baseSash, SWT.BORDER);
+ mScreenshotCanvas = new Canvas(baseSash, SWT.BORDER | SWT.NO_REDRAW_RESIZE);
mScreenshotCanvas.addMouseListener(new MouseAdapter() {
@Override
public void mouseUp(MouseEvent e) {
@@ -284,7 +285,6 @@
UiAutomatorViewer window = new UiAutomatorViewer();
window.setBlockOnOpen(true);
window.open();
- UiAutomatorModel.getModel().cleanUp();
} catch (Exception e) {
e.printStackTrace();
}
diff --git a/uiautomator/utils/uiautomatorviewer/src/com/android/uiautomator/Utils.java b/uiautomator/utils/uiautomatorviewer/src/com/android/uiautomator/Utils.java
deleted file mode 100644
index 5306fe3..0000000
--- a/uiautomator/utils/uiautomatorviewer/src/com/android/uiautomator/Utils.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.uiautomator;
-
-import java.io.File;
-
-public class Utils {
- public static void deleteRecursive(File file) {
- if (file.isDirectory()) {
- File[] children = file.listFiles();
- for (File child : children) {
- if (!child.getName().startsWith("."))
- deleteRecursive(child);
- }
- }
- file.delete();
- }
-}
diff --git a/uiautomator/utils/uiautomatorviewer/src/com/android/uiautomator/actions/ScreenshotAction.java b/uiautomator/utils/uiautomatorviewer/src/com/android/uiautomator/actions/ScreenshotAction.java
index 7d1eaa3..9bff372 100644
--- a/uiautomator/utils/uiautomatorviewer/src/com/android/uiautomator/actions/ScreenshotAction.java
+++ b/uiautomator/utils/uiautomatorviewer/src/com/android/uiautomator/actions/ScreenshotAction.java
@@ -89,7 +89,6 @@
showError("Cannot get temp directory", e, monitor);
return;
}
- UiAutomatorModel.getModel().registerTempDirectory(tmpDir);
// boiler plates to do a bunch of adb stuff to take XML snapshot and screenshot
monitor.beginTask("Getting UI status dump from device...",