Home | History | Annotate | Download | only in common
      1 /*
      2  * Copyright (C) 2018 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 android.os.cts.batterysaving.common;
     17 
     18 import android.content.ComponentName;
     19 
     20 import java.security.SecureRandom;
     21 
     22 public class Values {
     23     private static final SecureRandom sRng = new SecureRandom();
     24 
     25     public static final String APP_CURRENT_PACKAGE =
     26             "android.os.cts.batterysaving.app_target_api_current";
     27 
     28     public static final String APP_25_PACKAGE =
     29             "android.os.cts.batterysaving.app_target_api_25";
     30 
     31     public static final String COMM_RECEIVER = "android.os.cts.batterysaving.app.CommReceiver";
     32 
     33     public static final String TEST_SERVICE = "android.os.cts.batterysaving.app.TestService";
     34 
     35     public static final String KEY_REQUEST_FOREGROUND = "KEY_REQUEST_FOREGROUND";
     36 
     37     public static ComponentName getCommReceiver(String packageName) {
     38         return new ComponentName(packageName, COMM_RECEIVER);
     39     }
     40 
     41     public static ComponentName getTestService(String packageName) {
     42         return new ComponentName(packageName, TEST_SERVICE);
     43     }
     44 
     45     public static int getRandomInt() {
     46         return sRng.nextInt();
     47     }
     48 }
     49