Loading src/com/android/packageinstaller/role/model/PreferredActivity.java +2 −1 Original line number Diff line number Diff line Loading @@ -72,8 +72,9 @@ public class PreferredActivity { PackageManager packageManager = context.getPackageManager(); ComponentName packageActivity = mActivity.getQualifyingComponentForPackage( packageName, context); // TODO: STOPSHIP: Race condition, what if packageActivity became null? Just don't crash? if (packageActivity == null) { // We might be running into some race condition here, but we can't do anything about it. // This should be handled by a future reconciliation started by the package change. return; } Loading src/com/android/packageinstaller/role/model/RequiredContentProvider.java +1 −1 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ public class RequiredContentProvider extends RequiredComponent { @Nullable @Override protected String getComponentPermission(@NonNull ResolveInfo resolveInfo) { // TODO: STOPSHIP: Which permission? Or both? // TODO: Which permission? Or both? //return resolveInfo.providerInfo.readPermission; throw new UnsupportedOperationException(); } Loading src/com/android/packageinstaller/role/model/Role.java +7 −2 Original line number Diff line number Diff line Loading @@ -525,7 +525,9 @@ public class Role { return false; } // TODO: STOPSHIP: Check for disabled packages? if (!applicationInfo.enabled) { return false; } if (applicationInfo.isInstantApp()) { return false; Loading Loading @@ -613,7 +615,10 @@ public class Role { appOp.revoke(packageName, context); } // TODO: STOPSHIP: Revoke preferred activities? // TODO: Revoke preferred activities? But this is unnecessary for most roles using it as // they have fallback holders. Moreover, clearing the preferred activity might result in // other system components listening to preferred activity change get notified for the // wrong thing when we are removing a exclusive role holder for adding another. if (mBehavior != null) { mBehavior.revoke(this, packageName, context); Loading src/com/android/packageinstaller/role/model/SmsRoleBehavior.java +3 −2 Original line number Diff line number Diff line Loading @@ -66,8 +66,9 @@ public class SmsRoleBehavior implements RoleBehavior { return defaultPackageName; } // TODO: STOPSHIP: This was the previous behavior, however this allows any third-party app // to suddenly become the default SMS app and get the permissions. // TODO(b/132916161): This was the previous behavior, however this may allow any third-party // app to suddenly become the default SMS app and get the permissions, if no system default // SMS app is available. List<String> qualifyingPackageNames = role.getQualifyingPackagesAsUser( Process.myUserHandle(), context); return CollectionUtils.firstOrNull(qualifyingPackageNames); Loading src/com/android/packageinstaller/role/service/RoleControllerServiceImpl.java +2 −2 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ public class RoleControllerServiceImpl extends RoleControllerService { private static final String LOG_TAG = RoleControllerServiceImpl.class.getSimpleName(); // TODO: STOPSHIP: Turn off debugging before we ship. // STOPSHIP: Turn off debugging before we ship. private static final boolean DEBUG = true; private RoleManager mRoleManager; Loading @@ -53,6 +53,7 @@ public class RoleControllerServiceImpl extends RoleControllerService { @Override public void onCreate() { super.onCreate(); mRoleManager = getSystemService(RoleManager.class); } Loading Loading @@ -335,7 +336,6 @@ public class RoleControllerServiceImpl extends RoleControllerService { } if (applicationInfo != null) { // TODO: STOPSHIP: Pass in appropriate arguments. role.revoke(packageName, dontKillApp, false, this); } Loading Loading
src/com/android/packageinstaller/role/model/PreferredActivity.java +2 −1 Original line number Diff line number Diff line Loading @@ -72,8 +72,9 @@ public class PreferredActivity { PackageManager packageManager = context.getPackageManager(); ComponentName packageActivity = mActivity.getQualifyingComponentForPackage( packageName, context); // TODO: STOPSHIP: Race condition, what if packageActivity became null? Just don't crash? if (packageActivity == null) { // We might be running into some race condition here, but we can't do anything about it. // This should be handled by a future reconciliation started by the package change. return; } Loading
src/com/android/packageinstaller/role/model/RequiredContentProvider.java +1 −1 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ public class RequiredContentProvider extends RequiredComponent { @Nullable @Override protected String getComponentPermission(@NonNull ResolveInfo resolveInfo) { // TODO: STOPSHIP: Which permission? Or both? // TODO: Which permission? Or both? //return resolveInfo.providerInfo.readPermission; throw new UnsupportedOperationException(); } Loading
src/com/android/packageinstaller/role/model/Role.java +7 −2 Original line number Diff line number Diff line Loading @@ -525,7 +525,9 @@ public class Role { return false; } // TODO: STOPSHIP: Check for disabled packages? if (!applicationInfo.enabled) { return false; } if (applicationInfo.isInstantApp()) { return false; Loading Loading @@ -613,7 +615,10 @@ public class Role { appOp.revoke(packageName, context); } // TODO: STOPSHIP: Revoke preferred activities? // TODO: Revoke preferred activities? But this is unnecessary for most roles using it as // they have fallback holders. Moreover, clearing the preferred activity might result in // other system components listening to preferred activity change get notified for the // wrong thing when we are removing a exclusive role holder for adding another. if (mBehavior != null) { mBehavior.revoke(this, packageName, context); Loading
src/com/android/packageinstaller/role/model/SmsRoleBehavior.java +3 −2 Original line number Diff line number Diff line Loading @@ -66,8 +66,9 @@ public class SmsRoleBehavior implements RoleBehavior { return defaultPackageName; } // TODO: STOPSHIP: This was the previous behavior, however this allows any third-party app // to suddenly become the default SMS app and get the permissions. // TODO(b/132916161): This was the previous behavior, however this may allow any third-party // app to suddenly become the default SMS app and get the permissions, if no system default // SMS app is available. List<String> qualifyingPackageNames = role.getQualifyingPackagesAsUser( Process.myUserHandle(), context); return CollectionUtils.firstOrNull(qualifyingPackageNames); Loading
src/com/android/packageinstaller/role/service/RoleControllerServiceImpl.java +2 −2 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ public class RoleControllerServiceImpl extends RoleControllerService { private static final String LOG_TAG = RoleControllerServiceImpl.class.getSimpleName(); // TODO: STOPSHIP: Turn off debugging before we ship. // STOPSHIP: Turn off debugging before we ship. private static final boolean DEBUG = true; private RoleManager mRoleManager; Loading @@ -53,6 +53,7 @@ public class RoleControllerServiceImpl extends RoleControllerService { @Override public void onCreate() { super.onCreate(); mRoleManager = getSystemService(RoleManager.class); } Loading Loading @@ -335,7 +336,6 @@ public class RoleControllerServiceImpl extends RoleControllerService { } if (applicationInfo != null) { // TODO: STOPSHIP: Pass in appropriate arguments. role.revoke(packageName, dontKillApp, false, this); } Loading