MediaControllerCompatApi21.java
6.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
package android.support.v4.media.session;
import android.annotation.TargetApi;
import android.content.Context;
import android.media.AudioAttributes;
import android.media.MediaMetadata;
import android.media.Rating;
import android.media.session.MediaController;
import android.media.session.MediaController.Callback;
import android.media.session.MediaController.PlaybackInfo;
import android.media.session.MediaController.TransportControls;
import android.media.session.MediaSession.QueueItem;
import android.media.session.MediaSession.Token;
import android.media.session.PlaybackState;
import android.os.Bundle;
import android.support.annotation.RequiresApi;
import java.util.List;
@TargetApi(21)
@RequiresApi(21)
final class MediaControllerCompatApi21
{
public static Object a(Context paramContext, Object paramObject)
{
return new MediaController(paramContext, (MediaSession.Token)paramObject);
}
public static abstract interface Callback
{
public abstract void onAudioInfoChanged(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5);
public abstract void onExtrasChanged(Bundle paramBundle);
public abstract void onMetadataChanged(Object paramObject);
public abstract void onPlaybackStateChanged(Object paramObject);
public abstract void onQueueChanged(List<?> paramList);
public abstract void onQueueTitleChanged(CharSequence paramCharSequence);
public abstract void onSessionDestroyed();
public abstract void onSessionEvent(String paramString, Bundle paramBundle);
}
public static class PlaybackInfo
{
public static AudioAttributes getAudioAttributes(Object paramObject)
{
return ((MediaController.PlaybackInfo)paramObject).getAudioAttributes();
}
public static int getCurrentVolume(Object paramObject)
{
return ((MediaController.PlaybackInfo)paramObject).getCurrentVolume();
}
public static int getLegacyAudioStream(Object paramObject)
{
int i = 3;
paramObject = getAudioAttributes(paramObject);
if ((((AudioAttributes)paramObject).getFlags() & 0x1) == 1)
{
i = 7;
return i;
}
if ((((AudioAttributes)paramObject).getFlags() & 0x4) == 4) {
return 6;
}
switch (((AudioAttributes)paramObject).getUsage())
{
case 1:
case 11:
case 12:
case 14:
default:
return 3;
case 2:
return 0;
case 13:
return 1;
case 3:
return 8;
case 4:
return 4;
case 6:
return 2;
}
return 5;
}
public static int getMaxVolume(Object paramObject)
{
return ((MediaController.PlaybackInfo)paramObject).getMaxVolume();
}
public static int getPlaybackType(Object paramObject)
{
return ((MediaController.PlaybackInfo)paramObject).getPlaybackType();
}
public static int getVolumeControl(Object paramObject)
{
return ((MediaController.PlaybackInfo)paramObject).getVolumeControl();
}
}
public static class TransportControls
{
public static void fastForward(Object paramObject)
{
((MediaController.TransportControls)paramObject).fastForward();
}
public static void pause(Object paramObject)
{
((MediaController.TransportControls)paramObject).pause();
}
public static void play(Object paramObject)
{
((MediaController.TransportControls)paramObject).play();
}
public static void playFromMediaId(Object paramObject, String paramString, Bundle paramBundle)
{
((MediaController.TransportControls)paramObject).playFromMediaId(paramString, paramBundle);
}
public static void playFromSearch(Object paramObject, String paramString, Bundle paramBundle)
{
((MediaController.TransportControls)paramObject).playFromSearch(paramString, paramBundle);
}
public static void rewind(Object paramObject)
{
((MediaController.TransportControls)paramObject).rewind();
}
public static void seekTo(Object paramObject, long paramLong)
{
((MediaController.TransportControls)paramObject).seekTo(paramLong);
}
public static void sendCustomAction(Object paramObject, String paramString, Bundle paramBundle)
{
((MediaController.TransportControls)paramObject).sendCustomAction(paramString, paramBundle);
}
public static void setRating(Object paramObject1, Object paramObject2)
{
((MediaController.TransportControls)paramObject1).setRating((Rating)paramObject2);
}
public static void skipToNext(Object paramObject)
{
((MediaController.TransportControls)paramObject).skipToNext();
}
public static void skipToPrevious(Object paramObject)
{
((MediaController.TransportControls)paramObject).skipToPrevious();
}
public static void skipToQueueItem(Object paramObject, long paramLong)
{
((MediaController.TransportControls)paramObject).skipToQueueItem(paramLong);
}
public static void stop(Object paramObject)
{
((MediaController.TransportControls)paramObject).stop();
}
}
static final class a<T extends MediaControllerCompatApi21.Callback>
extends MediaController.Callback
{
protected final T a;
public a(T paramT)
{
this.a = paramT;
}
public final void onAudioInfoChanged(MediaController.PlaybackInfo paramPlaybackInfo)
{
this.a.onAudioInfoChanged(paramPlaybackInfo.getPlaybackType(), MediaControllerCompatApi21.PlaybackInfo.getLegacyAudioStream(paramPlaybackInfo), paramPlaybackInfo.getVolumeControl(), paramPlaybackInfo.getMaxVolume(), paramPlaybackInfo.getCurrentVolume());
}
public final void onExtrasChanged(Bundle paramBundle)
{
this.a.onExtrasChanged(paramBundle);
}
public final void onMetadataChanged(MediaMetadata paramMediaMetadata)
{
this.a.onMetadataChanged(paramMediaMetadata);
}
public final void onPlaybackStateChanged(PlaybackState paramPlaybackState)
{
this.a.onPlaybackStateChanged(paramPlaybackState);
}
public final void onQueueChanged(List<MediaSession.QueueItem> paramList)
{
this.a.onQueueChanged(paramList);
}
public final void onQueueTitleChanged(CharSequence paramCharSequence)
{
this.a.onQueueTitleChanged(paramCharSequence);
}
public final void onSessionDestroyed()
{
this.a.onSessionDestroyed();
}
public final void onSessionEvent(String paramString, Bundle paramBundle)
{
this.a.onSessionEvent(paramString, paramBundle);
}
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/android/support/v4/media/session/MediaControllerCompatApi21.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/