The big code style cleanup

* Format using AOSP code style in Android Studio,
  excluding `Rearrange entries` option.
* Rename static variables to use proper naming scheme
* Remove empty lines

Change-Id: I0d193e35f071bc288050e587b1693844d68865e1
This commit is contained in:
Michael Bestas
2021-08-25 19:13:30 +03:00
committed by Timi Rautamäki
parent ade1361e3b
commit b7b34b96a9
32 changed files with 376 additions and 378 deletions

View File

@@ -19,11 +19,6 @@ package org.lineageos.setupwizard.wizardmanager;
import static org.lineageos.setupwizard.SetupWizardApp.LOGV;
import com.android.internal.util.XmlUtils;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import android.app.Activity;
import android.content.ContentResolver;
import android.content.Context;
@@ -33,6 +28,11 @@ import android.os.Parcelable;
import android.util.Log;
import android.util.Xml;
import com.android.internal.util.XmlUtils;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
@@ -88,12 +88,12 @@ public class WizardScript implements Parcelable {
public String getNextActionId(String currentActionId, int resultCode) {
String nextActionId = null;
if(resultCode != Activity.RESULT_CANCELED) {
if (resultCode != Activity.RESULT_CANCELED) {
WizardAction wizardAction = mActions.get(currentActionId);
if (LOGV) {
StringBuilder currentAction =
new StringBuilder().append("getNextActionId(").append(currentActionId)
.append(",").append(resultCode).append(")").append(" current uri=");
.append(",").append(resultCode).append(")").append(" current uri=");
String uri = wizardAction == null ? "n/a" : wizardAction.getUri();
Log.v(TAG, currentAction.append(uri).toString());
}
@@ -139,8 +139,8 @@ public class WizardScript implements Parcelable {
try {
ContentResolver.OpenResourceIdResult openResourceIdResult =
context.getContentResolver().getResourceId(Uri
.parse(uriString));
if("xml".equals(openResourceIdResult.r.getResourceTypeName(openResourceIdResult.id))) {
.parse(uriString));
if ("xml".equals(openResourceIdResult.r.getResourceTypeName(openResourceIdResult.id))) {
xmlPullParser =
openResourceIdResult.r.getXml(openResourceIdResult.id);
} else {
@@ -164,11 +164,11 @@ public class WizardScript implements Parcelable {
Log.e(TAG, "Ill-formatted wizard_script: " + uriString);
Log.e(TAG, e.getMessage());
return wizardScript;
} catch(FileNotFoundException fnfe) {
} catch (FileNotFoundException fnfe) {
Log.e(TAG, "Cannot find file: " + uriString);
Log.e(TAG, fnfe.getMessage());
return wizardScript;
} catch(IOException ioe) {
} catch (IOException ioe) {
Log.e(TAG, "Unable to read wizard_script: " + uriString);
Log.e(TAG, ioe.getMessage());
return wizardScript;
@@ -178,14 +178,14 @@ public class WizardScript implements Parcelable {
private static WizardScript parseWizardScript(XmlPullParser parser)
throws XmlPullParserException, IOException {
String startTag = parser.getName();
if(!TAG_WIZARD_SCRIPT.equals(startTag)) {
if (!TAG_WIZARD_SCRIPT.equals(startTag)) {
throw new XmlPullParserException("XML document must start with " +
"<WizardScript> tag; found "
+ startTag + " at " + parser.getPositionDescription());
}
String firstAction = parser.getAttributeValue(WIZARD_SCRIPT_NAMESPACE, ATTR_FIRST_ACTION);
if(firstAction == null) {
if (firstAction == null) {
throw new XmlPullParserException("WizardScript must define a firstAction");
}