• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package com.google.android.angleallowlists.vts;
17 
18 import com.android.tradefed.device.ITestDevice;
19 import java.util.HashMap;
20 import java.util.Map;
21 
22 public class AngleCommon {
23     // Settings.Global
24     public static final String SETTINGS_GLOBAL_ALL_USE_ANGLE = "angle_gl_driver_all_angle";
25     public static final String SETTINGS_GLOBAL_DRIVER_PKGS = "angle_gl_driver_selection_pkgs";
26     public static final String SETTINGS_GLOBAL_DRIVER_VALUES = "angle_gl_driver_selection_values";
27     public static final String SETTINGS_GLOBAL_ANGLE_DEBUG_PACKAGE = "angle_debug_package";
28 
29     // ANGLE
30     public static final String ANGLE_TEST_PKG = "com.google.android.vts.angle.testapp";
31     public static final String ANGLE_TEST_APP = "VtsAngleTestApp.apk";
32 
33     public static final String ANGLE_DRIVER_TEST_CLASS = "VtsAngleTestCase";
34     public static final String ANGLE_DRIVER_TEST_LOCATION_METHOD = "testAngleLocation";
35 
setGlobalSetting(ITestDevice device, String globalSetting, String value)36     static void setGlobalSetting(ITestDevice device, String globalSetting, String value)
37             throws Exception {
38         device.setSetting("global", globalSetting, value);
39         device.executeShellCommand("am refresh-settings-cache");
40     }
41 
42     /** Clear ANGLE-related settings */
clearSettings(ITestDevice device)43     public static void clearSettings(ITestDevice device) throws Exception {
44         // Cached Activity Manager settings
45         setGlobalSetting(device, SETTINGS_GLOBAL_ALL_USE_ANGLE, "0");
46         setGlobalSetting(device, SETTINGS_GLOBAL_DRIVER_PKGS, "\"\"");
47         setGlobalSetting(device, SETTINGS_GLOBAL_DRIVER_VALUES, "\"\"");
48         setGlobalSetting(device, SETTINGS_GLOBAL_ANGLE_DEBUG_PACKAGE, "\"\"");
49     }
50 }
51