Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<string name="check_for_updates_summary">Tap to check for updates</string>
<string name="notification_settings_title">Notification settings</string>
<string name="notification_settings_summary">Modify notification channel settings</string>
<string name="alert_pending_reboot">An update was previously downloaded and is ready to install, so it is not possible to download another update. Please reboot to install the pending update.</string>
<string name="use_security_preview_channel_title">Receive security preview releases</string>
<string name="use_security_preview_channel_summary_on">Use alternate release channels receiving security patches still under an embargo for source code and details</string>
<string name="use_security_preview_channel_summary_off">Don\'t use alternate release channels receiving security patches still under an embargo for source code and details</string>
Expand Down
10 changes: 10 additions & 0 deletions src/app/seamlessupdate/client/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import android.os.UserManager;
import android.util.Log;
import android.view.MenuItem;
import android.app.AlertDialog;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
Expand Down Expand Up @@ -104,6 +105,13 @@ public static class SettingsFragment extends PreferenceFragmentCompat
implements SharedPreferences.OnSharedPreferenceChangeListener {
private static String TAG = "SettingsFragment";

private void showAlertDialogForPendingReboot(final Context context) {
new AlertDialog.Builder(context)
.setTitle(android.R.string.dialog_alert_title)
.setMessage(R.string.alert_pending_reboot)
.show();
}

@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
getPreferenceManager().setStorageDeviceProtected();
Expand All @@ -121,6 +129,8 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
intent.putExtra(Service.INTENT_EXTRA_IS_USER_INITIATED, true);
intent.putExtra(Service.INTENT_EXTRA_NETWORK, network);
context.startForegroundService(intent);
} else {
showAlertDialogForPendingReboot(context);
}
return true;
});
Expand Down