1/* 2 * Copyright (C) 2015 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 17package com.android.systemui.statusbar.phone; 18 19import android.content.ComponentName; 20import android.os.UserHandle; 21 22/** 23 * Navigation bar app information. 24 */ 25class AppInfo { 26 private final ComponentName mComponentName; 27 private final UserHandle mUser; 28 29 public AppInfo(ComponentName componentName, UserHandle user) { 30 if (componentName == null || user == null) throw new IllegalArgumentException(); 31 mComponentName = componentName; 32 mUser = user; 33 } 34 35 public ComponentName getComponentName() { 36 return mComponentName; 37 } 38 39 public UserHandle getUser() { 40 return mUser; 41 } 42 43 @Override 44 public boolean equals(Object obj) { 45 if (obj == null) { 46 return false; 47 } 48 if (getClass() != obj.getClass()) { 49 return false; 50 } 51 final AppInfo other = (AppInfo) obj; 52 return mComponentName.equals(other.mComponentName) && mUser.equals(other.mUser); 53 } 54} 55