More cleanup in installer classes
This commit is contained in:
parent
aeae0bcec3
commit
91ddc838a7
@ -50,7 +50,7 @@ public class DefaultInstaller extends Installer {
|
|||||||
private static final int REQUEST_CODE_DELETE = 1;
|
private static final int REQUEST_CODE_DELETE = 1;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void installPackageInternal(File apkFile) throws AndroidNotCompatibleException {
|
protected void installPackageInternal(File apkFile) throws AndroidNotCompatibleException {
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
intent.setAction(Intent.ACTION_VIEW);
|
intent.setAction(Intent.ACTION_VIEW);
|
||||||
intent.setDataAndType(Uri.fromFile(apkFile),
|
intent.setDataAndType(Uri.fromFile(apkFile),
|
||||||
@ -63,7 +63,13 @@ public class DefaultInstaller extends Installer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deletePackageInternal(String packageName) throws AndroidNotCompatibleException {
|
protected void installPackageInternal(List<File> apkFiles) throws AndroidNotCompatibleException {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void deletePackageInternal(String packageName) throws AndroidNotCompatibleException {
|
||||||
PackageInfo pkgInfo = null;
|
PackageInfo pkgInfo = null;
|
||||||
try {
|
try {
|
||||||
pkgInfo = mPm.getPackageInfo(packageName, 0);
|
pkgInfo = mPm.getPackageInfo(packageName, 0);
|
||||||
@ -106,10 +112,4 @@ public class DefaultInstaller extends Installer {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void installPackageInternal(List<File> apkFiles) throws AndroidNotCompatibleException {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ public class DefaultInstallerSdk14 extends Installer {
|
|||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
public void installPackageInternal(File apkFile) throws AndroidNotCompatibleException {
|
protected void installPackageInternal(File apkFile) throws AndroidNotCompatibleException {
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
intent.setAction(Intent.ACTION_INSTALL_PACKAGE);
|
intent.setAction(Intent.ACTION_INSTALL_PACKAGE);
|
||||||
intent.setData(Uri.fromFile(apkFile));
|
intent.setData(Uri.fromFile(apkFile));
|
||||||
@ -75,7 +75,13 @@ public class DefaultInstallerSdk14 extends Installer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deletePackageInternal(String packageName) throws AndroidNotCompatibleException {
|
protected void installPackageInternal(List<File> apkFiles) throws AndroidNotCompatibleException {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void deletePackageInternal(String packageName) throws AndroidNotCompatibleException {
|
||||||
PackageInfo pkgInfo = null;
|
PackageInfo pkgInfo = null;
|
||||||
try {
|
try {
|
||||||
pkgInfo = mPm.getPackageInfo(packageName, 0);
|
pkgInfo = mPm.getPackageInfo(packageName, 0);
|
||||||
@ -130,10 +136,4 @@ public class DefaultInstallerSdk14 extends Installer {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void installPackageInternal(List<File> apkFiles) throws AndroidNotCompatibleException {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ public class RootInstaller extends Installer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void installPackageInternal(final File apkFile) throws AndroidNotCompatibleException {
|
protected void installPackageInternal(final File apkFile) throws AndroidNotCompatibleException {
|
||||||
rootSession = createShellBuilder().open(new Shell.OnCommandResultListener() {
|
rootSession = createShellBuilder().open(new Shell.OnCommandResultListener() {
|
||||||
|
|
||||||
// Callback to report whether the shell was successfully
|
// Callback to report whether the shell was successfully
|
||||||
@ -75,7 +75,7 @@ public class RootInstaller extends Installer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void installPackageInternal(final List<File> apkFiles)
|
protected void installPackageInternal(final List<File> apkFiles)
|
||||||
throws AndroidNotCompatibleException {
|
throws AndroidNotCompatibleException {
|
||||||
rootSession = createShellBuilder().open(new Shell.OnCommandResultListener() {
|
rootSession = createShellBuilder().open(new Shell.OnCommandResultListener() {
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ public class RootInstaller extends Installer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deletePackageInternal(final String packageName)
|
protected void deletePackageInternal(final String packageName)
|
||||||
throws AndroidNotCompatibleException {
|
throws AndroidNotCompatibleException {
|
||||||
rootSession = createShellBuilder().open(new Shell.OnCommandResultListener() {
|
rootSession = createShellBuilder().open(new Shell.OnCommandResultListener() {
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ public class SystemPermissionInstaller extends Installer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void installPackageInternal(File apkFile) throws AndroidNotCompatibleException {
|
protected void installPackageInternal(File apkFile) throws AndroidNotCompatibleException {
|
||||||
Uri packageURI = Uri.fromFile(apkFile);
|
Uri packageURI = Uri.fromFile(apkFile);
|
||||||
try {
|
try {
|
||||||
mInstallMethod.invoke(mPm, new Object[] {
|
mInstallMethod.invoke(mPm, new Object[] {
|
||||||
@ -137,7 +137,13 @@ public class SystemPermissionInstaller extends Installer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deletePackageInternal(String packageName) throws AndroidNotCompatibleException {
|
protected void installPackageInternal(List<File> apkFiles) throws AndroidNotCompatibleException {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void deletePackageInternal(String packageName) throws AndroidNotCompatibleException {
|
||||||
try {
|
try {
|
||||||
mDeleteMethod.invoke(mPm, new Object[] {
|
mDeleteMethod.invoke(mPm, new Object[] {
|
||||||
packageName, mDeleteObserver, 0
|
packageName, mDeleteObserver, 0
|
||||||
@ -464,9 +470,4 @@ public class SystemPermissionInstaller extends Installer {
|
|||||||
*/
|
*/
|
||||||
public static final int DELETE_FAILED_USER_RESTRICTED = -3;
|
public static final int DELETE_FAILED_USER_RESTRICTED = -3;
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void installPackageInternal(List<File> apkFiles) throws AndroidNotCompatibleException {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user