Merge "[FileEncap1] Extract hasUploadingPermisssions method"
This commit is contained in:
commit
b000e94eea
1 changed files with 7 additions and 4 deletions
|
@ -72,10 +72,7 @@ public final class UploaderService extends IntentService {
|
|||
mFilesDir = null;
|
||||
mUrl = null;
|
||||
|
||||
final PackageManager packageManager = getPackageManager();
|
||||
final boolean hasPermission = packageManager.checkPermission(Manifest.permission.INTERNET,
|
||||
getPackageName()) == PackageManager.PERMISSION_GRANTED;
|
||||
if (!hasPermission) {
|
||||
if (!hasUploadingPermission()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -92,6 +89,12 @@ public final class UploaderService extends IntentService {
|
|||
}
|
||||
}
|
||||
|
||||
private boolean hasUploadingPermission() {
|
||||
final PackageManager packageManager = getPackageManager();
|
||||
return packageManager.checkPermission(Manifest.permission.INTERNET,
|
||||
getPackageName()) == PackageManager.PERMISSION_GRANTED;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onHandleIntent(Intent intent) {
|
||||
if (!mCanUpload) {
|
||||
|
|
Loading…
Reference in a new issue