mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
[FileEncap1] Extract hasUploadingPermisssions method
Change-Id: Ica1dabcf066cde6580035f12fa35a404cb32fb3f
This commit is contained in:
parent
84bc16af3e
commit
347b2ebebf
@ -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…
x
Reference in New Issue
Block a user