Snap for 8508902 from 0c128aca74 to udc-release
Change-Id: I8ba0203c1950e295cf41052257e24768b89fc2f5
This commit is contained in:
@@ -44,7 +44,6 @@ import android.os.SystemProperties;
|
||||
import android.os.UserHandle;
|
||||
import android.os.UserManager;
|
||||
import android.provider.Settings;
|
||||
import android.sysprop.VoldProperties;
|
||||
import android.telephony.euicc.EuiccManager;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
@@ -309,12 +308,9 @@ public class MainClear extends InstrumentedFragment implements OnGlobalLayoutLis
|
||||
* If the external storage is emulated, it will be erased with a factory
|
||||
* reset at any rate. There is no need to have a separate option until
|
||||
* we have a factory reset that only erases some directories and not
|
||||
* others. Likewise, if it's non-removable storage, it could potentially have been
|
||||
* encrypted, and will also need to be wiped.
|
||||
* others.
|
||||
*/
|
||||
boolean isExtStorageEmulated = Environment.isExternalStorageEmulated();
|
||||
if (isExtStorageEmulated
|
||||
|| (!Environment.isExternalStorageRemovable() && isExtStorageEncrypted())) {
|
||||
if (Environment.isExternalStorageEmulated()) {
|
||||
mExternalStorageContainer.setVisibility(View.GONE);
|
||||
|
||||
final View externalOption = mContentView.findViewById(R.id.erase_external_option_text);
|
||||
@@ -323,9 +319,7 @@ public class MainClear extends InstrumentedFragment implements OnGlobalLayoutLis
|
||||
final View externalAlsoErased = mContentView.findViewById(R.id.also_erases_external);
|
||||
externalAlsoErased.setVisibility(View.VISIBLE);
|
||||
|
||||
// If it's not emulated, it is on a separate partition but it means we're doing
|
||||
// a force wipe due to encryption.
|
||||
mExternalStorage.setChecked(!isExtStorageEmulated);
|
||||
mExternalStorage.setChecked(false);
|
||||
} else {
|
||||
mExternalStorageContainer.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@@ -457,11 +451,6 @@ public class MainClear extends InstrumentedFragment implements OnGlobalLayoutLis
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isExtStorageEncrypted() {
|
||||
String state = VoldProperties.decrypt().orElse("");
|
||||
return !"".equals(state);
|
||||
}
|
||||
|
||||
private void loadAccountList(final UserManager um) {
|
||||
View accountsLabel = mContentView.findViewById(R.id.accounts_label);
|
||||
LinearLayout contents = (LinearLayout) mContentView.findViewById(R.id.accounts);
|
||||
|
||||
@@ -479,7 +479,7 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
|
||||
@Override
|
||||
protected void refresh() {
|
||||
for (LocalBluetoothProfile profile : getProfiles()) {
|
||||
if (profile != null && !profile.isProfileReady()) {
|
||||
if (profile == null || !profile.isProfileReady()) {
|
||||
continue;
|
||||
}
|
||||
SwitchPreference pref = mProfilesContainer.findPreference(
|
||||
|
||||
@@ -17,17 +17,29 @@
|
||||
package com.android.settings.gestures;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
import com.android.settingslib.core.lifecycle.LifecycleObserver;
|
||||
import com.android.settingslib.core.lifecycle.events.OnStart;
|
||||
import com.android.settingslib.core.lifecycle.events.OnStop;
|
||||
|
||||
/**
|
||||
* Preference controller for One-handed mode shortcut settings
|
||||
*/
|
||||
public class OneHandedEnablePreferenceController extends BasePreferenceController {
|
||||
public class OneHandedEnablePreferenceController extends BasePreferenceController
|
||||
implements OneHandedSettingsUtils.TogglesCallback, LifecycleObserver, OnStart, OnStop {
|
||||
|
||||
private final OneHandedSettingsUtils mUtils;
|
||||
private Preference mPreference;
|
||||
|
||||
public OneHandedEnablePreferenceController(Context context, String preferenceKey) {
|
||||
super(context, preferenceKey);
|
||||
mUtils = new OneHandedSettingsUtils(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -41,4 +53,30 @@ public class OneHandedEnablePreferenceController extends BasePreferenceControlle
|
||||
OneHandedSettingsUtils.isOneHandedModeEnabled(mContext)
|
||||
? R.string.gesture_setting_on : R.string.gesture_setting_off);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayPreference(PreferenceScreen screen) {
|
||||
super.displayPreference(screen);
|
||||
mPreference = screen.findPreference(getPreferenceKey());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
mUtils.registerToggleAwareObserver(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
mUtils.unregisterToggleAwareObserver();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChange(Uri uri) {
|
||||
if (mPreference == null) {
|
||||
return;
|
||||
}
|
||||
if (uri.equals(OneHandedSettingsUtils.ONE_HANDED_MODE_ENABLED_URI)) {
|
||||
refreshSummary(mPreference);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user