Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Merge "Add private constructors to static utility classes." into pi-p…
Browse files Browse the repository at this point in the history
…review1-androidx-dev

am: 82dc1e2

Change-Id: I330a32cebdb47c0419043484165682facb869467
  • Loading branch information
JakeWharton authored and android-build-merger committed Mar 29, 2018
2 parents d517139 + 82dc1e2 commit 8c5c76e
Show file tree
Hide file tree
Showing 101 changed files with 345 additions and 6 deletions.
Expand Up @@ -79,4 +79,7 @@ static int binarySearch(long[] array, int size, long value) {
}
return ~lo; // value not present
}

private ContainerHelpers() {
}
}
3 changes: 3 additions & 0 deletions compat/src/main/java/androidx/core/app/BundleCompat.java
Expand Up @@ -41,6 +41,9 @@ static class BundleCompatBaseImpl {
private static Method sPutIBinderMethod;
private static boolean sPutIBinderMethodFetched;

private BundleCompatBaseImpl() {
}

public static IBinder getBinder(Bundle bundle, String key) {
if (!sGetIBinderMethodFetched) {
try {
Expand Down
Expand Up @@ -338,4 +338,7 @@ private static Bundle[] getBundleArrayFromBundle(Bundle bundle, String key) {
bundle.putParcelableArray(key, typedArray);
return typedArray;
}

private NotificationCompatJellybean() {
}
}
Expand Up @@ -308,4 +308,7 @@ private static void skip(XmlPullParser parser) throws XmlPullParserException, IO
}
}
}

private FontResourcesParserCompat() {
}
}
Expand Up @@ -294,4 +294,7 @@ public static int getAttr(@NonNull Context context, int attr, int fallbackAttr)
}
return fallbackAttr;
}

private TypedArrayUtils() {
}
}
3 changes: 3 additions & 0 deletions compat/src/main/java/androidx/core/graphics/PathParser.java
Expand Up @@ -758,4 +758,7 @@ private static void arcToBezier(Path p,
}
}
}

private PathParser() {
}
}
3 changes: 3 additions & 0 deletions compat/src/main/java/androidx/core/os/LocaleHelper.java
Expand Up @@ -69,4 +69,7 @@ static String toLanguageTag(Locale locale) {

return buf.toString();
}

private LocaleHelper() {
}
}
3 changes: 3 additions & 0 deletions compat/src/main/java/androidx/core/text/util/FindAddress.java
Expand Up @@ -513,4 +513,7 @@ public static String findAddress(String content) {
}
return null;
}

private FindAddress() {
}
}
3 changes: 3 additions & 0 deletions compat/src/main/java/androidx/core/util/DebugUtils.java
Expand Up @@ -45,4 +45,7 @@ public static void buildShortClassTag(Object cls, StringBuilder out) {
out.append(Integer.toHexString(System.identityHashCode(cls)));
}
}

private DebugUtils() {
}
}
3 changes: 3 additions & 0 deletions compat/src/main/java/androidx/core/util/Preconditions.java
Expand Up @@ -462,4 +462,7 @@ public static float[] checkArrayElementsInRange(float[] value, float lower, floa

return value;
}

private Preconditions() {
}
}
Expand Up @@ -92,4 +92,7 @@ private static void offsetDescendantMatrix(ViewParent target, View view, Matrix
m.preConcat(view.getMatrix());
}
}

private ViewGroupUtils() {
}
}
Expand Up @@ -450,4 +450,7 @@ public interface CollectionAdapter<T, V> {
V get(T collection, int index);
int size(T collection);
}

private FocusStrategy() {
}
}
Expand Up @@ -209,4 +209,7 @@ private static void closeQuietly(@Nullable AutoCloseable closeable) {
}
}
}

private DocumentsContractApi19() {
}
}
Expand Up @@ -341,4 +341,7 @@ public long getPosition() {
return mByteBuffer.position();
}
}

private MetadataListReader() {
}
}
Expand Up @@ -3812,6 +3812,9 @@ static class FragmentTag {
public static final int Fragment_id = 1;
public static final int Fragment_name = 0;
public static final int Fragment_tag = 2;

private FragmentTag() {
}
}

/**
Expand Down
Expand Up @@ -1254,4 +1254,7 @@ static class FragmentContainerTransition {
*/
public BackStackRecord firstOutTransaction;
}

private FragmentTransition() {
}
}
Expand Up @@ -145,4 +145,7 @@ private static Interpolator createInterpolatorFromXml(Context context, Resources
}
return interpolator;
}

private AnimationUtilsCompat() {
}
}
Expand Up @@ -917,5 +917,8 @@ private static boolean isColorType(int type) {
return (type >= TypedValue.TYPE_FIRST_COLOR_INT) && (type
<= TypedValue.TYPE_LAST_COLOR_INT);
}

private AnimatorInflaterCompat() {
}
}

Expand Up @@ -146,4 +146,7 @@ class AndroidResources {
public static final int FAST_OUT_LINEAR_IN = 0x010c000f;
public static final int FAST_OUT_SLOW_IN = 0x010c000d;
public static final int LINEAR_OUT_SLOW_IN = 0x010c000e;

private AndroidResources() {
}
}
Expand Up @@ -44,4 +44,6 @@ public static void addTransitions(Fragment f) {
}


private LeanbackPreferenceFragmentTransitionHelperApi21() {
}
}
Expand Up @@ -154,4 +154,6 @@ public void onTransitionResume(Transition transition) {
}
}

private TranslationAnimationCreator() {
}
}
Expand Up @@ -26,4 +26,7 @@ static Context getContext(Fragment fragment) {
}
return fragment.getActivity();
}

private FragmentUtil() {
}
}
Expand Up @@ -32,4 +32,6 @@ public static void requestPermissions(android.app.Fragment fragment, String[] pe
}
}

private PermissionHelper() {
}
}
Expand Up @@ -55,4 +55,7 @@ public static Object loadTitleOutTransition(Context context) {
slide.addTarget(R.id.browse_title_group);
return slide;
}

private LeanbackTransitionHelper() {
}
}
Expand Up @@ -464,4 +464,7 @@ public Rect onGetEpicenter(Transition transition11) {
}
}
}

private TransitionHelper() {
}
}
Expand Up @@ -40,4 +40,7 @@ public static void setBackgroundPreservingAlpha(View view, Drawable drawable) {
view.setBackground(drawable);
}
}

private BackgroundHelper() {
}
}
Expand Up @@ -25,4 +25,7 @@ static void setForeground(View view, Drawable drawable) {
view.setForeground(drawable);
}
}

private ForegroundHelper() {
}
}
Expand Up @@ -105,4 +105,6 @@ static int getAlignmentPosition(View itemView, ItemAlignmentFacet.ItemAlignmentD
return alignPos;
}

private ItemAlignmentFacetHelper() {
}
}
Expand Up @@ -59,4 +59,7 @@ public static void setClipToRoundedOutline(View view, boolean clip, int roundedC
}
view.setClipToOutline(clip);
}

private RoundedRectHelperApi21() {
}
}
Expand Up @@ -58,4 +58,7 @@ public static void setShadowFocusLevel(Object object, float level) {
ShadowImpl impl = (ShadowImpl) object;
impl.mShadowContainer.setZ(impl.mNormalZ + level * (impl.mFocusedZ - impl.mNormalZ));
}

private ShadowHelperApi21() {
}
}
5 changes: 4 additions & 1 deletion leanback/src/main/java/androidx/leanback/widget/Util.java
Expand Up @@ -43,4 +43,7 @@ public static boolean isDescendant(ViewGroup parent, View child) {
}
return false;
}
}

private Util() {
}
}
Expand Up @@ -95,4 +95,7 @@ public static Calendar getCalendarForLocale(Calendar oldCalendar, Locale locale)
return newCalendar;
}
}

private PickerUtility() {
}
}
Expand Up @@ -148,5 +148,11 @@ public static int getFlags(Object itemObj) {
public static Object getDescription(Object itemObj) {
return ((MediaBrowser.MediaItem) itemObj).getDescription();
}

private MediaItem() {
}
}

private MediaBrowserCompatApi21() {
}
}
Expand Up @@ -99,5 +99,11 @@ public static void setExtras(Object builderObj, Bundle extras) {
public static Object build(Object builderObj) {
return ((MediaDescription.Builder) builderObj).build();
}

private Builder() {
}
}

private MediaDescriptionCompatApi21() {
}
}
Expand Up @@ -83,5 +83,11 @@ public static void putString(Object builderObj, String key, String value) {
public static Object build(Object builderObj) {
return ((MediaMetadata.Builder)builderObj).build();
}

private Builder() {
}
}

private MediaMetadataCompatApi21() {
}
}
Expand Up @@ -48,4 +48,7 @@ static Object newInstance(List<MediaBrowser.MediaItem> itemList) {
}
return result;
}

private ParceledListSliceAdapterApi21() {
}
}
Expand Up @@ -186,6 +186,9 @@ public static void skipToQueueItem(Object controlsObj, long id) {
public static void sendCustomAction(Object controlsObj, String action, Bundle args) {
((MediaController.TransportControls) controlsObj).sendCustomAction(action, args);
}

private TransportControls() {
}
}

public static class PlaybackInfo {
Expand Down Expand Up @@ -258,6 +261,9 @@ private static int toLegacyStreamType(AudioAttributes aa) {
return AudioManager.STREAM_MUSIC;
}
}

private PlaybackInfo() {
}
}

public static interface Callback {
Expand Down Expand Up @@ -320,4 +326,7 @@ public void onAudioInfoChanged(MediaController.PlaybackInfo info){
info.getMaxVolume(), info.getCurrentVolume());
}
}

private MediaControllerCompatApi21() {
}
}
Expand Up @@ -269,5 +269,11 @@ public static Object getDescription(Object queueItem) {
public static long getQueueId(Object queueItem) {
return ((MediaSession.QueueItem) queueItem).getQueueId();
}

private QueueItem() {
}
}

private MediaSessionCompatApi21() {
}
}
Expand Up @@ -100,5 +100,11 @@ public static Object newInstance(String action, CharSequence name,
customActionObj.setExtras(extras);
return customActionObj.build();
}

private CustomAction() {
}
}

private PlaybackStateCompatApi21() {
}
}
3 changes: 3 additions & 0 deletions media/api21/androidx/media/AudioAttributesCompatApi21.java
Expand Up @@ -65,4 +65,7 @@ public AudioAttributes unwrap() {
return mWrapped;
}
}

private AudioAttributesCompatApi21() {
}
}
Expand Up @@ -129,4 +129,7 @@ public void onLoadChildren(String parentId, Result<List<MediaBrowser.MediaItem>>
mServiceProxy.onLoadChildren(parentId, new ResultWrapper<List<Parcel>>(result));
}
}

private MediaBrowserServiceCompatApi21() {
}
}
3 changes: 3 additions & 0 deletions media/api21/androidx/media/VolumeProviderCompatApi21.java
Expand Up @@ -45,4 +45,7 @@ public interface Delegate {
void onSetVolumeTo(int volume);
void onAdjustVolume(int delta);
}

private VolumeProviderCompatApi21() {
}
}
Expand Up @@ -25,4 +25,7 @@ class MediaSessionCompatApi22 {
public static void setRatingType(Object sessionObj, int type) {
((MediaSession) sessionObj).setRatingType(type);
}

private MediaSessionCompatApi22() {
}
}
Expand Up @@ -45,4 +45,7 @@ public static Object newInstance(int state, long position, long bufferedPosition
stateObj.setExtras(extras);
return stateObj.build();
}

private PlaybackStateCompatApi22() {
}
}

0 comments on commit 8c5c76e

Please sign in to comment.