From 8a21278686b218af63c6e8e2a56b324da8b00db4 Mon Sep 17 00:00:00 2001 From: John Spurlock Date: Fri, 14 Jun 2013 16:41:24 -0400 Subject: [PATCH] Remove unused CarrierLabel. Change-Id: I145a7ee38655a957aec14fe7318092c42b3cb6cc --- .../systemui/statusbar/phone/CarrierLabel.java | 108 --------------------- 1 file changed, 108 deletions(-) delete mode 100644 packages/SystemUI/src/com/android/systemui/statusbar/phone/CarrierLabel.java diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CarrierLabel.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CarrierLabel.java deleted file mode 100644 index 5ea17e72ba12..000000000000 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CarrierLabel.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (C) 2006 The Android Open Source 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.systemui.statusbar.phone; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.content.IntentFilter; -import android.text.TextUtils; -import android.util.AttributeSet; -import android.util.Log; -import android.widget.TextView; - -import com.android.internal.telephony.TelephonyIntents; - -/** - * This widget display an analogic clock with two hands for hours and - * minutes. - */ -public class CarrierLabel extends TextView { - private boolean mAttached; - - public CarrierLabel(Context context) { - this(context, null); - } - - public CarrierLabel(Context context, AttributeSet attrs) { - this(context, attrs, 0); - } - - public CarrierLabel(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); - updateNetworkName(false, null, false, null); - } - - @Override - protected void onAttachedToWindow() { - super.onAttachedToWindow(); - - if (!mAttached) { - mAttached = true; - IntentFilter filter = new IntentFilter(); - filter.addAction(TelephonyIntents.SPN_STRINGS_UPDATED_ACTION); - getContext().registerReceiver(mIntentReceiver, filter, null, getHandler()); - } - } - - @Override - protected void onDetachedFromWindow() { - super.onDetachedFromWindow(); - if (mAttached) { - getContext().unregisterReceiver(mIntentReceiver); - mAttached = false; - } - } - - private final BroadcastReceiver mIntentReceiver = new BroadcastReceiver() { - @Override - public void onReceive(Context context, Intent intent) { - String action = intent.getAction(); - if (TelephonyIntents.SPN_STRINGS_UPDATED_ACTION.equals(action)) { - updateNetworkName(intent.getBooleanExtra(TelephonyIntents.EXTRA_SHOW_SPN, false), - intent.getStringExtra(TelephonyIntents.EXTRA_SPN), - intent.getBooleanExtra(TelephonyIntents.EXTRA_SHOW_PLMN, false), - intent.getStringExtra(TelephonyIntents.EXTRA_PLMN)); - } - } - }; - - void updateNetworkName(boolean showSpn, String spn, boolean showPlmn, String plmn) { - if (false) { - Log.d("CarrierLabel", "updateNetworkName showSpn=" + showSpn + " spn=" + spn - + " showPlmn=" + showPlmn + " plmn=" + plmn); - } - final String str; - // match logic in KeyguardStatusViewManager - final boolean plmnValid = showPlmn && !TextUtils.isEmpty(plmn); - final boolean spnValid = showSpn && !TextUtils.isEmpty(spn); - if (plmnValid && spnValid) { - str = plmn + "|" + spn; - } else if (plmnValid) { - str = plmn; - } else if (spnValid) { - str = spn; - } else { - str = ""; - } - setText(str); - } - - -} - - -- 2.11.0