Loading packages/MediaComponents/apex/java/android/media/session/MediaController.java +25 −27 Original line number Diff line number Diff line Loading @@ -153,9 +153,7 @@ public final class MediaController { return false; } try { //TODO(b/119748678): Resolve mContext.getOpPackageName() through this file. // Temporarilly it's replaced with "mContext.getOpPackageName()" for compiling. return mSessionBinder.sendMediaButton("mContext.getOpPackageName()", mCbStub, return mSessionBinder.sendMediaButton(mContext.getOpPackageName(), mCbStub, asSystemService, keyEvent); } catch (RemoteException e) { // System is dead. =( Loading Loading @@ -188,7 +186,7 @@ public final class MediaController { break; } try { mSessionBinder.adjustVolume("mContext.getOpPackageName()", mCbStub, true, mSessionBinder.adjustVolume(mContext.getOpPackageName(), mCbStub, true, direction, AudioManager.FLAG_SHOW_UI); } catch (RemoteException e) { Log.wtf(TAG, "Error calling adjustVolumeBy", e); Loading @@ -199,7 +197,7 @@ public final class MediaController { final int flags = AudioManager.FLAG_PLAY_SOUND | AudioManager.FLAG_VIBRATE | AudioManager.FLAG_FROM_KEY; try { mSessionBinder.adjustVolume("mContext.getOpPackageName()", mCbStub, true, 0, mSessionBinder.adjustVolume(mContext.getOpPackageName(), mCbStub, true, 0, flags); } catch (RemoteException e) { Log.wtf(TAG, "Error calling adjustVolumeBy", e); Loading Loading @@ -369,7 +367,7 @@ public final class MediaController { */ public void setVolumeTo(int value, int flags) { try { mSessionBinder.setVolumeTo("mContext.getOpPackageName()", mCbStub, value, flags); mSessionBinder.setVolumeTo(mContext.getOpPackageName(), mCbStub, value, flags); } catch (RemoteException e) { Log.wtf(TAG, "Error calling setVolumeTo.", e); } Loading @@ -390,7 +388,7 @@ public final class MediaController { */ public void adjustVolume(int direction, int flags) { try { mSessionBinder.adjustVolume("mContext.getOpPackageName()", mCbStub, false, direction, mSessionBinder.adjustVolume(mContext.getOpPackageName(), mCbStub, false, direction, flags); } catch (RemoteException e) { Log.wtf(TAG, "Error calling adjustVolumeBy.", e); Loading Loading @@ -457,7 +455,7 @@ public final class MediaController { throw new IllegalArgumentException("command cannot be null or empty"); } try { mSessionBinder.sendCommand("mContext.getOpPackageName()", mCbStub, command, args, cb); mSessionBinder.sendCommand(mContext.getOpPackageName(), mCbStub, command, args, cb); } catch (RemoteException e) { Log.d(TAG, "Dead object in sendCommand.", e); } Loading Loading @@ -523,7 +521,7 @@ public final class MediaController { if (!mCbRegistered) { try { mSessionBinder.registerCallbackListener("mContext.getOpPackageName()", mCbStub); mSessionBinder.registerCallbackListener(mContext.getOpPackageName(), mCbStub); mCbRegistered = true; } catch (RemoteException e) { Log.e(TAG, "Dead object in registerCallback", e); Loading Loading @@ -670,7 +668,7 @@ public final class MediaController { */ public void prepare() { try { mSessionBinder.prepare("mContext.getOpPackageName()", mCbStub); mSessionBinder.prepare(mContext.getOpPackageName(), mCbStub); } catch (RemoteException e) { Log.wtf(TAG, "Error calling prepare.", e); } Loading @@ -694,7 +692,7 @@ public final class MediaController { "You must specify a non-empty String for prepareFromMediaId."); } try { mSessionBinder.prepareFromMediaId("mContext.getOpPackageName()", mCbStub, mediaId, mSessionBinder.prepareFromMediaId(mContext.getOpPackageName(), mCbStub, mediaId, extras); } catch (RemoteException e) { Log.wtf(TAG, "Error calling prepare(" + mediaId + ").", e); Loading @@ -721,7 +719,7 @@ public final class MediaController { query = ""; } try { mSessionBinder.prepareFromSearch("mContext.getOpPackageName()", mCbStub, query, mSessionBinder.prepareFromSearch(mContext.getOpPackageName(), mCbStub, query, extras); } catch (RemoteException e) { Log.wtf(TAG, "Error calling prepare(" + query + ").", e); Loading @@ -746,7 +744,7 @@ public final class MediaController { "You must specify a non-empty Uri for prepareFromUri."); } try { mSessionBinder.prepareFromUri("mContext.getOpPackageName()", mCbStub, uri, extras); mSessionBinder.prepareFromUri(mContext.getOpPackageName(), mCbStub, uri, extras); } catch (RemoteException e) { Log.wtf(TAG, "Error calling prepare(" + uri + ").", e); } Loading @@ -757,7 +755,7 @@ public final class MediaController { */ public void play() { try { mSessionBinder.play("mContext.getOpPackageName()", mCbStub); mSessionBinder.play(mContext.getOpPackageName(), mCbStub); } catch (RemoteException e) { Log.wtf(TAG, "Error calling play.", e); } Loading @@ -776,7 +774,7 @@ public final class MediaController { "You must specify a non-empty String for playFromMediaId."); } try { mSessionBinder.playFromMediaId("mContext.getOpPackageName()", mCbStub, mediaId, mSessionBinder.playFromMediaId(mContext.getOpPackageName(), mCbStub, mediaId, extras); } catch (RemoteException e) { Log.wtf(TAG, "Error calling play(" + mediaId + ").", e); Loading @@ -799,7 +797,7 @@ public final class MediaController { query = ""; } try { mSessionBinder.playFromSearch("mContext.getOpPackageName()", mCbStub, query, extras); mSessionBinder.playFromSearch(mContext.getOpPackageName(), mCbStub, query, extras); } catch (RemoteException e) { Log.wtf(TAG, "Error calling play(" + query + ").", e); } Loading @@ -818,7 +816,7 @@ public final class MediaController { "You must specify a non-empty Uri for playFromUri."); } try { mSessionBinder.playFromUri("mContext.getOpPackageName()", mCbStub, uri, extras); mSessionBinder.playFromUri(mContext.getOpPackageName(), mCbStub, uri, extras); } catch (RemoteException e) { Log.wtf(TAG, "Error calling play(" + uri + ").", e); } Loading @@ -830,7 +828,7 @@ public final class MediaController { */ public void skipToQueueItem(long id) { try { mSessionBinder.skipToQueueItem("mContext.getOpPackageName()", mCbStub, id); mSessionBinder.skipToQueueItem(mContext.getOpPackageName(), mCbStub, id); } catch (RemoteException e) { Log.wtf(TAG, "Error calling skipToItem(" + id + ").", e); } Loading @@ -842,7 +840,7 @@ public final class MediaController { */ public void pause() { try { mSessionBinder.pause("mContext.getOpPackageName()", mCbStub); mSessionBinder.pause(mContext.getOpPackageName(), mCbStub); } catch (RemoteException e) { Log.wtf(TAG, "Error calling pause.", e); } Loading @@ -854,7 +852,7 @@ public final class MediaController { */ public void stop() { try { mSessionBinder.stop("mContext.getOpPackageName()", mCbStub); mSessionBinder.stop(mContext.getOpPackageName(), mCbStub); } catch (RemoteException e) { Log.wtf(TAG, "Error calling stop.", e); } Loading @@ -867,7 +865,7 @@ public final class MediaController { */ public void seekTo(long pos) { try { mSessionBinder.seekTo("mContext.getOpPackageName()", mCbStub, pos); mSessionBinder.seekTo(mContext.getOpPackageName(), mCbStub, pos); } catch (RemoteException e) { Log.wtf(TAG, "Error calling seekTo.", e); } Loading @@ -879,7 +877,7 @@ public final class MediaController { */ public void fastForward() { try { mSessionBinder.fastForward("mContext.getOpPackageName()", mCbStub); mSessionBinder.fastForward(mContext.getOpPackageName(), mCbStub); } catch (RemoteException e) { Log.wtf(TAG, "Error calling fastForward.", e); } Loading @@ -890,7 +888,7 @@ public final class MediaController { */ public void skipToNext() { try { mSessionBinder.next("mContext.getOpPackageName()", mCbStub); mSessionBinder.next(mContext.getOpPackageName(), mCbStub); } catch (RemoteException e) { Log.wtf(TAG, "Error calling next.", e); } Loading @@ -902,7 +900,7 @@ public final class MediaController { */ public void rewind() { try { mSessionBinder.rewind("mContext.getOpPackageName()", mCbStub); mSessionBinder.rewind(mContext.getOpPackageName(), mCbStub); } catch (RemoteException e) { Log.wtf(TAG, "Error calling rewind.", e); } Loading @@ -913,7 +911,7 @@ public final class MediaController { */ public void skipToPrevious() { try { mSessionBinder.previous("mContext.getOpPackageName()", mCbStub); mSessionBinder.previous(mContext.getOpPackageName(), mCbStub); } catch (RemoteException e) { Log.wtf(TAG, "Error calling previous.", e); } Loading @@ -928,7 +926,7 @@ public final class MediaController { */ public void setRating(Rating rating) { try { mSessionBinder.rate("mContext.getOpPackageName()", mCbStub, rating); mSessionBinder.rate(mContext.getOpPackageName(), mCbStub, rating); } catch (RemoteException e) { Log.wtf(TAG, "Error calling rate.", e); } Loading Loading @@ -963,7 +961,7 @@ public final class MediaController { throw new IllegalArgumentException("CustomAction cannot be null."); } try { mSessionBinder.sendCustomAction("mContext.getOpPackageName()", mCbStub, action, args); mSessionBinder.sendCustomAction(mContext.getOpPackageName(), mCbStub, action, args); } catch (RemoteException e) { Log.d(TAG, "Dead object in sendCustomAction.", e); } Loading Loading
packages/MediaComponents/apex/java/android/media/session/MediaController.java +25 −27 Original line number Diff line number Diff line Loading @@ -153,9 +153,7 @@ public final class MediaController { return false; } try { //TODO(b/119748678): Resolve mContext.getOpPackageName() through this file. // Temporarilly it's replaced with "mContext.getOpPackageName()" for compiling. return mSessionBinder.sendMediaButton("mContext.getOpPackageName()", mCbStub, return mSessionBinder.sendMediaButton(mContext.getOpPackageName(), mCbStub, asSystemService, keyEvent); } catch (RemoteException e) { // System is dead. =( Loading Loading @@ -188,7 +186,7 @@ public final class MediaController { break; } try { mSessionBinder.adjustVolume("mContext.getOpPackageName()", mCbStub, true, mSessionBinder.adjustVolume(mContext.getOpPackageName(), mCbStub, true, direction, AudioManager.FLAG_SHOW_UI); } catch (RemoteException e) { Log.wtf(TAG, "Error calling adjustVolumeBy", e); Loading @@ -199,7 +197,7 @@ public final class MediaController { final int flags = AudioManager.FLAG_PLAY_SOUND | AudioManager.FLAG_VIBRATE | AudioManager.FLAG_FROM_KEY; try { mSessionBinder.adjustVolume("mContext.getOpPackageName()", mCbStub, true, 0, mSessionBinder.adjustVolume(mContext.getOpPackageName(), mCbStub, true, 0, flags); } catch (RemoteException e) { Log.wtf(TAG, "Error calling adjustVolumeBy", e); Loading Loading @@ -369,7 +367,7 @@ public final class MediaController { */ public void setVolumeTo(int value, int flags) { try { mSessionBinder.setVolumeTo("mContext.getOpPackageName()", mCbStub, value, flags); mSessionBinder.setVolumeTo(mContext.getOpPackageName(), mCbStub, value, flags); } catch (RemoteException e) { Log.wtf(TAG, "Error calling setVolumeTo.", e); } Loading @@ -390,7 +388,7 @@ public final class MediaController { */ public void adjustVolume(int direction, int flags) { try { mSessionBinder.adjustVolume("mContext.getOpPackageName()", mCbStub, false, direction, mSessionBinder.adjustVolume(mContext.getOpPackageName(), mCbStub, false, direction, flags); } catch (RemoteException e) { Log.wtf(TAG, "Error calling adjustVolumeBy.", e); Loading Loading @@ -457,7 +455,7 @@ public final class MediaController { throw new IllegalArgumentException("command cannot be null or empty"); } try { mSessionBinder.sendCommand("mContext.getOpPackageName()", mCbStub, command, args, cb); mSessionBinder.sendCommand(mContext.getOpPackageName(), mCbStub, command, args, cb); } catch (RemoteException e) { Log.d(TAG, "Dead object in sendCommand.", e); } Loading Loading @@ -523,7 +521,7 @@ public final class MediaController { if (!mCbRegistered) { try { mSessionBinder.registerCallbackListener("mContext.getOpPackageName()", mCbStub); mSessionBinder.registerCallbackListener(mContext.getOpPackageName(), mCbStub); mCbRegistered = true; } catch (RemoteException e) { Log.e(TAG, "Dead object in registerCallback", e); Loading Loading @@ -670,7 +668,7 @@ public final class MediaController { */ public void prepare() { try { mSessionBinder.prepare("mContext.getOpPackageName()", mCbStub); mSessionBinder.prepare(mContext.getOpPackageName(), mCbStub); } catch (RemoteException e) { Log.wtf(TAG, "Error calling prepare.", e); } Loading @@ -694,7 +692,7 @@ public final class MediaController { "You must specify a non-empty String for prepareFromMediaId."); } try { mSessionBinder.prepareFromMediaId("mContext.getOpPackageName()", mCbStub, mediaId, mSessionBinder.prepareFromMediaId(mContext.getOpPackageName(), mCbStub, mediaId, extras); } catch (RemoteException e) { Log.wtf(TAG, "Error calling prepare(" + mediaId + ").", e); Loading @@ -721,7 +719,7 @@ public final class MediaController { query = ""; } try { mSessionBinder.prepareFromSearch("mContext.getOpPackageName()", mCbStub, query, mSessionBinder.prepareFromSearch(mContext.getOpPackageName(), mCbStub, query, extras); } catch (RemoteException e) { Log.wtf(TAG, "Error calling prepare(" + query + ").", e); Loading @@ -746,7 +744,7 @@ public final class MediaController { "You must specify a non-empty Uri for prepareFromUri."); } try { mSessionBinder.prepareFromUri("mContext.getOpPackageName()", mCbStub, uri, extras); mSessionBinder.prepareFromUri(mContext.getOpPackageName(), mCbStub, uri, extras); } catch (RemoteException e) { Log.wtf(TAG, "Error calling prepare(" + uri + ").", e); } Loading @@ -757,7 +755,7 @@ public final class MediaController { */ public void play() { try { mSessionBinder.play("mContext.getOpPackageName()", mCbStub); mSessionBinder.play(mContext.getOpPackageName(), mCbStub); } catch (RemoteException e) { Log.wtf(TAG, "Error calling play.", e); } Loading @@ -776,7 +774,7 @@ public final class MediaController { "You must specify a non-empty String for playFromMediaId."); } try { mSessionBinder.playFromMediaId("mContext.getOpPackageName()", mCbStub, mediaId, mSessionBinder.playFromMediaId(mContext.getOpPackageName(), mCbStub, mediaId, extras); } catch (RemoteException e) { Log.wtf(TAG, "Error calling play(" + mediaId + ").", e); Loading @@ -799,7 +797,7 @@ public final class MediaController { query = ""; } try { mSessionBinder.playFromSearch("mContext.getOpPackageName()", mCbStub, query, extras); mSessionBinder.playFromSearch(mContext.getOpPackageName(), mCbStub, query, extras); } catch (RemoteException e) { Log.wtf(TAG, "Error calling play(" + query + ").", e); } Loading @@ -818,7 +816,7 @@ public final class MediaController { "You must specify a non-empty Uri for playFromUri."); } try { mSessionBinder.playFromUri("mContext.getOpPackageName()", mCbStub, uri, extras); mSessionBinder.playFromUri(mContext.getOpPackageName(), mCbStub, uri, extras); } catch (RemoteException e) { Log.wtf(TAG, "Error calling play(" + uri + ").", e); } Loading @@ -830,7 +828,7 @@ public final class MediaController { */ public void skipToQueueItem(long id) { try { mSessionBinder.skipToQueueItem("mContext.getOpPackageName()", mCbStub, id); mSessionBinder.skipToQueueItem(mContext.getOpPackageName(), mCbStub, id); } catch (RemoteException e) { Log.wtf(TAG, "Error calling skipToItem(" + id + ").", e); } Loading @@ -842,7 +840,7 @@ public final class MediaController { */ public void pause() { try { mSessionBinder.pause("mContext.getOpPackageName()", mCbStub); mSessionBinder.pause(mContext.getOpPackageName(), mCbStub); } catch (RemoteException e) { Log.wtf(TAG, "Error calling pause.", e); } Loading @@ -854,7 +852,7 @@ public final class MediaController { */ public void stop() { try { mSessionBinder.stop("mContext.getOpPackageName()", mCbStub); mSessionBinder.stop(mContext.getOpPackageName(), mCbStub); } catch (RemoteException e) { Log.wtf(TAG, "Error calling stop.", e); } Loading @@ -867,7 +865,7 @@ public final class MediaController { */ public void seekTo(long pos) { try { mSessionBinder.seekTo("mContext.getOpPackageName()", mCbStub, pos); mSessionBinder.seekTo(mContext.getOpPackageName(), mCbStub, pos); } catch (RemoteException e) { Log.wtf(TAG, "Error calling seekTo.", e); } Loading @@ -879,7 +877,7 @@ public final class MediaController { */ public void fastForward() { try { mSessionBinder.fastForward("mContext.getOpPackageName()", mCbStub); mSessionBinder.fastForward(mContext.getOpPackageName(), mCbStub); } catch (RemoteException e) { Log.wtf(TAG, "Error calling fastForward.", e); } Loading @@ -890,7 +888,7 @@ public final class MediaController { */ public void skipToNext() { try { mSessionBinder.next("mContext.getOpPackageName()", mCbStub); mSessionBinder.next(mContext.getOpPackageName(), mCbStub); } catch (RemoteException e) { Log.wtf(TAG, "Error calling next.", e); } Loading @@ -902,7 +900,7 @@ public final class MediaController { */ public void rewind() { try { mSessionBinder.rewind("mContext.getOpPackageName()", mCbStub); mSessionBinder.rewind(mContext.getOpPackageName(), mCbStub); } catch (RemoteException e) { Log.wtf(TAG, "Error calling rewind.", e); } Loading @@ -913,7 +911,7 @@ public final class MediaController { */ public void skipToPrevious() { try { mSessionBinder.previous("mContext.getOpPackageName()", mCbStub); mSessionBinder.previous(mContext.getOpPackageName(), mCbStub); } catch (RemoteException e) { Log.wtf(TAG, "Error calling previous.", e); } Loading @@ -928,7 +926,7 @@ public final class MediaController { */ public void setRating(Rating rating) { try { mSessionBinder.rate("mContext.getOpPackageName()", mCbStub, rating); mSessionBinder.rate(mContext.getOpPackageName(), mCbStub, rating); } catch (RemoteException e) { Log.wtf(TAG, "Error calling rate.", e); } Loading Loading @@ -963,7 +961,7 @@ public final class MediaController { throw new IllegalArgumentException("CustomAction cannot be null."); } try { mSessionBinder.sendCustomAction("mContext.getOpPackageName()", mCbStub, action, args); mSessionBinder.sendCustomAction(mContext.getOpPackageName(), mCbStub, action, args); } catch (RemoteException e) { Log.d(TAG, "Dead object in sendCustomAction.", e); } Loading