Loading proguard.flags +6 −0 Original line number Diff line number Diff line Loading @@ -24,3 +24,9 @@ -keep class ** { *** *ForTest(...); } # Any class or method annotated with NeededForTesting. -keep @com.android.contacts.test.NeededForTesting class * -keepclassmembers class * { @com.android.contacts.test.NeededForTesting *; } src/com/android/contacts/calllog/CallTypeIconsView.java +3 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.contacts.calllog; import com.android.contacts.R; import com.android.contacts.test.NeededForTesting; import com.google.common.collect.Lists; import android.content.Context; Loading Loading @@ -64,10 +65,12 @@ public class CallTypeIconsView extends View { invalidate(); } @NeededForTesting public int getCount() { return mCallTypes.size(); } @NeededForTesting public int getCallType(int index) { return mCallTypes.get(index); } Loading src/com/android/contacts/test/NeededForTesting.java 0 → 100644 +30 −0 Original line number Diff line number Diff line /* * Copyright (C) 2011 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.contacts.test; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Denotes that the class, constructor, method or field is used by tests and therefore cannot be * removed by tools like ProGuard. */ @Retention(RetentionPolicy.CLASS) @Target({ElementType.TYPE, ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.FIELD}) public @interface NeededForTesting {} src/com/android/contacts/util/ExpirableCache.java +3 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.contacts.util; import com.android.contacts.test.NeededForTesting; import android.util.LruCache; import java.util.concurrent.atomic.AtomicInteger; Loading Loading @@ -198,6 +200,7 @@ public class ExpirableCache<K, V> { * * @param key the key to look up */ @NeededForTesting public V get(K key) { CachedValue<V> cachedValue = getCachedValue(key); return cachedValue == null || cachedValue.isExpired() ? null : cachedValue.getValue(); Loading src/com/android/contacts/util/StreamItemEntry.java +3 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.contacts.util; import com.android.contacts.test.NeededForTesting; import android.database.Cursor; import android.provider.ContactsContract.StreamItems; Loading Loading @@ -46,6 +48,7 @@ public class StreamItemEntry implements Comparable<StreamItemEntry> { // Photos associated with this stream item. private List<StreamItemPhotoEntry> mPhotos; @NeededForTesting public StreamItemEntry(long id, String text, String comments, long timestamp, String action, String actionUri, String resPackage, int iconRes, int labelRes) { mId = id; Loading Loading
proguard.flags +6 −0 Original line number Diff line number Diff line Loading @@ -24,3 +24,9 @@ -keep class ** { *** *ForTest(...); } # Any class or method annotated with NeededForTesting. -keep @com.android.contacts.test.NeededForTesting class * -keepclassmembers class * { @com.android.contacts.test.NeededForTesting *; }
src/com/android/contacts/calllog/CallTypeIconsView.java +3 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.contacts.calllog; import com.android.contacts.R; import com.android.contacts.test.NeededForTesting; import com.google.common.collect.Lists; import android.content.Context; Loading Loading @@ -64,10 +65,12 @@ public class CallTypeIconsView extends View { invalidate(); } @NeededForTesting public int getCount() { return mCallTypes.size(); } @NeededForTesting public int getCallType(int index) { return mCallTypes.get(index); } Loading
src/com/android/contacts/test/NeededForTesting.java 0 → 100644 +30 −0 Original line number Diff line number Diff line /* * Copyright (C) 2011 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.contacts.test; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Denotes that the class, constructor, method or field is used by tests and therefore cannot be * removed by tools like ProGuard. */ @Retention(RetentionPolicy.CLASS) @Target({ElementType.TYPE, ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.FIELD}) public @interface NeededForTesting {}
src/com/android/contacts/util/ExpirableCache.java +3 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.contacts.util; import com.android.contacts.test.NeededForTesting; import android.util.LruCache; import java.util.concurrent.atomic.AtomicInteger; Loading Loading @@ -198,6 +200,7 @@ public class ExpirableCache<K, V> { * * @param key the key to look up */ @NeededForTesting public V get(K key) { CachedValue<V> cachedValue = getCachedValue(key); return cachedValue == null || cachedValue.isExpired() ? null : cachedValue.getValue(); Loading
src/com/android/contacts/util/StreamItemEntry.java +3 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.contacts.util; import com.android.contacts.test.NeededForTesting; import android.database.Cursor; import android.provider.ContactsContract.StreamItems; Loading Loading @@ -46,6 +48,7 @@ public class StreamItemEntry implements Comparable<StreamItemEntry> { // Photos associated with this stream item. private List<StreamItemPhotoEntry> mPhotos; @NeededForTesting public StreamItemEntry(long id, String text, String comments, long timestamp, String action, String actionUri, String resPackage, int iconRes, int labelRes) { mId = id; Loading