customer demand requires Google Play Store (phonesky.apk) to be uninstalled and needs to be placed under System/vendor/operator/app. This will cause you to encounter the following error when logging in to the Play store and cannot use:
FATAL EXCEPTION:d Ownload-manager-thread
Process:com.android.vending, pid:3016
Java.lang.SecurityException:Invalid value for Is_public_api:null
...... ......
This is because non-system apps cannot have Android.permission.ACCESS_DOWNLOAD_MANAGER permissions, In the Insert function of Downloadprovider, checkinsertpermissions is called to check database operation permissions, as follows:
private void checkInsertPermissions(ContentValues values) {
if (getContext().checkCallingOrSelfPermission(Downloads.Impl.PERMISSION_ACCESS)
== PackageManager.PERMISSION_GRANTED) {
return;
}
getContext().enforceCallingOrSelfPermission(android.Manifest.permission.INTERNET,
"INTERNET permission is required to use the download manager");
// ensure the request fits within the bounds of a public API request
// first copy so we can remove values
values = new ContentValues(values);
// check columns whose values are restricted
enforceAllowedValues(values, Downloads.Impl.COLUMN_IS_PUBLIC_API, Boolean.TRUE);
……
}
Since the Google Play store is placed in an unloaded area, its Downloads.Impl.COLUMN_IS_PUBLIC_API is empty and does not meet the conditions of true.
Solution:
"Method One" puts the Google Play store back into the System application area and does not do the uninstall process. This is simple, but does not meet customer demand.
"Method II" modified Packagemanagerservice source code, the Google Play store to do special processing, directly to give permission:
--- a/frameworks/base/services/java/com/android/server/pm/PackageManagerService.java
+++ b/frameworks/base/services/java/com/android/server/pm/PackageManagerService.java
@@ -5938,7 +5938,12 @@ public class PackageManagerService extends IPackageManager.Stub {
+ ")");
}
}
+ // TChip ZJ Add START:for Phoneshy Permission
+ if (pkg.packageName.equals("com.android.vending")){
+ allowed = true;
+ }
+ // TChip ZJ Add END
}
if ((changedPermission || replace) && !ps.permissionsFixed &&
!isSystemApp(ps) || isUpdatedSystemApp(ps)){
That's all you can do.
Android puts Google Play store in an unloaded area, login times SecurityException Error