Loading media/java/android/media/metrics/IPlaybackMetricsManager.aidl 0 → 100644 +27 −0 Original line number Diff line number Diff line /* * Copyright (C) 2020 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 android.media.metrics; import android.media.metrics.PlaybackMetrics; /** * Interface to the playback manager service. * @hide */ interface IPlaybackMetricsManager { void reportPlaybackMetrics(in PlaybackMetrics metrics, int userId); } No newline at end of file media/java/android/media/metrics/OWNERS 0 → 100644 +3 −0 Original line number Diff line number Diff line essick@google.com nchalko@google.com shubang@google.com No newline at end of file media/java/android/media/metrics/PlaybackMetrics.aidl 0 → 100644 +19 −0 Original line number Diff line number Diff line /* * Copyright (C) 2020 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 android.media.metrics; parcelable PlaybackMetrics; media/java/android/media/metrics/PlaybackMetrics.java 0 → 100644 +88 −0 Original line number Diff line number Diff line /* * Copyright (C) 2020 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 android.media.metrics; import android.annotation.NonNull; import android.annotation.Nullable; import android.os.Parcel; import android.os.Parcelable; import java.util.Objects; /** * This class is used to store playback data. * @hide */ public final class PlaybackMetrics implements Parcelable { private int mStreamSourceType; /** * Creates a new PlaybackMetrics. * * @hide */ public PlaybackMetrics(int streamSourceType) { this.mStreamSourceType = streamSourceType; } public int getStreamSourceType() { return mStreamSourceType; } @Override public boolean equals(@Nullable Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PlaybackMetrics that = (PlaybackMetrics) o; return mStreamSourceType == that.mStreamSourceType; } @Override public int hashCode() { return Objects.hash(mStreamSourceType); } @Override public void writeToParcel(@NonNull Parcel dest, int flags) { dest.writeInt(mStreamSourceType); } @Override public int describeContents() { return 0; } /** @hide */ /* package-private */ PlaybackMetrics(@NonNull Parcel in) { int streamSourceType = in.readInt(); this.mStreamSourceType = streamSourceType; } public static final @NonNull Parcelable.Creator<PlaybackMetrics> CREATOR = new Parcelable.Creator<PlaybackMetrics>() { @Override public PlaybackMetrics[] newArray(int size) { return new PlaybackMetrics[size]; } @Override public PlaybackMetrics createFromParcel(@NonNull Parcel in) { return new PlaybackMetrics(in); } }; } media/java/android/media/metrics/PlaybackMetricsManager.java 0 → 100644 +49 −0 Original line number Diff line number Diff line /* * Copyright (C) 2020 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 android.media.metrics; import android.os.RemoteException; /** * @hide */ public class PlaybackMetricsManager { // TODO: unhide APIs. private static final String TAG = "PlaybackMetricsManager"; private IPlaybackMetricsManager mService; private int mUserId; /** * @hide */ public PlaybackMetricsManager(IPlaybackMetricsManager service, int userId) { mService = service; mUserId = userId; } /** * Reports playback metrics. */ public void reportPlaybackMetrics(PlaybackMetrics metrics) { try { mService.reportPlaybackMetrics(metrics, mUserId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } } Loading
media/java/android/media/metrics/IPlaybackMetricsManager.aidl 0 → 100644 +27 −0 Original line number Diff line number Diff line /* * Copyright (C) 2020 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 android.media.metrics; import android.media.metrics.PlaybackMetrics; /** * Interface to the playback manager service. * @hide */ interface IPlaybackMetricsManager { void reportPlaybackMetrics(in PlaybackMetrics metrics, int userId); } No newline at end of file
media/java/android/media/metrics/OWNERS 0 → 100644 +3 −0 Original line number Diff line number Diff line essick@google.com nchalko@google.com shubang@google.com No newline at end of file
media/java/android/media/metrics/PlaybackMetrics.aidl 0 → 100644 +19 −0 Original line number Diff line number Diff line /* * Copyright (C) 2020 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 android.media.metrics; parcelable PlaybackMetrics;
media/java/android/media/metrics/PlaybackMetrics.java 0 → 100644 +88 −0 Original line number Diff line number Diff line /* * Copyright (C) 2020 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 android.media.metrics; import android.annotation.NonNull; import android.annotation.Nullable; import android.os.Parcel; import android.os.Parcelable; import java.util.Objects; /** * This class is used to store playback data. * @hide */ public final class PlaybackMetrics implements Parcelable { private int mStreamSourceType; /** * Creates a new PlaybackMetrics. * * @hide */ public PlaybackMetrics(int streamSourceType) { this.mStreamSourceType = streamSourceType; } public int getStreamSourceType() { return mStreamSourceType; } @Override public boolean equals(@Nullable Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PlaybackMetrics that = (PlaybackMetrics) o; return mStreamSourceType == that.mStreamSourceType; } @Override public int hashCode() { return Objects.hash(mStreamSourceType); } @Override public void writeToParcel(@NonNull Parcel dest, int flags) { dest.writeInt(mStreamSourceType); } @Override public int describeContents() { return 0; } /** @hide */ /* package-private */ PlaybackMetrics(@NonNull Parcel in) { int streamSourceType = in.readInt(); this.mStreamSourceType = streamSourceType; } public static final @NonNull Parcelable.Creator<PlaybackMetrics> CREATOR = new Parcelable.Creator<PlaybackMetrics>() { @Override public PlaybackMetrics[] newArray(int size) { return new PlaybackMetrics[size]; } @Override public PlaybackMetrics createFromParcel(@NonNull Parcel in) { return new PlaybackMetrics(in); } }; }
media/java/android/media/metrics/PlaybackMetricsManager.java 0 → 100644 +49 −0 Original line number Diff line number Diff line /* * Copyright (C) 2020 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 android.media.metrics; import android.os.RemoteException; /** * @hide */ public class PlaybackMetricsManager { // TODO: unhide APIs. private static final String TAG = "PlaybackMetricsManager"; private IPlaybackMetricsManager mService; private int mUserId; /** * @hide */ public PlaybackMetricsManager(IPlaybackMetricsManager service, int userId) { mService = service; mUserId = userId; } /** * Reports playback metrics. */ public void reportPlaybackMetrics(PlaybackMetrics metrics) { try { mService.reportPlaybackMetrics(metrics, mUserId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } }