summaryrefslogtreecommitdiffstats
path: root/src/org
diff options
context:
space:
mode:
authorLikai Ding <likaid@codeaurora.org>2016-02-03 20:20:42 +0800
committerLikai Ding <likaid@codeaurora.org>2016-02-03 20:30:52 +0800
commitb586c53059538ad9855856c41247a716188eb7c6 (patch)
treed9d05212e6fe9e0799381c3702051a0692864429 /src/org
parentb13a6ae2441c37688960d3d9115de76e5c2fe5ac (diff)
downloadandroid_packages_apps_Gallery2-b586c53059538ad9855856c41247a716188eb7c6.tar.gz
android_packages_apps_Gallery2-b586c53059538ad9855856c41247a716188eb7c6.tar.bz2
android_packages_apps_Gallery2-b586c53059538ad9855856c41247a716188eb7c6.zip
Gallery2: fix permission issue
Gallery app is signed with platform key for APN settings. However, being a platform_app causes certain SELinux permission denials. As APN settings are actually delegated to Settings app, APN name query code can be removed from Gallery app, so that platform signature is no longer required. Change-Id: I269bb424facf09af1ff9549d77dd6e2022988ed0 CRs-Fixed: 960252 CRs-Fixed: 946086
Diffstat (limited to 'src/org')
-rwxr-xr-xsrc/org/codeaurora/gallery3d/video/SettingsActivity.java64
1 files changed, 0 insertions, 64 deletions
diff --git a/src/org/codeaurora/gallery3d/video/SettingsActivity.java b/src/org/codeaurora/gallery3d/video/SettingsActivity.java
index aca446bf3..262e761a6 100755
--- a/src/org/codeaurora/gallery3d/video/SettingsActivity.java
+++ b/src/org/codeaurora/gallery3d/video/SettingsActivity.java
@@ -2,7 +2,6 @@ package org.codeaurora.gallery3d.video;
import android.app.ActionBar;
import android.app.Activity;
-import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
@@ -93,68 +92,6 @@ public class SettingsActivity extends PreferenceActivity {
ab.setTitle(R.string.setting);
}
- private String getApnKey() {
- // to find default key
- String key = null;
- Cursor cursor = getContentResolver().query(PREFERAPN_URI, new String[] {
- "_id"
- }, null, null, Telephony.Carriers.DEFAULT_SORT_ORDER);
- if (cursor.getCount() > 0 && cursor.moveToFirst()) {
- key = cursor.getString(COLUMN_ID_INDEX);
- Log.v("settingActivty", "default apn key = " + key);
- }
- cursor.close();
- return key;
- }
-
- private String getApnName(String key) {
- String name = null;
- // to find default proxy
- String where = getOperatorNumericSelection();
-
- Cursor cursor = getContentResolver().query(Telephony.Carriers.CONTENT_URI, new String[] {
- "_id", "name", "apn", "type"
- }, where, null, Telephony.Carriers.DEFAULT_SORT_ORDER);
-
- while (cursor != null && cursor.moveToNext()) {
- String curKey = cursor.getString(cursor.getColumnIndex("_id"));
- String curName = cursor.getString(cursor.getColumnIndex("name"));
- if (curKey.equals(key)) {
- Log.d("rtsp", "getDefaultApnName, find, key=" + curKey + ",curName=" + curName);
- name = curName;
- break;
- }
- }
-
- if (cursor != null) {
- cursor.close();
- }
- return name;
-
- }
-
- private String getDefaultApnName() {
- return getApnName(getApnKey());
- }
-
- private String getSelectedApnKey() {
- String key = null;
-
- Cursor cursor = getContentResolver().query(PREFERAPN_URI, new String[] {
- "_id", "name"
- }, null, null, null);
- if (cursor.getCount() > 0) {
- cursor.moveToFirst();
- key = cursor.getString(NAME_INDEX);
- }
- cursor.close();
-
- Log.w("rtsp", "getSelectedApnKey key = " + key);
- if (null == key)
- return new String("null");
- return key;
- }
-
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == SELECT_APN) {
@@ -288,7 +225,6 @@ public class SettingsActivity extends PreferenceActivity {
private void setApnListener() {
final String SUBSCRIPTION_KEY = "subscription";
final String SUB_ID = "sub_id";
- mApn.setSummary(getDefaultApnName());
mApn.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
public boolean onPreferenceClick(Preference preference) {
Intent intent = new Intent(Settings.ACTION_APN_SETTINGS);