am 31566703
: am 600cfe2f
: am a61c803e
: am 7f3026c3
: am bb9d6b90
: Merge "Refresh after clearing, tweak warn threshold." into mnc-dev
* commit '3156670323c2c909a05215c464181db44abbe991': Refresh after clearing, tweak warn threshold.
This commit is contained in:
@@ -192,8 +192,8 @@ public class PrivateVolumeSettings extends SettingsPreferenceFragment {
|
|||||||
for (int userIndex = 0; userIndex < userCount; ++userIndex) {
|
for (int userIndex = 0; userIndex < userCount; ++userIndex) {
|
||||||
final UserInfo userInfo = allUsers.get(userIndex);
|
final UserInfo userInfo = allUsers.get(userIndex);
|
||||||
if (isProfileOf(mCurrentUser, userInfo)) {
|
if (isProfileOf(mCurrentUser, userInfo)) {
|
||||||
PreferenceCategory details = addCategory(screen,
|
final PreferenceGroup details = showHeaders ?
|
||||||
showHeaders ? userInfo.name : null);
|
addCategory(screen, userInfo.name) : screen;
|
||||||
addDetailItems(details, showShared, userInfo.id);
|
addDetailItems(details, showShared, userInfo.id);
|
||||||
++addedUserCount;
|
++addedUserCount;
|
||||||
}
|
}
|
||||||
@@ -201,7 +201,7 @@ public class PrivateVolumeSettings extends SettingsPreferenceFragment {
|
|||||||
|
|
||||||
// Add rest of users
|
// Add rest of users
|
||||||
if (userCount - addedUserCount > 0) {
|
if (userCount - addedUserCount > 0) {
|
||||||
PreferenceCategory otherUsers = addCategory(screen,
|
PreferenceGroup otherUsers = addCategory(screen,
|
||||||
getText(R.string.storage_other_users));
|
getText(R.string.storage_other_users));
|
||||||
for (int userIndex = 0; userIndex < userCount; ++userIndex) {
|
for (int userIndex = 0; userIndex < userCount; ++userIndex) {
|
||||||
final UserInfo userInfo = allUsers.get(userIndex);
|
final UserInfo userInfo = allUsers.get(userIndex);
|
||||||
@@ -253,7 +253,7 @@ public class PrivateVolumeSettings extends SettingsPreferenceFragment {
|
|||||||
return category;
|
return category;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addDetailItems(PreferenceCategory category, boolean showShared, int userId) {
|
private void addDetailItems(PreferenceGroup category, boolean showShared, int userId) {
|
||||||
final int[] itemsToAdd = (showShared ? ITEMS_SHOW_SHARED : ITEMS_NO_SHOW_SHARED);
|
final int[] itemsToAdd = (showShared ? ITEMS_SHOW_SHARED : ITEMS_NO_SHOW_SHARED);
|
||||||
for (int i = 0; i < itemsToAdd.length; ++i) {
|
for (int i = 0; i < itemsToAdd.length; ++i) {
|
||||||
addItem(category, itemsToAdd[i], null, userId);
|
addItem(category, itemsToAdd[i], null, userId);
|
||||||
@@ -719,8 +719,13 @@ public class PrivateVolumeSettings extends SettingsPreferenceFragment {
|
|||||||
public void onRemoveCompleted(final String packageName, final boolean succeeded) {
|
public void onRemoveCompleted(final String packageName, final boolean succeeded) {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
if (--mRemaining == 0) {
|
if (--mRemaining == 0) {
|
||||||
|
mTarget.getActivity().runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
mTarget.update();
|
mTarget.update();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -190,6 +190,10 @@ public abstract class StorageWizardBase extends Activity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void setKeepScreenOn(boolean keepScreenOn) {
|
||||||
|
getSetupWizardLayout().setKeepScreenOn(keepScreenOn);
|
||||||
|
}
|
||||||
|
|
||||||
public void onNavigateNext() {
|
public void onNavigateNext() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,6 @@ import android.content.Intent;
|
|||||||
import android.content.pm.IPackageMoveObserver;
|
import android.content.pm.IPackageMoveObserver;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.RemoteException;
|
|
||||||
import android.os.storage.DiskInfo;
|
import android.os.storage.DiskInfo;
|
||||||
import android.os.storage.StorageManager;
|
import android.os.storage.StorageManager;
|
||||||
import android.os.storage.VolumeInfo;
|
import android.os.storage.VolumeInfo;
|
||||||
@@ -55,6 +54,7 @@ public class StorageWizardFormatProgress extends StorageWizardBase {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setContentView(R.layout.storage_wizard_progress);
|
setContentView(R.layout.storage_wizard_progress);
|
||||||
|
setKeepScreenOn(true);
|
||||||
|
|
||||||
mFormatPrivate = getIntent().getBooleanExtra(
|
mFormatPrivate = getIntent().getBooleanExtra(
|
||||||
StorageWizardFormatConfirm.EXTRA_FORMAT_PRIVATE, false);
|
StorageWizardFormatConfirm.EXTRA_FORMAT_PRIVATE, false);
|
||||||
@@ -145,16 +145,22 @@ public class StorageWizardFormatProgress extends StorageWizardBase {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (activity.mFormatPrivate) {
|
||||||
final float pct = (float) mInternalBench / (float) mPrivateBench;
|
final float pct = (float) mInternalBench / (float) mPrivateBench;
|
||||||
Log.d(TAG, "New volume is " + pct + "x the speed of internal");
|
Log.d(TAG, "New volume is " + pct + "x the speed of internal");
|
||||||
|
|
||||||
// TODO: refine this warning threshold
|
// To help set user expectations around device performance, we
|
||||||
if (mPrivateBench > 2000000000) {
|
// warn if the adopted media is 0.25x the speed of internal
|
||||||
|
// storage or slower.
|
||||||
|
if (Float.isNaN(pct) || pct < 0.25) {
|
||||||
final SlowWarningFragment dialog = new SlowWarningFragment();
|
final SlowWarningFragment dialog = new SlowWarningFragment();
|
||||||
dialog.show(activity.getFragmentManager(), TAG_SLOW_WARNING);
|
dialog.show(activity.getFragmentManager(), TAG_SLOW_WARNING);
|
||||||
} else {
|
} else {
|
||||||
activity.onFormatFinished();
|
activity.onFormatFinished();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
activity.onFormatFinished();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user