Loading packages/SoundPicker/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ android_library { ], static_libs: [ "androidx.appcompat_appcompat", "hilt_android", "guava", ], } Loading packages/SoundPicker/AndroidManifest.xml +3 −1 Original line number Diff line number Diff line Loading @@ -12,8 +12,10 @@ <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS" /> <application android:name=".RingtonePickerApplication" android:allowBackup="false" android:label="@string/app_label" android:theme="@style/Theme.AppCompat" android:supportsRtl="true"> <receiver android:name="RingtoneReceiver" android:exported="true"> Loading @@ -25,7 +27,7 @@ <service android:name="RingtoneOverlayService" /> <activity android:name="RingtonePickerActivity" android:theme="@style/PickerDialogTheme" android:theme="@style/Theme.AppCompat.Dialog" android:enabled="@*android:bool/config_defaultRingtonePickerEnabled" android:excludeFromRecents="true" android:exported="true"> Loading packages/SoundPicker/res/layout/activity_ringtone_picker.xml 0 → 100644 +20 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?><!-- Copyright (C) 2023 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. --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" /> No newline at end of file packages/SoundPicker/src/com/android/soundpicker/ListeningExecutorServiceFactory.java 0 → 100644 +44 −0 Original line number Diff line number Diff line /* * Copyright (C) 2023 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.soundpicker; import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.MoreExecutors; import java.util.concurrent.Executors; import javax.inject.Inject; import javax.inject.Singleton; /** * A factory class used to create {@link ListeningExecutorService}. */ @Singleton public class ListeningExecutorServiceFactory { @Inject ListeningExecutorServiceFactory() { } /** * Returns a single thread {@link ListeningExecutorService}. * */ public ListeningExecutorService createSingleThreadExecutor() { return MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor()); } } packages/SoundPicker/src/com/android/soundpicker/RingtoneFactory.java +9 −2 Original line number Diff line number Diff line Loading @@ -21,15 +21,22 @@ import android.media.Ringtone; import android.media.RingtoneManager; import android.net.Uri; import dagger.hilt.android.qualifiers.ApplicationContext; import javax.inject.Inject; import javax.inject.Singleton; /** * A factory class used to create {@link Ringtone}. */ @Singleton public class RingtoneFactory { private final Context mApplicationContext; RingtoneFactory(Context context) { mApplicationContext = context.getApplicationContext(); @Inject RingtoneFactory(@ApplicationContext Context applicationContext) { mApplicationContext = applicationContext; } /** Loading Loading
packages/SoundPicker/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ android_library { ], static_libs: [ "androidx.appcompat_appcompat", "hilt_android", "guava", ], } Loading
packages/SoundPicker/AndroidManifest.xml +3 −1 Original line number Diff line number Diff line Loading @@ -12,8 +12,10 @@ <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS" /> <application android:name=".RingtonePickerApplication" android:allowBackup="false" android:label="@string/app_label" android:theme="@style/Theme.AppCompat" android:supportsRtl="true"> <receiver android:name="RingtoneReceiver" android:exported="true"> Loading @@ -25,7 +27,7 @@ <service android:name="RingtoneOverlayService" /> <activity android:name="RingtonePickerActivity" android:theme="@style/PickerDialogTheme" android:theme="@style/Theme.AppCompat.Dialog" android:enabled="@*android:bool/config_defaultRingtonePickerEnabled" android:excludeFromRecents="true" android:exported="true"> Loading
packages/SoundPicker/res/layout/activity_ringtone_picker.xml 0 → 100644 +20 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?><!-- Copyright (C) 2023 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. --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" /> No newline at end of file
packages/SoundPicker/src/com/android/soundpicker/ListeningExecutorServiceFactory.java 0 → 100644 +44 −0 Original line number Diff line number Diff line /* * Copyright (C) 2023 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.soundpicker; import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.MoreExecutors; import java.util.concurrent.Executors; import javax.inject.Inject; import javax.inject.Singleton; /** * A factory class used to create {@link ListeningExecutorService}. */ @Singleton public class ListeningExecutorServiceFactory { @Inject ListeningExecutorServiceFactory() { } /** * Returns a single thread {@link ListeningExecutorService}. * */ public ListeningExecutorService createSingleThreadExecutor() { return MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor()); } }
packages/SoundPicker/src/com/android/soundpicker/RingtoneFactory.java +9 −2 Original line number Diff line number Diff line Loading @@ -21,15 +21,22 @@ import android.media.Ringtone; import android.media.RingtoneManager; import android.net.Uri; import dagger.hilt.android.qualifiers.ApplicationContext; import javax.inject.Inject; import javax.inject.Singleton; /** * A factory class used to create {@link Ringtone}. */ @Singleton public class RingtoneFactory { private final Context mApplicationContext; RingtoneFactory(Context context) { mApplicationContext = context.getApplicationContext(); @Inject RingtoneFactory(@ApplicationContext Context applicationContext) { mApplicationContext = applicationContext; } /** Loading