List of usage examples for android.os UserManager isUserAGoat
public boolean isUserAGoat()
From source file:ch.uzh.supersede.feedbacklibrary.FeedbackActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_feedback); UserManager userManager = (UserManager) getApplicationContext().getSystemService(Context.USER_SERVICE); if (userManager.isUserAGoat()) { Log.v(TAG, "The user IS a goat and subject to teleportations"); } else {//from w w w .j a v a2 s . co m Log.v(TAG, "The user IS NOT a goat and subject to teleportations"); } Intent intent = getIntent(); // Get the default image path for the screenshot if present defaultImagePath = intent.getStringExtra(DEFAULT_IMAGE_PATH); // Get the configuration type isPush = intent.getBooleanExtra(IS_PUSH_STRING, true); // Get values related to a pull configuration selectedPullConfigurationIndex = intent.getLongExtra(SELECTED_PULL_CONFIGURATION_INDEX_STRING, -1); String jsonString = intent.getStringExtra(JSON_CONFIGURATION_STRING); // Initialization based on the type of configuration, i.e., if it is push or pull language = intent.getStringExtra(EXTRA_KEY_LANGUAGE); baseURL = intent.getStringExtra(EXTRA_KEY_BASE_URL); if (!isPush && selectedPullConfigurationIndex != -1 && jsonString != null) { // The feedback activity is started on behalf of a triggered pull configuration Log.v(TAG, "The feedback activity is started via a PULL configuration"); // Save the current configuration under FeedbackActivity.CONFIGURATION_DIR}/FeedbackActivity.JSON_CONFIGURATION_FILE_NAME Utils.saveStringContentToInternalStorage(getApplicationContext(), CONFIGURATION_DIR, JSON_CONFIGURATION_FILE_NAME, jsonString, MODE_PRIVATE); orchestratorConfigurationItem = new Gson().fromJson(jsonString, OrchestratorConfigurationItem.class); initModel(); initView(); } else { // The feedback activity is started on behalf of the user Log.v(TAG, "The feedback activity is started via a PUSH configuration"); // TODO: remove before release //initOfflineConfiguration(); // TODO: uncomment before release // Get the application id and language init(intent.getLongExtra(EXTRA_KEY_APPLICATION_ID, -1L), baseURL, language); } }