summaryrefslogtreecommitdiffstats
path: root/src-ambient/com/android/phone/common/incall/listeners/AuthenticationListenerImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'src-ambient/com/android/phone/common/incall/listeners/AuthenticationListenerImpl.java')
-rw-r--r--src-ambient/com/android/phone/common/incall/listeners/AuthenticationListenerImpl.java58
1 files changed, 58 insertions, 0 deletions
diff --git a/src-ambient/com/android/phone/common/incall/listeners/AuthenticationListenerImpl.java b/src-ambient/com/android/phone/common/incall/listeners/AuthenticationListenerImpl.java
new file mode 100644
index 0000000..8bf3b53
--- /dev/null
+++ b/src-ambient/com/android/phone/common/incall/listeners/AuthenticationListenerImpl.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2016 The CyanogenMod Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.phone.common.incall.listeners;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.os.RemoteException;
+import android.util.Log;
+
+import com.android.phone.common.incall.DialerDataSubscription;
+import com.android.phone.common.incall.api.InCallResults;
+import com.cyanogen.ambient.incall.extension.IAuthenticationListener;
+
+public class AuthenticationListenerImpl extends IAuthenticationListener.Stub {
+
+ private static final String TAG = AuthenticationListenerImpl.class.getSimpleName();
+ private static final boolean DEBUG = false;
+
+ private ComponentName mComponentName;
+ private Context mContext;
+
+ public static AuthenticationListenerImpl getInstance(Context context, ComponentName
+ componentName) {
+
+ return new AuthenticationListenerImpl(context, componentName);
+ }
+
+ private AuthenticationListenerImpl(Context context, ComponentName cn) {
+ mContext = context;
+ mComponentName = cn;
+ }
+
+ @Override
+ public void authenticationStateUpdated(int state) throws RemoteException {
+ if (DEBUG) {
+ Log.d(TAG, "Got authenticationStateUpdated for: " + mComponentName + " state: "
+ + state);
+ }
+
+ InCallResults.updateAuthenticationState(DialerDataSubscription.get(mContext),
+ mComponentName, state);
+ }
+
+} \ No newline at end of file