Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 45fdb020 authored by Hai Zhang's avatar Hai Zhang Committed by Android (Google) Code Review
Browse files

Merge "Clean up STOPSHIP comments for role." into qt-dev

parents d4f8301f 2f9be529
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;
        }

+1 −1
Original line number Diff line number Diff line
@@ -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();
    }
+7 −2
Original line number Diff line number Diff line
@@ -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;
@@ -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);
+3 −2
Original line number Diff line number Diff line
@@ -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);
+2 −2
Original line number Diff line number Diff line
@@ -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;
@@ -53,6 +53,7 @@ public class RoleControllerServiceImpl extends RoleControllerService {
    @Override
    public void onCreate() {
        super.onCreate();

        mRoleManager = getSystemService(RoleManager.class);
    }

@@ -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