summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorJoe Onorato <joeo@android.com>2010-05-17 16:13:12 -0700
committerJoe Onorato <joeo@android.com>2010-06-02 14:48:42 -0700
commit6528b35585020fafe7e39dfa416f728df5158c63 (patch)
tree7927d7463a84b274cf02ef1ff9ffd8b2c62eec50 /packages
parent4762c2d75a55e0854bbff2f996748116d4ab1a37 (diff)
downloadframeworks_base-6528b35585020fafe7e39dfa416f728df5158c63.zip
frameworks_base-6528b35585020fafe7e39dfa416f728df5158c63.tar.gz
frameworks_base-6528b35585020fafe7e39dfa416f728df5158c63.tar.bz2
Remove unused stuff.
Change-Id: I85864ed242cb39c7298e82cb83beba8f98db6a6d
Diffstat (limited to 'packages')
-rw-r--r--packages/StatusBarPhone/src/com/android/policy/statusbar/phone/IconData.java122
-rw-r--r--packages/StatusBarPhone/src/com/android/policy/statusbar/phone/IconMerger.java5
-rw-r--r--packages/StatusBarPhone/src/com/android/policy/statusbar/phone/PhoneStatusBarService.java21
-rw-r--r--packages/StatusBarPhone/src/com/android/policy/statusbar/phone/StatusBarException.java23
-rw-r--r--packages/StatusBarPhone/src/com/android/policy/statusbar/phone/StatusBarIconData.java186
-rw-r--r--packages/StatusBarPhone/src/com/android/policy/statusbar/phone/StatusBarService.java2
6 files changed, 3 insertions, 356 deletions
diff --git a/packages/StatusBarPhone/src/com/android/policy/statusbar/phone/IconData.java b/packages/StatusBarPhone/src/com/android/policy/statusbar/phone/IconData.java
deleted file mode 100644
index 354cf1c..0000000
--- a/packages/StatusBarPhone/src/com/android/policy/statusbar/phone/IconData.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (C) 2008 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.policy.statusbar.phone;
-
-import android.util.Slog;
-
-public class IconData {
- /**
- * Indicates ths item represents a piece of text.
- */
- public static final int TEXT = 1;
-
- /**
- * Indicates ths item represents an icon.
- */
- public static final int ICON = 2;
-
- /**
- * The type of this item. One of TEXT, ICON, or LEVEL_ICON.
- */
- public int type;
-
- /**
- * The slot that this icon will be in if it is not a notification
- */
- public String slot;
-
- /**
- * The package containting the icon to draw for this item. Valid if this is
- * an ICON type.
- */
- public String iconPackage;
-
- /**
- * The icon to draw for this item. Valid if this is an ICON type.
- */
- public int iconId;
-
- /**
- * The level associated with the icon. Valid if this is a LEVEL_ICON type.
- */
- public int iconLevel;
-
- /**
- * The "count" number.
- */
- public int number;
-
- /**
- * The text associated with the icon. Valid if this is a TEXT type.
- */
- public CharSequence text;
-
- private IconData() {
- }
-
- public static IconData makeIcon(String slot,
- String iconPackage, int iconId, int iconLevel, int number) {
- IconData data = new IconData();
- data.type = ICON;
- data.slot = slot;
- data.iconPackage = iconPackage;
- data.iconId = iconId;
- data.iconLevel = iconLevel;
- data.number = number;
- return data;
- }
-
- public static IconData makeText(String slot, CharSequence text) {
- IconData data = new IconData();
- data.type = TEXT;
- data.slot = slot;
- data.text = text;
- return data;
- }
-
- public void copyFrom(IconData that) {
- this.type = that.type;
- this.slot = that.slot;
- this.iconPackage = that.iconPackage;
- this.iconId = that.iconId;
- this.iconLevel = that.iconLevel;
- this.number = that.number;
- this.text = that.text; // should we clone this?
- }
-
- public IconData clone() {
- IconData that = new IconData();
- that.copyFrom(this);
- return that;
- }
-
- public String toString() {
- if (this.type == TEXT) {
- return "IconData(slot=" + (this.slot != null ? "'" + this.slot + "'" : "null")
- + " text='" + this.text + "')";
- }
- else if (this.type == ICON) {
- return "IconData(slot=" + (this.slot != null ? "'" + this.slot + "'" : "null")
- + " package=" + this.iconPackage
- + " iconId=" + Integer.toHexString(this.iconId)
- + " iconLevel=" + this.iconLevel + ")";
- }
- else {
- return "IconData(type=" + type + ")";
- }
- }
-}
diff --git a/packages/StatusBarPhone/src/com/android/policy/statusbar/phone/IconMerger.java b/packages/StatusBarPhone/src/com/android/policy/statusbar/phone/IconMerger.java
index d426be2..226cb6a 100644
--- a/packages/StatusBarPhone/src/com/android/policy/statusbar/phone/IconMerger.java
+++ b/packages/StatusBarPhone/src/com/android/policy/statusbar/phone/IconMerger.java
@@ -24,7 +24,6 @@ import android.widget.LinearLayout;
public class IconMerger extends LinearLayout {
PhoneStatusBarService service;
- StatusBarIconData moreIcon;
public IconMerger(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -117,7 +116,7 @@ public class IconMerger extends LinearLayout {
// and provide the value later. We're the only one changing this value show it
// should be ordered correctly.
if (false) {
- this.moreIcon.update(number);
+ // TODO this.moreIcon.update(number);
} else {
mBugWorkaroundNumber = number;
mBugWorkaroundHandler.post(mBugWorkaroundRunnable);
@@ -128,8 +127,10 @@ public class IconMerger extends LinearLayout {
private Handler mBugWorkaroundHandler = new Handler();
private Runnable mBugWorkaroundRunnable = new Runnable() {
public void run() {
+ /* TODO
IconMerger.this.moreIcon.update(mBugWorkaroundNumber);
IconMerger.this.moreIcon.view.invalidate();
+ */
}
};
}
diff --git a/packages/StatusBarPhone/src/com/android/policy/statusbar/phone/PhoneStatusBarService.java b/packages/StatusBarPhone/src/com/android/policy/statusbar/phone/PhoneStatusBarService.java
index 86b6889..bc02625 100644
--- a/packages/StatusBarPhone/src/com/android/policy/statusbar/phone/PhoneStatusBarService.java
+++ b/packages/StatusBarPhone/src/com/android/policy/statusbar/phone/PhoneStatusBarService.java
@@ -119,16 +119,8 @@ public class PhoneStatusBarService extends StatusBarService {
Object mQueueLock = new Object();
NotificationCallbacks mNotificationCallbacks;
- // All accesses to mIconMap and mNotificationData are syncronized on those objects,
- // but this is only so dump() can work correctly. Modifying these outside of the UI
- // thread will not work, there are places in the code that unlock and reaquire between
- // reads and require them to not be modified.
-
// icons
- HashMap<IBinder,StatusBarIconData> mIconMap = new HashMap<IBinder,StatusBarIconData>();
- ArrayList<StatusBarIconData> mIconList = new ArrayList<StatusBarIconData>();
String[] mRightIconSlots;
- StatusBarIconData[] mRightIcons;
LinearLayout mIcons;
IconMerger mNotificationIcons;
LinearLayout mStatusIcons;
@@ -209,7 +201,6 @@ public class PhoneStatusBarService extends StatusBarService {
private void makeStatusBarView(Context context) {
Resources res = context.getResources();
mRightIconSlots = res.getStringArray(R.array.status_bar_icon_order);
- mRightIcons = new StatusBarIconData[mRightIconSlots.length];
mHeight = res.getDimensionPixelSize(com.android.internal.R.dimen.status_bar_height);
mIconWidth = mHeight;
@@ -994,18 +985,6 @@ public class PhoneStatusBarService extends StatusBarService {
+ " scroll " + mScrollView.getScrollX() + "," + mScrollView.getScrollY());
pw.println("mNotificationLinearLayout: " + viewInfo(mNotificationLinearLayout));
}
- synchronized (mIconMap) {
- final int N = mIconMap.size();
- pw.println(" mIconMap.size=" + N);
- Set<IBinder> keys = mIconMap.keySet();
- int i=0;
- for (IBinder key: keys) {
- StatusBarIconData icon = mIconMap.get(key);
- pw.println(" [" + i + "] key=" + key);
- pw.println(" data=" + icon.mData);
- i++;
- }
- }
synchronized (mNotificationData) {
int N = mNotificationData.ongoingCount();
pw.println(" ongoingCount.size=" + N);
diff --git a/packages/StatusBarPhone/src/com/android/policy/statusbar/phone/StatusBarException.java b/packages/StatusBarPhone/src/com/android/policy/statusbar/phone/StatusBarException.java
deleted file mode 100644
index 1bb92f0..0000000
--- a/packages/StatusBarPhone/src/com/android/policy/statusbar/phone/StatusBarException.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2008 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.policy.statusbar.phone;
-
-public class StatusBarException extends RuntimeException {
- StatusBarException(String msg) {
- super(msg);
- }
-}
diff --git a/packages/StatusBarPhone/src/com/android/policy/statusbar/phone/StatusBarIconData.java b/packages/StatusBarPhone/src/com/android/policy/statusbar/phone/StatusBarIconData.java
deleted file mode 100644
index 1932f43..0000000
--- a/packages/StatusBarPhone/src/com/android/policy/statusbar/phone/StatusBarIconData.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Copyright (C) 2008 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.policy.statusbar.phone;
-
-import android.content.Context;
-import android.content.pm.PackageManager;
-import android.content.res.Resources;
-import android.graphics.Typeface;
-import android.graphics.drawable.Drawable;
-import android.text.TextUtils;
-import android.util.Slog;
-import android.view.Gravity;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-
-public class StatusBarIconData {
- // TODO: get this from a resource
- private static final int ICON_GAP = 8;
- private static final int ICON_WIDTH = 25;
- private static final int ICON_HEIGHT = 25;
-
- public View view;
-
- IconData mData;
-
- private TextView mTextView;
- private AnimatedImageView mImageView;
- private TextView mNumberView;
-
- public StatusBarIconData(Context context, IconData data, ViewGroup parent) {
- mData = data.clone();
-
- switch (data.type) {
- case IconData.TEXT: {
- TextView t;
- t = new TextView(context);
- mTextView = t;
- LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
- LinearLayout.LayoutParams.WRAP_CONTENT,
- LinearLayout.LayoutParams.MATCH_PARENT);
- t.setTextSize(16);
- t.setTextColor(0xff000000);
- t.setTypeface(Typeface.DEFAULT_BOLD);
- t.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT);
- t.setPadding(6, 0, 0, 0);
- t.setLayoutParams(layoutParams);
- t.setText(data.text);
- this.view = t;
- break;
- }
-
- case IconData.ICON: {
- // container
- LayoutInflater inflater = (LayoutInflater)context.getSystemService(
- Context.LAYOUT_INFLATER_SERVICE);
- View v = inflater.inflate(R.layout.status_bar_icon, parent, false);
- this.view = v;
-
- // icon
- AnimatedImageView im = (AnimatedImageView)v.findViewById(R.id.image);
- im.setImageDrawable(getIcon(context, data));
- im.setImageLevel(data.iconLevel);
- mImageView = im;
-
- // number
- TextView nv = (TextView)v.findViewById(R.id.number);
- mNumberView = nv;
- if (data.number > 0) {
- nv.setText("" + data.number);
- nv.setVisibility(View.VISIBLE);
- } else {
- nv.setVisibility(View.GONE);
- }
- break;
- }
- }
- }
-
- public void update(Context context, IconData data) throws StatusBarException {
- if (mData.type != data.type) {
- throw new StatusBarException("status bar entry type can't change");
- }
- switch (data.type) {
- case IconData.TEXT:
- if (!TextUtils.equals(mData.text, data.text)) {
- TextView tv = mTextView;
- tv.setText(data.text);
- }
- break;
- case IconData.ICON:
- if (((mData.iconPackage != null && data.iconPackage != null)
- && !mData.iconPackage.equals(data.iconPackage))
- || mData.iconId != data.iconId
- || mData.iconLevel != data.iconLevel) {
- ImageView im = mImageView;
- im.setImageDrawable(getIcon(context, data));
- im.setImageLevel(data.iconLevel);
- }
- if (mData.number != data.number) {
- TextView nv = mNumberView;
- if (data.number > 0) {
- nv.setText("" + data.number);
- } else {
- nv.setText("");
- }
- }
- break;
- }
- mData.copyFrom(data);
- }
-
- public void update(int number) {
- if (mData.number != number) {
- TextView nv = mNumberView;
- if (number > 0) {
- nv.setText("" + number);
- } else {
- nv.setText("");
- }
- }
- mData.number = number;
- }
-
-
- /**
- * Returns the right icon to use for this item, respecting the iconId and
- * iconPackage (if set)
- *
- * @param context Context to use to get resources if iconPackage is not set
- * @return Drawable for this item, or null if the package or item could not
- * be found
- */
- static Drawable getIcon(Context context, IconData data) {
-
- Resources r = null;
-
- if (data.iconPackage != null) {
- try {
- r = context.getPackageManager().getResourcesForApplication(data.iconPackage);
- } catch (PackageManager.NameNotFoundException ex) {
- Slog.e(PhoneStatusBarService.TAG, "Icon package not found: " + data.iconPackage, ex);
- return null;
- }
- } else {
- r = context.getResources();
- }
-
- if (data.iconId == 0) {
- Slog.w(PhoneStatusBarService.TAG, "No icon ID for slot " + data.slot);
- return null;
- }
-
- try {
- return r.getDrawable(data.iconId);
- } catch (RuntimeException e) {
- Slog.w(PhoneStatusBarService.TAG, "Icon not found in "
- + (data.iconPackage != null ? data.iconId : "<system>")
- + ": " + Integer.toHexString(data.iconId));
- }
-
- return null;
- }
-
- int getNumber() {
- return mData.number;
- }
-}
-
diff --git a/packages/StatusBarPhone/src/com/android/policy/statusbar/phone/StatusBarService.java b/packages/StatusBarPhone/src/com/android/policy/statusbar/phone/StatusBarService.java
index c2db405..d783c11 100644
--- a/packages/StatusBarPhone/src/com/android/policy/statusbar/phone/StatusBarService.java
+++ b/packages/StatusBarPhone/src/com/android/policy/statusbar/phone/StatusBarService.java
@@ -37,7 +37,6 @@ import com.android.internal.statusbar.IStatusBarService;
import com.android.internal.statusbar.StatusBarIcon;
import com.android.internal.statusbar.StatusBarIconList;
-import com.android.server.status.IconData;
import com.android.server.status.NotificationData;
public abstract class StatusBarService extends Service implements CommandQueue.Callbacks {
@@ -49,7 +48,6 @@ public abstract class StatusBarService extends Service implements CommandQueue.C
/* TODO
H mHandler = new H();
Object mQueueLock = new Object();
- ArrayList<PendingOp> mQueue = new ArrayList<PendingOp>();
NotificationCallbacks mNotificationCallbacks;
*/