use of com.android.settings.SettingsActivity in project android_packages_apps_Settings by DirtyUnicorns.
the class BluetoothDeviceDetailsRotationTest method rotation.
@Test
public void rotation() {
Intent intent = new Intent("android.settings.BLUETOOTH_SETTINGS");
SettingsActivity activity = (SettingsActivity) mInstrumentation.startActivitySync(intent);
Bundle args = new Bundle(1);
args.putString(BluetoothDeviceDetailsFragment.KEY_DEVICE_ADDRESS, mDeviceAddress);
activity.startPreferencePanel(null, BluetoothDeviceDetailsFragment.class.getName(), args, 0, null, null, 0);
try {
mUiDevice.setOrientationLeft();
mUiDevice.setOrientationNatural();
mUiDevice.setOrientationRight();
mUiDevice.setOrientationNatural();
} catch (RemoteException e) {
throw new RuntimeException(e);
}
}
use of com.android.settings.SettingsActivity in project android_packages_apps_Settings by DirtyUnicorns.
the class ToggleFeaturePreferenceFragment method onViewCreated.
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
SettingsActivity activity = (SettingsActivity) getActivity();
mSwitchBar = activity.getSwitchBar();
mToggleSwitch = mSwitchBar.getSwitch();
onProcessArguments(getArguments());
// Show the "Settings" menu as if it were a preference screen
if (mSettingsTitle != null && mSettingsIntent != null) {
PreferenceScreen preferenceScreen = getPreferenceScreen();
Preference settingsPref = new Preference(preferenceScreen.getContext());
settingsPref.setTitle(mSettingsTitle);
settingsPref.setIconSpaceReserved(true);
settingsPref.setIntent(mSettingsIntent);
preferenceScreen.addPreference(settingsPref);
}
}
use of com.android.settings.SettingsActivity in project android_packages_apps_Settings by DirtyUnicorns.
the class AccountPreferenceController method onPreferenceClick.
@Override
public boolean onPreferenceClick(Preference preference) {
// Check the preference
final int count = mProfiles.size();
for (int i = 0; i < count; i++) {
ProfileData profileData = mProfiles.valueAt(i);
if (preference == profileData.addAccountPreference) {
Intent intent = new Intent(ACTION_ADD_ACCOUNT);
intent.putExtra(EXTRA_USER, profileData.userInfo.getUserHandle());
intent.putExtra(EXTRA_AUTHORITIES, mAuthorities);
mContext.startActivity(intent);
return true;
}
if (preference == profileData.removeWorkProfilePreference) {
final int userId = profileData.userInfo.id;
RemoveUserFragment.newInstance(userId).show(mParent.getFragmentManager(), "removeUser");
return true;
}
if (preference == profileData.managedProfilePreference) {
Bundle arguments = new Bundle();
arguments.putParcelable(Intent.EXTRA_USER, profileData.userInfo.getUserHandle());
((SettingsActivity) mParent.getActivity()).startPreferencePanel(mParent, ManagedProfileSettings.class.getName(), arguments, R.string.managed_profile_settings_title, null, null, 0);
return true;
}
}
return false;
}
use of com.android.settings.SettingsActivity in project android_packages_apps_Settings by DirtyUnicorns.
the class CaptionPropertiesFragment method onActivityCreated.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
final boolean enabled = mCaptioningManager.isEnabled();
SettingsActivity activity = (SettingsActivity) getActivity();
mSwitchBar = activity.getSwitchBar();
mSwitchBar.setCheckedInternal(enabled);
mToggleSwitch = mSwitchBar.getSwitch();
getPreferenceScreen().setEnabled(enabled);
refreshPreviewText();
installSwitchBarToggleSwitch();
}
use of com.android.settings.SettingsActivity in project android_packages_apps_Settings by DirtyUnicorns.
the class AppOpsDetails method setIntentAndFinish.
private void setIntentAndFinish(boolean finish, boolean appChanged) {
Intent intent = new Intent();
intent.putExtra(ManageApplications.APP_CHG, appChanged);
SettingsActivity sa = (SettingsActivity) getActivity();
sa.finishPreferencePanel(this, Activity.RESULT_OK, intent);
}
Aggregations