Home | History | Annotate | Download | only in health
      1 /*
      2  * Copyright (C) 2016 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 
     17 package android.os.health;
     18 
     19 /**
     20  * Keys for {@link HealthStats} returned from
     21  * {@link HealthStats#getStats(int) HealthStats.getStats(int)} with the
     22  * {@link PackageHealthStats#STATS_SERVICES PackageHealthStats.STATS_SERVICES} key.
     23  */
     24 public final class ServiceHealthStats {
     25 
     26     private ServiceHealthStats() {
     27     }
     28 
     29     /**
     30      * Key for a measurement of the number of times this service was started due to calls to
     31      * {@link android.content.Context#startService startService()}, including re-launches
     32      * after crashes.
     33      */
     34     @HealthKeys.Constant(type=HealthKeys.TYPE_MEASUREMENT)
     35     public static final int MEASUREMENT_START_SERVICE_COUNT = HealthKeys.BASE_SERVICE + 1;
     36 
     37     /**
     38      * Key for a measurement of the total number of times this service was started
     39      * due to calls to {@link android.content.Context#startService startService()}
     40      * or {@link android.content.Context#bindService bindService()} including re-launches
     41      * after crashes.
     42      */
     43     @HealthKeys.Constant(type=HealthKeys.TYPE_MEASUREMENT)
     44     public static final int MEASUREMENT_LAUNCH_COUNT = HealthKeys.BASE_SERVICE + 2;
     45 
     46     /**
     47      * @hide
     48      */
     49     public static final HealthKeys.Constants CONSTANTS
     50             = new HealthKeys.Constants(ServiceHealthStats.class);
     51 }
     52