Merge branch 'dev' into dev-overlay-app
Conflicts: calculatorpp/AndroidManifest.xml calculatorpp/src/main/java/org/solovyev/android/calculator/CalculatorApplication.java
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
package org.solovyev.android.calculator;
|
||||
|
||||
import android.*;
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.app.KeyguardManager;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Vibrator;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
@@ -60,6 +65,14 @@ public abstract class AbstractCalculatorHelper implements SharedPreferences.OnSh
|
||||
theme = CalculatorPreferences.Gui.theme.getPreferenceNoError(preferences);
|
||||
|
||||
preferences.registerOnSharedPreferenceChangeListener(this);
|
||||
|
||||
// let's disable locking of screen for monkeyrunner
|
||||
// NOTE: this code is only for monkeyrunner
|
||||
final String permission = Manifest.permission.DISABLE_KEYGUARD;
|
||||
if (activity.checkCallingOrSelfPermission(permission) == PackageManager.PERMISSION_GRANTED) {
|
||||
final KeyguardManager km = (KeyguardManager) activity.getSystemService(Context.KEYGUARD_SERVICE);
|
||||
km.newKeyguardLock(activity.getClass().getName()).disableKeyguard();
|
||||
}
|
||||
}
|
||||
|
||||
public void logDebug(@NotNull String message) {
|
||||
|
@@ -13,6 +13,7 @@ import org.solovyev.android.ads.AdsController;
|
||||
import org.solovyev.android.calculator.external.AndroidExternalListenersContainer;
|
||||
import org.solovyev.android.calculator.history.AndroidCalculatorHistory;
|
||||
import org.solovyev.android.calculator.model.AndroidCalculatorEngine;
|
||||
import org.solovyev.android.calculator.widget.CalculatorWidgetHelper;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
|
Reference in New Issue
Block a user