1 /* 2 * Copyright (C) 2019 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.music; 18 19 import android.app.ListActivity; 20 import android.content.AsyncQueryHandler; 21 import android.content.ContentUris; 22 import android.content.Context; 23 import android.content.Intent; 24 import android.database.CharArrayBuffer; 25 import android.database.Cursor; 26 import android.media.AudioManager; 27 import android.media.MediaPlayer; 28 import android.media.RingtoneManager; 29 import android.net.Uri; 30 import android.os.Bundle; 31 import android.os.Parcelable; 32 import android.provider.MediaStore; 33 import android.text.TextUtils; 34 import android.util.Log; 35 import android.view.Menu; 36 import android.view.MenuItem; 37 import android.view.View; 38 import android.view.ViewGroup; 39 import android.view.Window; 40 import android.view.animation.AnimationUtils; 41 import android.widget.ImageView; 42 import android.widget.ListView; 43 import android.widget.RadioButton; 44 import android.widget.SectionIndexer; 45 import android.widget.SimpleCursorAdapter; 46 import android.widget.TextView; 47 48 import java.io.IOException; 49 import java.text.Collator; 50 import java.util.Formatter; 51 import java.util.Locale; 52 53 /** 54 * A dummy class to handle android.intent.action.PICK Intent. 55 */ 56 public class MusicPicker extends ListActivity implements View.OnClickListener { 57 static final boolean DBG = false; 58 static final String TAG = "MusicPicker"; 59 60 /** Uri to the directory of all music being displayed. */ 61 Uri mBaseUri; 62 63 /** Called when the activity is first created. */ 64 @Override onCreate(Bundle icicle)65 public void onCreate(Bundle icicle) { 66 super.onCreate(icicle); 67 if (Intent.ACTION_GET_CONTENT.equals(getIntent().getAction())) { 68 mBaseUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI; 69 } else { 70 mBaseUri = getIntent().getData(); 71 } 72 Log.w("MusicPicker", "Doesn't handle for data URI given to PICK action"); 73 } 74 75 @Override onRestart()76 public void onRestart() { 77 super.onRestart(); 78 } 79 80 @Override onOptionsItemSelected(MenuItem item)81 public boolean onOptionsItemSelected(MenuItem item) { 82 return super.onOptionsItemSelected(item); 83 } 84 85 @Override onCreateOptionsMenu(Menu menu)86 public boolean onCreateOptionsMenu(Menu menu) { 87 super.onCreateOptionsMenu(menu); 88 return true; 89 } 90 91 @Override onSaveInstanceState(Bundle icicle)92 protected void onSaveInstanceState(Bundle icicle) { 93 super.onSaveInstanceState(icicle); 94 } 95 96 @Override onPause()97 public void onPause() { 98 super.onPause(); 99 } 100 101 @Override onStop()102 public void onStop() { 103 super.onStop(); 104 } 105 106 @Override onListItemClick(ListView l, View v, int position, long id)107 protected void onListItemClick(ListView l, View v, int position, long id) {} 108 onClick(View v)109 public void onClick(View v) {} 110 } 111