Home | History | Annotate | Download | only in exchange
      1 /*
      2  * Copyright (C) 2011 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 
     18 package com.android.exchange;
     19 
     20 import android.app.Activity;
     21 import android.content.Intent;
     22 import android.os.Bundle;
     23 
     24 import com.android.emailcommon.utility.IntentUtilities;
     25 
     26 /**
     27  * An empty {@link Activity} that simply redirects to the proper settings editor for the Email
     28  * application.
     29  * This is needed since the Exchange service runs as a separate UID and is therefore tracked as
     30  * a separate entity in the framework for things such as data usage. Links from those places to
     31  * Exchange should really go to Email where the real settings are.
     32  */
     33 public class SettingsRedirector extends Activity {
     34 
     35     @Override
     36     protected void onCreate(Bundle savedInstanceState) {
     37         super.onCreate(savedInstanceState);
     38         Intent intent = getIntent();
     39         Intent redirect = new Intent(
     40                 Intent.ACTION_EDIT,
     41                 IntentUtilities.createActivityIntentUrlBuilder("settings").build());
     42         redirect.setFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
     43         startActivity(redirect);
     44         finish();
     45     }
     46 }
     47