Differential D11694 Diff 32896 src/org/kde/kdeconnect/Plugins/FindMyPhonePlugin/FindMyPhoneActivity.java
Changeset View
Changeset View
Standalone View
Standalone View
src/org/kde/kdeconnect/Plugins/FindMyPhonePlugin/FindMyPhoneActivity.java
Show All 28 Lines | |||||
29 | import android.os.Bundle; | 29 | import android.os.Bundle; | ||
30 | import android.preference.PreferenceManager; | 30 | import android.preference.PreferenceManager; | ||
31 | import android.provider.Settings; | 31 | import android.provider.Settings; | ||
32 | import android.util.Log; | 32 | import android.util.Log; | ||
33 | import android.view.View; | 33 | import android.view.View; | ||
34 | import android.view.Window; | 34 | import android.view.Window; | ||
35 | import android.view.WindowManager; | 35 | import android.view.WindowManager; | ||
36 | 36 | | |||
37 | import org.kde.kdeconnect.UserInterface.ThemeUtil; | ||||
37 | import org.kde.kdeconnect_tp.R; | 38 | import org.kde.kdeconnect_tp.R; | ||
38 | 39 | | |||
39 | public class FindMyPhoneActivity extends Activity { | 40 | public class FindMyPhoneActivity extends Activity { | ||
40 | 41 | | |||
41 | private MediaPlayer mediaPlayer; | 42 | private MediaPlayer mediaPlayer; | ||
42 | private int previousVolume; | 43 | private int previousVolume; | ||
43 | private AudioManager audioManager; | 44 | private AudioManager audioManager; | ||
44 | 45 | | |||
45 | @Override | 46 | @Override | ||
46 | protected void onNewIntent(Intent intent) { | 47 | protected void onNewIntent(Intent intent) { | ||
47 | super.onNewIntent(intent); | 48 | super.onNewIntent(intent); | ||
48 | 49 | | |||
49 | if (mediaPlayer != null) { | 50 | if (mediaPlayer != null) { | ||
50 | // If this activity was already open and we received the ring packet again, just finish it | 51 | // If this activity was already open and we received the ring packet again, just finish it | ||
51 | finish(); | 52 | finish(); | ||
52 | } | 53 | } | ||
53 | // otherwise the activity will become active again | 54 | // otherwise the activity will become active again | ||
54 | } | 55 | } | ||
55 | 56 | | |||
56 | @Override | 57 | @Override | ||
57 | protected void onCreate(Bundle savedInstanceState) { | 58 | protected void onCreate(Bundle savedInstanceState) { | ||
58 | super.onCreate(savedInstanceState); | 59 | super.onCreate(savedInstanceState); | ||
60 | ThemeUtil.setUserPreferredTheme(this); | ||||
59 | setContentView(R.layout.activity_find_my_phone); | 61 | setContentView(R.layout.activity_find_my_phone); | ||
60 | 62 | | |||
61 | audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); | 63 | audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); | ||
62 | 64 | | |||
63 | Window window = this.getWindow(); | 65 | Window window = this.getWindow(); | ||
64 | window.addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | | 66 | window.addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | | ||
65 | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | | 67 | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | | ||
66 | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON); | 68 | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON); | ||
▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines |