mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-20 11:58:55 +00:00
Add UiAutoUtils class
UiAutoUtility class added to support utility functions used for UiAutomation. This class can help in refactoring some existing fucntionalities into utility functions. Launch command generation is added as a utility class method which can be used by workloads to construct their launch command from parameters passed.
This commit is contained in:
parent
4ce20e2d3f
commit
99b46b4630
BIN
wlauto/common/android/UiAutoUtils.class
Normal file
BIN
wlauto/common/android/UiAutoUtils.class
Normal file
Binary file not shown.
36
wlauto/external/uiauto/src/com/arm/wlauto/uiauto/UiAutoUtils.java
vendored
Normal file
36
wlauto/external/uiauto/src/com/arm/wlauto/uiauto/UiAutoUtils.java
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
/* Copyright 2013-2016 ARM Limited
|
||||
*
|
||||
* 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.arm.wlauto.uiauto;
|
||||
|
||||
import android.os.Bundle;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public final class UiAutoUtils {
|
||||
|
||||
/** Construct launch command of an application. */
|
||||
public static String createLaunchCommand(Bundle parameters) {
|
||||
String launchCommand;
|
||||
String activityName = parameters.getString("launch_activity");
|
||||
String packageName = parameters.getString("package");
|
||||
if (activityName.equals("None")) {
|
||||
launchCommand = String.format("am start %s", packageName);
|
||||
}
|
||||
else {
|
||||
launchCommand = String.format("am start -n %s/%s", packageName, activityName);
|
||||
}
|
||||
return launchCommand;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user