summaryrefslogtreecommitdiff
path: root/library/main/src/com/android/setupwizardlib
diff options
context:
space:
mode:
authorMaurice Lam <yukl@google.com>2016-12-06 20:31:57 -0800
committerMaurice Lam <yukl@google.com>2016-12-06 20:31:57 -0800
commit903f83af5ba54075275b455a24c4273143fcb86a (patch)
treeff9bce0bf5fb7979f7fb2412fe375a13f6302022 /library/main/src/com/android/setupwizardlib
parent24a8b72c61224e3496eb5433e5308304d03dc43e (diff)
downloadsetupwizard-903f83af5ba54075275b455a24c4273143fcb86a.tar.gz
[SuwLib] Remove copied annotation classes
Use support-annotation instead. Test: Existing tests pass (./gradlew connectedAndroidTest) Change-Id: I9ef63db551e713f1ee26e7563da86b379d84c811
Diffstat (limited to 'library/main/src/com/android/setupwizardlib')
-rw-r--r--library/main/src/com/android/setupwizardlib/GlifPatternDrawable.java3
-rw-r--r--library/main/src/com/android/setupwizardlib/TemplateLayout.java5
-rw-r--r--library/main/src/com/android/setupwizardlib/annotations/Keep.java49
-rw-r--r--library/main/src/com/android/setupwizardlib/annotations/VisibleForTesting.java50
-rw-r--r--library/main/src/com/android/setupwizardlib/util/Partner.java3
-rw-r--r--library/main/src/com/android/setupwizardlib/view/BottomScrollView.java3
6 files changed, 5 insertions, 108 deletions
diff --git a/library/main/src/com/android/setupwizardlib/GlifPatternDrawable.java b/library/main/src/com/android/setupwizardlib/GlifPatternDrawable.java
index 5615b0d..e31edb3 100644
--- a/library/main/src/com/android/setupwizardlib/GlifPatternDrawable.java
+++ b/library/main/src/com/android/setupwizardlib/GlifPatternDrawable.java
@@ -33,8 +33,7 @@ import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.support.annotation.NonNull;
-
-import com.android.setupwizardlib.annotations.VisibleForTesting;
+import android.support.annotation.VisibleForTesting;
import java.lang.ref.SoftReference;
diff --git a/library/main/src/com/android/setupwizardlib/TemplateLayout.java b/library/main/src/com/android/setupwizardlib/TemplateLayout.java
index 3ffc3d8..90666d2 100644
--- a/library/main/src/com/android/setupwizardlib/TemplateLayout.java
+++ b/library/main/src/com/android/setupwizardlib/TemplateLayout.java
@@ -20,6 +20,7 @@ import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Build.VERSION_CODES;
+import android.support.annotation.Keep;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
@@ -27,8 +28,6 @@ import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.FrameLayout;
-import com.android.setupwizardlib.annotations.Keep;
-
/**
* A generic template class that inflates a template, provided in the constructor or in
* {@code android:layout} through XML, and adds its children to a "container" in the template. When
@@ -151,7 +150,7 @@ public class TemplateLayout extends FrameLayout {
* stripped out by proguard when using this with {@link android.animation.ObjectAnimator}. You
* may need to add
* <code>
- * -keep @com.android.setupwizardlib.annotations.Keep class *
+ * -keep @android.support.annotation.Keep class *
* </code>
* to your proguard configuration if you are seeing mysterious {@link NoSuchMethodError} at
* runtime.
diff --git a/library/main/src/com/android/setupwizardlib/annotations/Keep.java b/library/main/src/com/android/setupwizardlib/annotations/Keep.java
deleted file mode 100644
index 6ad3bf2..0000000
--- a/library/main/src/com/android/setupwizardlib/annotations/Keep.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2015 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.setupwizardlib.annotations;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
-import static java.lang.annotation.ElementType.CONSTRUCTOR;
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PACKAGE;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.CLASS;
-
-/**
- * Denotes that the annotated element should not be removed when
- * the code is minified at build time. This is typically used
- * on methods and classes that are accessed only via reflection
- * so a compiler may think that the code is unused.
- * <p>
- * Example:
- * <pre>{@code
- * &#64;Keep
- * public void foo() {
- * ...
- * }
- * }</pre>
- *
- * Copied from android.support.annotation.Keep
- * TODO: Add support annotation library as a dependency and use that.
- */
-@Retention(CLASS)
-@Target({PACKAGE,TYPE,ANNOTATION_TYPE,CONSTRUCTOR,METHOD,FIELD})
-public @interface Keep {
-}
diff --git a/library/main/src/com/android/setupwizardlib/annotations/VisibleForTesting.java b/library/main/src/com/android/setupwizardlib/annotations/VisibleForTesting.java
deleted file mode 100644
index 7115116..0000000
--- a/library/main/src/com/android/setupwizardlib/annotations/VisibleForTesting.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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.setupwizardlib.annotations;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-/**
- * Denotes that the class, method or field has its visibility relaxed so
- * that unit tests can access it.
- * <p/>
- * The <code>visibility</code> argument can be used to specific what the original
- * visibility should have been if it had not been made public or package-private for testing.
- * The default is to consider the element private.
- */
-@Retention(RetentionPolicy.SOURCE)
-public @interface VisibleForTesting {
- /**
- * Intended visibility if the element had not been made public or package-private for
- * testing.
- */
- enum Visibility {
- /** The element should be considered protected. */
- PROTECTED,
- /** The element should be considered package-private. */
- PACKAGE,
- /** The element should be considered private. */
- PRIVATE
- }
-
- /**
- * Intended visibility if the element had not been made public or package-private for testing.
- * If not specified, one should assume the element originally intended to be private.
- */
- Visibility visibility() default Visibility.PRIVATE;
-} \ No newline at end of file
diff --git a/library/main/src/com/android/setupwizardlib/util/Partner.java b/library/main/src/com/android/setupwizardlib/util/Partner.java
index fd187d9..ada42e0 100644
--- a/library/main/src/com/android/setupwizardlib/util/Partner.java
+++ b/library/main/src/com/android/setupwizardlib/util/Partner.java
@@ -24,10 +24,9 @@ import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.ResolveInfo;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
+import android.support.annotation.VisibleForTesting;
import android.util.Log;
-import com.android.setupwizardlib.annotations.VisibleForTesting;
-
/**
* Utilities to discover and interact with partner customizations. An overlay package is one that
* registers the broadcast receiver for {@code com.android.setupwizard.action.PARTNER_CUSTOMIZATION}
diff --git a/library/main/src/com/android/setupwizardlib/view/BottomScrollView.java b/library/main/src/com/android/setupwizardlib/view/BottomScrollView.java
index b08cfc8..aac6668 100644
--- a/library/main/src/com/android/setupwizardlib/view/BottomScrollView.java
+++ b/library/main/src/com/android/setupwizardlib/view/BottomScrollView.java
@@ -17,12 +17,11 @@
package com.android.setupwizardlib.view;
import android.content.Context;
+import android.support.annotation.VisibleForTesting;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ScrollView;
-import com.android.setupwizardlib.annotations.VisibleForTesting;
-
/**
* An extension of ScrollView that will invoke a listener callback when the ScrollView needs
* scrolling, and when the ScrollView is being scrolled to the bottom. This is often used in Setup