<exception name="SecurityException" type="java.lang.SecurityException">
</exception>
</method>
+<method name="isRunningInTestHarness"
+ return="boolean"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
<method name="isUserAMonkey"
return="boolean"
abstract="false"
import com.android.internal.telephony.TelephonyIntents;
import android.Manifest;
+import android.app.ActivityManager;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
private static AtomicReference<AccountManagerService> sThis =
new AtomicReference<AccountManagerService>();
- private static final boolean isDebuggableMonkeyBuild =
- SystemProperties.getBoolean("ro.monkey", false);
private static final Account[] EMPTY_ACCOUNT_ARRAY = new Account[]{};
static {
account.name, account.type};
final boolean permissionGranted =
DatabaseUtils.longForQuery(db, COUNT_OF_MATCHING_GRANTS, args) != 0;
- if (!permissionGranted && isDebuggableMonkeyBuild) {
+ if (!permissionGranted && ActivityManager.isRunningInTestHarness()) {
// TODO: Skip this check when running automated tests. Replace this
// with a more general solution.
Log.d(TAG, "no credentials permission for usage of " + account + ", "
+ authTokenType + " by uid " + Binder.getCallingUid()
- + " but ignoring since this is a monkey build");
+ + " but ignoring since device is in test harness.");
return true;
}
return permissionGranted;
import com.android.internal.widget.WaveView;
import com.android.internal.widget.WaveView.OnTriggerListener;
+import android.app.ActivityManager;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
private boolean shouldEnableMenuKey() {
final Resources res = getResources();
final boolean configDisabled = res.getBoolean(R.bool.config_disableMenuKeyInLockScreen);
- final boolean isMonkey = SystemProperties.getBoolean("ro.monkey", false);
+ final boolean isTestHarness = ActivityManager.isRunningInTestHarness();
final boolean fileOverride = (new File(ENABLE_MENU_KEY_FILE)).exists();
- return !configDisabled || isMonkey || fileOverride;
+ return !configDisabled || isTestHarness || fileOverride;
}
/**