Screenshots

This commit is contained in:
Sergey Solovyev
2012-11-23 01:19:14 +04:00
parent 77167e366c
commit 36772dea1f
9 changed files with 155 additions and 6 deletions

View File

@@ -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) {

View File

@@ -1,6 +1,5 @@
package org.solovyev.android.calculator;
import android.content.Intent;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import net.robotmedia.billing.BillingController;
@@ -13,7 +12,6 @@ import org.jetbrains.annotations.NotNull;
import org.solovyev.android.ads.AdsController;
import org.solovyev.android.calculator.history.AndroidCalculatorHistory;
import org.solovyev.android.calculator.model.AndroidCalculatorEngine;
import org.solovyev.android.calculator.overlay.CalculatorOverlayService;
import org.solovyev.android.calculator.widget.CalculatorWidgetHelper;
/**
@@ -125,8 +123,6 @@ public class CalculatorApplication extends android.app.Application {
public void run() {
BillingController.checkBillingSupported(CalculatorApplication.this);
AdsController.getInstance().isAdFree(CalculatorApplication.this);
startService(new Intent(getApplicationContext(), CalculatorOverlayService.class));
}
}).start();