Merge "Revert "Don't kill apps for OP_REQUEST_INSTALL_PACKAGES on targetSdk < 26."" into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
d4fe81e7e7
@@ -83,7 +83,6 @@ import android.content.res.ObbInfo;
|
|||||||
import android.database.ContentObserver;
|
import android.database.ContentObserver;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Binder;
|
import android.os.Binder;
|
||||||
import android.os.Build;
|
|
||||||
import android.os.DropBoxManager;
|
import android.os.DropBoxManager;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
@@ -4663,10 +4662,6 @@ class StorageManagerService extends IStorageManager.Stub
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onAppOpsChanged(int code, int uid, @Nullable String packageName, int mode) {
|
public void onAppOpsChanged(int code, int uid, @Nullable String packageName, int mode) {
|
||||||
if (packageName == null) {
|
|
||||||
// This happens :(
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
final long token = Binder.clearCallingIdentity();
|
final long token = Binder.clearCallingIdentity();
|
||||||
try {
|
try {
|
||||||
if (mIsFuseEnabled) {
|
if (mIsFuseEnabled) {
|
||||||
@@ -4674,20 +4669,7 @@ class StorageManagerService extends IStorageManager.Stub
|
|||||||
switch(code) {
|
switch(code) {
|
||||||
case OP_REQUEST_INSTALL_PACKAGES:
|
case OP_REQUEST_INSTALL_PACKAGES:
|
||||||
// Always kill regardless of op change, to remount apps /storage
|
// Always kill regardless of op change, to remount apps /storage
|
||||||
try {
|
killAppForOpChange(code, uid, packageName);
|
||||||
ApplicationInfo ai = mIPackageManager.getApplicationInfo(
|
|
||||||
packageName,
|
|
||||||
0, UserHandle.getUserId(uid));
|
|
||||||
if (ai.targetSdkVersion >= Build.VERSION_CODES.O) {
|
|
||||||
killAppForOpChange(code, uid, packageName);
|
|
||||||
} else {
|
|
||||||
// Apps targeting <26 didn't need this app op to install
|
|
||||||
// packages - they only need the manifest permission, instead.
|
|
||||||
// So, there's also no need to kill them.
|
|
||||||
}
|
|
||||||
} catch (RemoteException e) {
|
|
||||||
// Ignore, this is an in-process call
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
case OP_MANAGE_EXTERNAL_STORAGE:
|
case OP_MANAGE_EXTERNAL_STORAGE:
|
||||||
if (mode != MODE_ALLOWED) {
|
if (mode != MODE_ALLOWED) {
|
||||||
|
|||||||
Reference in New Issue
Block a user