blob: 7258d8d6ca12d7f92c8fc17abeb9cec8ff3fe42e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
/*
* Copyright (c) 2012-2015 Arne Schwabe
* Distributed under the GNU GPL v2 with additional terms. For full terms see the file doc/LICENSE.txt
*/
package de.blinkt.openvpn.activities;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.UiModeManager;
import android.content.Context;
import android.content.RestrictionsManager;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import android.os.UserManager;
import android.view.Window;
import de.blinkt.openvpn.api.AppRestrictions;
public class BaseActivity extends Activity {
private boolean isAndroidTV() {
final UiModeManager uiModeManager = (UiModeManager) getSystemService(Activity.UI_MODE_SERVICE);
return uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
if (isAndroidTV()) {
requestWindowFeature(Window.FEATURE_OPTIONS_PANEL);
}
super.onCreate(savedInstanceState);
}
@Override
protected void onResume() {
super.onResume();
}
@Override
protected void onPause() {
super.onPause();
}
}
|