Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e4fe0ae authored by Nick Chalko's avatar Nick Chalko
Browse files

Code cleanup

Semi automatted cleanup.

Test: atest CtsTvTestCases
Change-Id: Ia04561623d8bab8a3da16cbf38108b5a8c5655b7
parent 8b93b3d6
Loading
Loading
Loading
Loading
+8 −13
Original line number Diff line number Diff line
@@ -1224,7 +1224,7 @@ public final class TvInputManagerService extends SystemService {
            try {
                synchronized (mLock) {
                    if (userId != mCurrentUserId && !isRecordingSession) {
                        // A non-recording session of a backgroud (non-current) user
                        // A non-recording session of a background (non-current) user
                        // should not be created.
                        // Let the client get onConnectionFailed callback for this case.
                        sendSessionTokenToClientLocked(client, inputId, null, null, seq);
@@ -2028,10 +2028,8 @@ public final class TvInputManagerService extends SystemService {
                        SessionState[] sessionStates = userState.sessionStateMap.values().toArray(
                                new SessionState[2]);
                        // Check if there is a wrapper input.
                        if (sessionStates[0].hardwareSessionToken != null
                                || sessionStates[1].hardwareSessionToken != null) {
                            return true;
                        }
                        return sessionStates[0].hardwareSessionToken != null
                                || sessionStates[1].hardwareSessionToken != null;
                    }
                    return false;
                }
@@ -2111,7 +2109,7 @@ public final class TvInputManagerService extends SystemService {
         * Add a hardware device in the TvInputHardwareManager for CTS testing
         * purpose.
         *
         * @param device id of the adding hardware device.
         * @param deviceId  the id of the adding hardware device.
         */
        @Override
        public void addHardwareDevice(int deviceId) {
@@ -2123,14 +2121,13 @@ public final class TvInputManagerService extends SystemService {
                        .hdmiPortId(0)
                        .build();
            mTvInputHardwareManager.onDeviceAvailable(info, null);
            return;
        }

        /**
         * Remove a hardware device in the TvInputHardwareManager for CTS testing
         * purpose.
         *
         * @param device id of the removing hardware device.
         * @param deviceId the id of the removing hardware device.
         */
        @Override
        public void removeHardwareDevice(int deviceId) {
@@ -2254,7 +2251,6 @@ public final class TvInputManagerService extends SystemService {
                        pw.println("userId: " + session.userId);
                        pw.println("sessionToken: " + session.sessionToken);
                        pw.println("session: " + session.session);
                        pw.println("logUri: " + session.logUri);
                        pw.println("hardwareSessionToken: " + session.hardwareSessionToken);
                        pw.decreaseIndent();
                    }
@@ -2264,7 +2260,7 @@ public final class TvInputManagerService extends SystemService {
                    pw.increaseIndent();
                    int n = userState.mCallbacks.beginBroadcast();
                    for (int j = 0; j < n; ++j) {
                        pw.println(userState.mCallbacks.getRegisteredCallbackItem(j).toString());
                        pw.println(userState.mCallbacks.getRegisteredCallbackItem(j));
                    }
                    userState.mCallbacks.finishBroadcast();
                    pw.decreaseIndent();
@@ -2363,7 +2359,7 @@ public final class TvInputManagerService extends SystemService {

        // A list of callbacks.
        private final RemoteCallbackList<ITvInputManagerCallback> mCallbacks =
                new RemoteCallbackList<ITvInputManagerCallback>();
                new RemoteCallbackList<>();

        private final Map<ITvInputManagerCallback, Pair<Integer, Integer>> callbackPidUidMap =
                new HashMap<>();
@@ -2462,7 +2458,6 @@ public final class TvInputManagerService extends SystemService {
        private final int userId;
        private final IBinder sessionToken;
        private ITvInputSession session;
        private Uri logUri;
        // Not null if this session represents an external device connected to a hardware TV input.
        private IBinder hardwareSessionToken;

@@ -3012,7 +3007,7 @@ public final class TvInputManagerService extends SystemService {
                    IBinder sessionToken = (IBinder) args.arg5;

                    ContentValues values = new ContentValues();
                    values.put(TvContract.WatchedPrograms.COLUMN_PACKAGE_NAME, packageName);
                    values.put(TvContract.BaseTvColumns.COLUMN_PACKAGE_NAME, packageName);
                    values.put(TvContract.WatchedPrograms.COLUMN_WATCH_START_TIME_UTC_MILLIS,
                            watchStartTime);
                    values.put(TvContract.WatchedPrograms.COLUMN_CHANNEL_ID, channelId);