LeanbackDemo: Search requests runtime permission
Bug: 23958590 Change-Id: I058b80050285b9912fefbcaca3f897f8a6b87b3d
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
android:versionName="1.0">
|
android:versionName="1.0">
|
||||||
|
|
||||||
<uses-sdk android:minSdkVersion="17" android:targetSdkVersion="23" />
|
<uses-sdk android:minSdkVersion="17" android:targetSdkVersion="23" />
|
||||||
|
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public class SearchActivity extends Activity
|
|||||||
private static boolean DEBUG = true;
|
private static boolean DEBUG = true;
|
||||||
|
|
||||||
/** If using internal speech recognizer, you must have RECORD_AUDIO permission */
|
/** If using internal speech recognizer, you must have RECORD_AUDIO permission */
|
||||||
private static boolean USE_INTERNAL_SPEECH_RECOGNIZER = false;
|
private static boolean USE_INTERNAL_SPEECH_RECOGNIZER = true;
|
||||||
private static final int REQUEST_SPEECH = 1;
|
private static final int REQUEST_SPEECH = 1;
|
||||||
|
|
||||||
private SearchFragment mFragment;
|
private SearchFragment mFragment;
|
||||||
@@ -62,4 +62,5 @@ public class SearchActivity extends Activity
|
|||||||
mFragment.setSearchQuery(data, true);
|
mFragment.setSearchQuery(data, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class SearchSupportActivity extends FragmentActivity
|
|||||||
private static boolean DEBUG = true;
|
private static boolean DEBUG = true;
|
||||||
|
|
||||||
/** If using internal speech recognizer, you must have RECORD_AUDIO permission */
|
/** If using internal speech recognizer, you must have RECORD_AUDIO permission */
|
||||||
private static boolean USE_INTERNAL_SPEECH_RECOGNIZER = false;
|
private static boolean USE_INTERNAL_SPEECH_RECOGNIZER = true;
|
||||||
private static final int REQUEST_SPEECH = 1;
|
private static final int REQUEST_SPEECH = 1;
|
||||||
|
|
||||||
private SearchSupportFragment mFragment;
|
private SearchSupportFragment mFragment;
|
||||||
@@ -64,4 +64,5 @@ public class SearchSupportActivity extends FragmentActivity
|
|||||||
mFragment.setSearchQuery(data, true);
|
mFragment.setSearchQuery(data, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user