<commit_before>package net.solutinno.util;

import android.content.Context;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.WindowManager;

public class DisplayHelper
{
    public static DisplayMetrics getDisplayMetrics(Context context) {
        WindowManager mgr = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
        Display defaultDisplay = mgr.getDefaultDisplay();
        DisplayMetrics result = new DisplayMetrics();
        defaultDisplay.getMetrics(result);
        return result;
    }
}<commit_msg>Add getScreenRotation function to DisplayHelper<commit_after>package net.solutinno.util;

import android.content.Context;
import android.content.pm.ActivityInfo;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.Surface;
import android.view.WindowManager;

public class DisplayHelper
{
    public static DisplayMetrics getDisplayMetrics(Context context) {
        final Display display = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
        DisplayMetrics result = new DisplayMetrics();
        display.getMetrics(result);
        return result;
    }

    public static int getScreenRotation(Context context) {

        final Display display = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();

        switch (display.getRotation()) {
            case Surface.ROTATION_0:
                return ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
            case Surface.ROTATION_90:
                return ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
            case Surface.ROTATION_180:
                return ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT;
            case Surface.ROTATION_270:
                return ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE;
            default:
                return ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
        }
    }
}
{'fraction_non_alphanumeric': 0.07256004087889627, 'fraction_numerical': 0.004598875830352581, 'mean_word_length': 3.54292343387471, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '7244069', 'n_tokens_mistral': 519, 'n_tokens_neox': 504, 'n_words': 101}