• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2024 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.server.telecom;
18 
19 public class CachedMuteStateChange implements CachedCallback {
20     public static final String ID = CachedMuteStateChange.class.getSimpleName();
21     boolean mIsMuted;
22 
isMuted()23     public boolean isMuted() {
24         return mIsMuted;
25     }
26 
CachedMuteStateChange(boolean isMuted)27     public CachedMuteStateChange(boolean isMuted) {
28         mIsMuted = isMuted;
29     }
30 
31     @Override
executeCallback(CallSourceService service, Call call)32     public void executeCallback(CallSourceService service, Call call) {
33         service.onMuteStateChanged(call, mIsMuted);
34     }
35 
36     @Override
getCallbackId()37     public String getCallbackId() {
38         return ID;
39     }
40 
41     @Override
hashCode()42     public int hashCode() {
43         return Boolean.hashCode(mIsMuted);
44     }
45 
46     @Override
equals(Object obj)47     public boolean equals(Object obj) {
48         if (obj == null) {
49             return false;
50         }
51         if (!(obj instanceof CachedMuteStateChange other)) {
52             return false;
53         }
54         return mIsMuted == other.mIsMuted;
55     }
56 }
57 
58