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 {
|
try {
|
||||||
context.getContentResolver().applyBatch(TempApkProvider.getAuthority(), apkOperations);
|
context.getContentResolver().applyBatch(TempApkProvider.getAuthority(), apkOperations);
|
||||||
} catch (RemoteException | OperationApplicationException e) {
|
} 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 {
|
try {
|
||||||
context.getContentResolver().applyBatch(TempAppProvider.getAuthority(), appOperations);
|
context.getContentResolver().applyBatch(TempAppProvider.getAuthority(), appOperations);
|
||||||
} catch (RemoteException | OperationApplicationException e) {
|
} 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
|
@Override
|
||||||
public Uri insert(Uri uri, ContentValues values) {
|
public Uri insert(Uri uri, ContentValues values) {
|
||||||
int code = matcher.match(uri);
|
switch (matcher.match(uri)) {
|
||||||
if (code == CODE_INIT) {
|
case CODE_INIT:
|
||||||
initTable();
|
initTable();
|
||||||
return null;
|
return null;
|
||||||
} else if (code == CODE_COMMIT) {
|
case CODE_COMMIT:
|
||||||
commitTable();
|
commitTable();
|
||||||
return null;
|
return null;
|
||||||
} else {
|
default:
|
||||||
return super.insert(uri, values);
|
return super.insert(uri, values);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,17 +77,16 @@ public class TempAppProvider extends AppProvider {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Uri insert(Uri uri, ContentValues values) {
|
public Uri insert(Uri uri, ContentValues values) {
|
||||||
int code = matcher.match(uri);
|
switch (matcher.match(uri)) {
|
||||||
|
case CODE_INIT:
|
||||||
if (code == CODE_INIT) {
|
initTable();
|
||||||
initTable();
|
return null;
|
||||||
return null;
|
case CODE_COMMIT:
|
||||||
} else if (code == CODE_COMMIT) {
|
updateAppDetails();
|
||||||
updateAppDetails();
|
commitTable();
|
||||||
commitTable();
|
return null;
|
||||||
return null;
|
default:
|
||||||
} else {
|
return super.insert(uri, values);
|
||||||
return super.insert(uri, values);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user