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 17 package com.android.systemui.appops; 18 19 /** 20 * Item to store information of active applications using different APP OPS 21 */ 22 public class AppOpItem { 23 24 private int mCode; 25 private int mUid; 26 private String mPackageName; 27 private long mTimeStarted; 28 private String mState; 29 AppOpItem(int code, int uid, String packageName, long timeStarted)30 public AppOpItem(int code, int uid, String packageName, long timeStarted) { 31 this.mCode = code; 32 this.mUid = uid; 33 this.mPackageName = packageName; 34 this.mTimeStarted = timeStarted; 35 mState = new StringBuilder() 36 .append("AppOpItem(") 37 .append("Op code=").append(code).append(", ") 38 .append("UID=").append(uid).append(", ") 39 .append("Package name=").append(packageName) 40 .append(")") 41 .toString(); 42 } 43 getCode()44 public int getCode() { 45 return mCode; 46 } 47 getUid()48 public int getUid() { 49 return mUid; 50 } 51 getPackageName()52 public String getPackageName() { 53 return mPackageName; 54 } 55 getTimeStarted()56 public long getTimeStarted() { 57 return mTimeStarted; 58 } 59 60 @Override toString()61 public String toString() { 62 return mState; 63 } 64 } 65