am b000e94e: Merge "[FileEncap1] Extract hasUploadingPermisssions method"
* commit 'b000e94eea988e58fe5de7cb1a2f8fc03acfd4b3': [FileEncap1] Extract hasUploadingPermisssions methodmain
commit
a537cbf132
|
@ -72,10 +72,7 @@ public final class UploaderService extends IntentService {
|
||||||
mFilesDir = null;
|
mFilesDir = null;
|
||||||
mUrl = null;
|
mUrl = null;
|
||||||
|
|
||||||
final PackageManager packageManager = getPackageManager();
|
if (!hasUploadingPermission()) {
|
||||||
final boolean hasPermission = packageManager.checkPermission(Manifest.permission.INTERNET,
|
|
||||||
getPackageName()) == PackageManager.PERMISSION_GRANTED;
|
|
||||||
if (!hasPermission) {
|
|
||||||
return;
|
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
|
@Override
|
||||||
protected void onHandleIntent(Intent intent) {
|
protected void onHandleIntent(Intent intent) {
|
||||||
if (!mCanUpload) {
|
if (!mCanUpload) {
|
||||||
|
|
Loading…
Reference in New Issue