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

Commit dc950f16 authored by Philip P. Moltmann's avatar Philip P. Moltmann
Browse files

Remove Gallery and Music role

Test: atest CtsRoleTestCases
Fixes: 129789528
Change-Id: Ib28b2daeedeba15a8b96d508270cfd7e974f207a
parent 35c8b8d9
Loading
Loading
Loading
Loading
+0 −22
Original line number Diff line number Diff line
@@ -619,28 +619,6 @@
    <!-- Description when an app requests to become the default home app. [CHAR LIMIT=60] -->
    <string name="role_home_request_description">No permissions needed</string>

    <!-- Label for the music player role. [CHAR LIMIT=30] -->
    <string name="role_music_label">Default music app</string>
    <!-- Short label for the music player role. [CHAR LIMIT=30] -->
    <string name="role_music_short_label">Music app</string>
    <!-- Description for the music role. [CHAR LIMIT=NONE] -->
    <string name="role_music_description">Apps that allow you to play songs, podcasts, and other audio</string>
    <!-- Template for the title when an app requests to become the default music app. [CHAR LIMIT=100] -->
    <string name="role_music_request_title">Set <xliff:g id="app_name" example="Super Music">%1$s</xliff:g> as your default music app?</string>
    <!-- Description when an app requests to become the default music app. [CHAR LIMIT=60] -->
    <string name="role_music_request_description">Gets access to audio</string>

    <!-- Label for the gallery role. [CHAR LIMIT=30] -->
    <string name="role_gallery_label">Default gallery app</string>
    <!-- Short label for the gallery role. [CHAR LIMIT=30] -->
    <string name="role_gallery_short_label">Gallery app</string>
    <!-- Description for the gallery role. [CHAR LIMIT=NONE] -->
    <string name="role_gallery_description">Apps that allow you to view, organize, protect, and share your photos and videos</string>
    <!-- Template for the title when an app requests to become the default gallery app. [CHAR LIMIT=100] -->
    <string name="role_gallery_request_title">Set <xliff:g id="app_name" example="Super Gallery">%1$s</xliff:g> as your default gallery app?</string>
    <!-- Description when an app requests to become the default gallery app. [CHAR LIMIT=60] -->
    <string name="role_gallery_request_description">Gets access to photos and videos</string>

    <!-- Label for the automotive dialer role. [CHAR LIMIT=30] -->
    <string name="role_car_mode_dialer_label">Default car mode phone app</string>
    <!-- Short label for the automotive dialer role. [CHAR LIMIT=30] -->
+0 −79
Original line number Diff line number Diff line
@@ -364,85 +364,6 @@
        </preferred-activities>
    </role>

    <role
        name="android.app.role.MUSIC"
        behavior="MusicRoleBehavior"
        description="@string/role_music_description"
        exclusive="true"
        label="@string/role_music_label"
        requestDescription="@string/role_music_request_description"
        requestTitle="@string/role_music_request_title"
        shortLabel="@string/role_music_short_label">
        <required-components>
            <activity>
                <intent-filter>
                    <action name="android.intent.action.MAIN" />
                    <category name="android.intent.category.APP_MUSIC" />
                </intent-filter>
            </activity>
        </required-components>
        <permissions>
            <permission-set name="storage" />
        </permissions>
        <app-ops>
            <app-op name="android:write_media_audio" mode="allowed" />
        </app-ops>
        <preferred-activities>
            <preferred-activity>
                <activity>
                    <intent-filter>
                        <action name="android.intent.action.MAIN" />
                        <category name="android.intent.category.APP_MUSIC" />
                    </intent-filter>
                </activity>
                <intent-filter>
                    <action name="android.intent.action.MAIN" />
                    <category name="android.intent.category.APP_MUSIC" />
                </intent-filter>
            </preferred-activity>
        </preferred-activities>
    </role>

    <role
        name="android.app.role.GALLERY"
        behavior="GalleryRoleBehavior"
        description="@string/role_gallery_description"
        exclusive="true"
        label="@string/role_gallery_label"
        requestDescription="@string/role_gallery_request_description"
        requestTitle="@string/role_gallery_request_title"
        shortLabel="@string/role_gallery_short_label">
        <required-components>
            <activity>
                <intent-filter>
                    <action name="android.intent.action.MAIN" />
                    <category name="android.intent.category.APP_GALLERY" />
                </intent-filter>
            </activity>
        </required-components>
        <permissions>
            <permission-set name="storage" />
        </permissions>
        <app-ops>
            <app-op name="android:write_media_video" mode="allowed" />
            <app-op name="android:write_media_images" mode="allowed" />
        </app-ops>
        <preferred-activities>
            <preferred-activity>
                <activity>
                    <intent-filter>
                        <action name="android.intent.action.MAIN" />
                        <category name="android.intent.category.APP_GALLERY" />
                    </intent-filter>
                </activity>
                <intent-filter>
                    <action name="android.intent.action.MAIN" />
                    <category name="android.intent.category.APP_GALLERY" />
                </intent-filter>
            </preferred-activity>
        </preferred-activities>
    </role>

    <!--- @see android.telecom.InCallService -->
    <role
        name="android.app.role.CAR_MODE_DIALER"
+0 −36
Original line number Diff line number Diff line
/*
 * Copyright (C) 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.packageinstaller.role.model;

import android.content.Context;

import androidx.annotation.NonNull;

import java.util.List;

/**
 * Class for behavior of the gallery role.
 */
public class GalleryRoleBehavior implements RoleBehavior {

    @NonNull
    @Override
    public List<String> getDefaultHolders(@NonNull Role role, @NonNull Context context) {
        return ExclusiveDefaultHolderMixin.getDefaultHolders(role, "config_defaultGallery",
                context);
    }
}
+0 −35
Original line number Diff line number Diff line
/*
 * Copyright (C) 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.packageinstaller.role.model;

import android.content.Context;

import androidx.annotation.NonNull;

import java.util.List;

/**
 * Class for behavior of the music role.
 */
public class MusicRoleBehavior implements RoleBehavior {

    @NonNull
    @Override
    public List<String> getDefaultHolders(@NonNull Role role, @NonNull Context context) {
        return ExclusiveDefaultHolderMixin.getDefaultHolders(role, "config_defaultMusic", context);
    }
}