Android-x86
Fork

  • R/O
  • HTTP
  • SSH
  • HTTPS

packages-apps-Superuser: コミット

packages/apps/Superuser


コミットメタ情報

リビジョン17113ea29a0a57ddc4ab5b060751e792a99f7404 (tree)
日時2011-11-21 01:30:04
作者Adam Shanks <chainsdd@gmai...>
コミッターAdam Shanks

ログメッセージ

Show a toast if only preferences are restored

変更サマリ

差分

--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -150,6 +150,7 @@
150150 <item quantity="one">One app and preferences restored</item>
151151 <item quantity="other">%1$d apps and preferences restored</item>
152152 </plurals>
153+ <string name="restore_complete_prefs_only">Preferences restored</string>
153154 <string name="pref_category_info_title">General</string>
154155 <string name="pref_version_title">Superuser v%1$s (%2$d)</string>
155156 <string name="pref_version_summary">Database version %s</string>
--- a/src/com/noshufou/android/su/preferences/PreferencesActivity.java
+++ b/src/com/noshufou/android/su/preferences/PreferencesActivity.java
@@ -464,8 +464,11 @@ public class PreferencesActivity extends PreferenceActivity implements OnClickLi
464464 protected void onPostExecute(Integer result) {
465465 ((ProgressBar)findViewById(R.id.title_refresh_progress)).setVisibility(View.GONE);
466466 if (result > -1) {
467+ String message = result > 0 ?
468+ getResources().getQuantityString(R.plurals.restore_complete, result, result):
469+ getString(R.string.restore_complete_prefs_only);
467470 Toast.makeText(getApplicationContext(),
468- getResources().getQuantityString(R.plurals.restore_complete, result, result),
471+ message,
469472 Toast.LENGTH_SHORT).show();
470473 Intent intent = getIntent();
471474 finish();
--- a/src/com/noshufou/android/su/util/BackupUtil.java
+++ b/src/com/noshufou/android/su/util/BackupUtil.java
@@ -146,7 +146,7 @@ public class BackupUtil {
146146 public static int restoreBackup(Context context) {
147147 XmlPullParser parser = Xml.newPullParser();
148148 FileInputStream file = null;
149- int appsRestored = -1;
149+ int appsRestored = 0;
150150 try {
151151 file = new FileInputStream(
152152 new File(Environment.getExternalStorageDirectory().getAbsolutePath()
@@ -174,7 +174,7 @@ public class BackupUtil {
174174 Log.e(TAG, "Error restoring backup", e);
175175 return -1;
176176 }
177- return appsRestored;
177+ return appsRestored;
178178 }
179179
180180 private static int restoreApps(Context context, XmlPullParser parser)
旧リポジトリブラウザで表示