<commit_before>/*
 * Copyright (c) 2014 Google Inc.
 *
 * 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 com.google.android.apps.watchme;

import android.Manifest;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.hardware.Camera;
import android.hardware.Camera.CameraInfo;
import android.os.Binder;
import android.os.IBinder;
import android.support.design.widget.Snackbar;
import android.support.v4.app.ActivityCompat;
import android.util.Log;
import android.view.View;

import com.google.android.apps.watchme.util.Utils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author <NAME> <<EMAIL>>
 *         <p/>
 *         StreamerService class which streams the video from camera.
 */
public class StreamerService extends Service {
    private static int STREAMER_NOTIFICATION_ID = 1001;
    private final IBinder binder = new LocalBinder();
    // Member variables.
    private VideoStreamingConnection connection;
    private Camera camera;

    @Override
    public void onCreate() {
        Log.d(MainActivity.APP_NAME, "onCreate");
    }

    @Override
    public void onDestroy() {
        Log.d(MainActivity.APP_NAME, "onDestroy");
    }

    @Override
    public IBinder onBind(Intent intent) {
        camera = Utils.getCamera(CameraInfo.CAMERA_FACING_FRONT);
        Log.d(MainActivity.APP_NAME, "onBind");
        return binder;
    }

    @Override
    public boolean onUnbind(Intent intent) {
        Log.d(MainActivity.APP_NAME, "onUnbind");

        return false;
    }

    public void startStreaming(String streamUrl) {
        Log.d(MainActivity.APP_NAME, "startStreaming");
            showForegroundNotification();
            connection = new VideoStreamingConnection();
            // TODO Pass an actual preview surface.
            connection.open(streamUrl, camera, null);
    }

    public void stopStreaming() {<commit_msg>Revert unintentional indent.<commit_after>/*
 * Copyright (c) 2014 Google Inc.
 *
 * 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 com.google.android.apps.watchme;

import android.Manifest;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.hardware.Camera;
import android.hardware.Camera.CameraInfo;
import android.os.Binder;
import android.os.IBinder;
import android.support.design.widget.Snackbar;
import android.support.v4.app.ActivityCompat;
import android.util.Log;
import android.view.View;

import com.google.android.apps.watchme.util.Utils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author <NAME> <<EMAIL>>
 *         <p/>
 *         StreamerService class which streams the video from camera.
 */
public class StreamerService extends Service {
    private static int STREAMER_NOTIFICATION_ID = 1001;
    private final IBinder binder = new LocalBinder();
    // Member variables.
    private VideoStreamingConnection connection;
    private Camera camera;

    @Override
    public void onCreate() {
        Log.d(MainActivity.APP_NAME, "onCreate");
    }

    @Override
    public void onDestroy() {
        Log.d(MainActivity.APP_NAME, "onDestroy");
    }

    @Override
    public IBinder onBind(Intent intent) {
        camera = Utils.getCamera(CameraInfo.CAMERA_FACING_FRONT);
        Log.d(MainActivity.APP_NAME, "onBind");
        return binder;
    }

    @Override
    public boolean onUnbind(Intent intent) {
        Log.d(MainActivity.APP_NAME, "onUnbind");

        return false;
    }

    public void startStreaming(String streamUrl) {
        Log.d(MainActivity.APP_NAME, "startStreaming");
        showForegroundNotification();
        connection = new VideoStreamingConnection();
        // TODO Pass an actual preview surface.
        connection.open(streamUrl, camera, null);
    }

    public void stopStreaming() {
{'fraction_non_alphanumeric': 0.09260337798485731, 'fraction_numerical': 0.005047563579887401, 'mean_word_length': 3.54320987654321, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6890396', 'n_tokens_mistral': 1441, 'n_tokens_neox': 1403, 'n_words': 430}