summaryrefslogtreecommitdiffstats
path: root/core/java/android/app/Notification.java
diff options
context:
space:
mode:
authorJoe Onorato <joeo@android.com>2010-05-17 22:26:12 -0700
committerJoe Onorato <joeo@android.com>2010-06-02 14:48:43 -0700
commit18e69dfc7235f8a4bfe257f9d1c43539049a22ce (patch)
treeda47804d8acd8680cfdd0fb8fa33dad6e01889c1 /core/java/android/app/Notification.java
parent6528b35585020fafe7e39dfa416f728df5158c63 (diff)
downloadframeworks_base-18e69dfc7235f8a4bfe257f9d1c43539049a22ce.zip
frameworks_base-18e69dfc7235f8a4bfe257f9d1c43539049a22ce.tar.gz
frameworks_base-18e69dfc7235f8a4bfe257f9d1c43539049a22ce.tar.bz2
Checkpoint. Data structures for Notifications in place.
Change-Id: I146fb9bc1d349112541368e2c99a667821dfdf6e
Diffstat (limited to 'core/java/android/app/Notification.java')
-rw-r--r--core/java/android/app/Notification.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 4d72f73..739aca3 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -341,6 +341,44 @@ public class Notification implements Parcelable
iconLevel = parcel.readInt();
}
+ public Notification clone() {
+ Notification that = new Notification();
+
+ that.when = this.when;
+ that.icon = this.icon;
+ that.number = this.number;
+
+ // PendingIntents are global, so there's no reason (or way) to clone them.
+ that.contentIntent = this.contentIntent;
+ that.deleteIntent = this.deleteIntent;
+
+ if (this.tickerText != null) {
+ that.tickerText = this.tickerText.toString();
+ }
+ if (this.contentView != null) {
+ that.contentView = this.contentView.clone();
+ }
+ that.iconLevel = that.iconLevel;
+ that.sound = this.sound; // android.net.Uri is immutable
+ that.audioStreamType = this.audioStreamType;
+
+ final long[] vibrate = this.vibrate;
+ if (vibrate != null) {
+ final int N = vibrate.length;
+ final long[] vib = that.vibrate = new long[N];
+ System.arraycopy(vibrate, 0, vib, 0, N);
+ }
+
+ that.ledARGB = this.ledARGB;
+ that.ledOnMS = this.ledOnMS;
+ that.ledOffMS = this.ledOffMS;
+ that.defaults = this.defaults;
+
+ that.flags = this.flags;
+
+ return that;
+ }
+
public int describeContents() {
return 0;
}