Replaced if with switch. Fixed typo in error.
This commit is contained in:
parent
c5bf2a131b
commit
ab33eccaa2
@ -122,7 +122,7 @@ public class RepoPersister {
|
||||
try {
|
||||
context.getContentResolver().applyBatch(TempApkProvider.getAuthority(), apkOperations);
|
||||
} catch (RemoteException | OperationApplicationException e) {
|
||||
throw new RepoUpdater.UpdateException(repo, "An internal error occured while updating the database", e);
|
||||
throw new RepoUpdater.UpdateException(repo, "An internal error occurred while updating the database", e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -132,7 +132,7 @@ public class RepoPersister {
|
||||
try {
|
||||
context.getContentResolver().applyBatch(TempAppProvider.getAuthority(), appOperations);
|
||||
} catch (RemoteException | OperationApplicationException e) {
|
||||
throw new RepoUpdater.UpdateException(repo, "An internal error occured while updating the database", e);
|
||||
throw new RepoUpdater.UpdateException(repo, "An internal error occurred while updating the database", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -89,15 +89,15 @@ public class TempApkProvider extends ApkProvider {
|
||||
|
||||
@Override
|
||||
public Uri insert(Uri uri, ContentValues values) {
|
||||
int code = matcher.match(uri);
|
||||
if (code == CODE_INIT) {
|
||||
initTable();
|
||||
return null;
|
||||
} else if (code == CODE_COMMIT) {
|
||||
commitTable();
|
||||
return null;
|
||||
} else {
|
||||
return super.insert(uri, values);
|
||||
switch (matcher.match(uri)) {
|
||||
case CODE_INIT:
|
||||
initTable();
|
||||
return null;
|
||||
case CODE_COMMIT:
|
||||
commitTable();
|
||||
return null;
|
||||
default:
|
||||
return super.insert(uri, values);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -77,17 +77,16 @@ public class TempAppProvider extends AppProvider {
|
||||
|
||||
@Override
|
||||
public Uri insert(Uri uri, ContentValues values) {
|
||||
int code = matcher.match(uri);
|
||||
|
||||
if (code == CODE_INIT) {
|
||||
initTable();
|
||||
return null;
|
||||
} else if (code == CODE_COMMIT) {
|
||||
updateAppDetails();
|
||||
commitTable();
|
||||
return null;
|
||||
} else {
|
||||
return super.insert(uri, values);
|
||||
switch (matcher.match(uri)) {
|
||||
case CODE_INIT:
|
||||
initTable();
|
||||
return null;
|
||||
case CODE_COMMIT:
|
||||
updateAppDetails();
|
||||
commitTable();
|
||||
return null;
|
||||
default:
|
||||
return super.insert(uri, values);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user